Code Monkey home page Code Monkey logo

Comments (9)

astonzhang avatar astonzhang commented on May 13, 2024 2

Thanks! At the moment you may create your own repo d2l-ar, and start translating the Preliminaries chapter of the Release 0.7 (https://github.com/d2l-ai/d2l-en/releases/tag/v0.7.0). If we make changes in this chapter in the future release, you may git diff and incorporate translation of such changes. When translating, just leave math/code/labels/filenames as they are. Once you have a few chapters translated, I'll take a look and we can go from there :)

from d2l-en.

mohamed-ali avatar mohamed-ali commented on May 13, 2024 1

@astonzhang Thanks for the details. Arabic (like hebrew, persian and others) are right-to-left languages. So I would like to test the framework that generates the books to see the changes required to support such languages. Could you point to a minimal example generated with the same framework that I could play with to create a todo list of the changes required for RTL?
Thanks

from d2l-en.

mli avatar mli commented on May 13, 2024 1

you can change the _build/rst/conf.py manually to add support for Arabic, see http://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-internationalization

the pdf is built with xelatex, it should support Arabic as well

from d2l-en.

astonzhang avatar astonzhang commented on May 13, 2024

Sure, you may follow the instructions of http://book.d2l.ai/ to play with any example you like.

from d2l-en.

mohamed-ali avatar mohamed-ali commented on May 13, 2024

@mli thanks for suggesting using language="ar" but it doesn't have an impact on the page layout.

I spent sometime investigating various options to support RTL, I found that the best way is to create a rtl.css file and include it in the book's config.ini file.

[html]
...
# A list of CSS files to be included
include_css = static/rtl.css
...

The only blocker against using this technique is that, currently, mxtheme layout loads the custom css files before the main template's css. Here's the part responsible for that: https://github.com/mli/mx-theme/blob/master/mxtheme/layout.html#L14-L19

{% set css_files = css_files + [
    '_static/material-design-lite-1.3.0/material.' + theme_primary_color|e + '-' + theme_accent_color|e + '.min.css',
    '_static/sphinx_materialdesign_theme.css',
    '_static/fontawesome/all.css',
    '_static/fonts.css',
] %}

This means that any change to the template's layout in the custom file will be overwritten by loading the template's css after the custom css file.

This can be easily fixed by switching the order of concatenation, in mxtheme's layout.html page, to:

{% set css_files = [
  '_static/material-design-lite-1.3.0/material.' + theme_primary_color|e + '-' + theme_accent_color|e + '.min.css',
  '_static/sphinx_materialdesign_theme.css',
  '_static/fontawesome/all.css',
  '_static/fonts.css',
] + css_files %}

But before doing a PR to change the order, I would like to make sure that you don't have objections against reordering the css file loads as suggested.

@mli @astonzhang Is there something that requires the current css file load order?

Thanks.

from d2l-en.

mohamed-ali avatar mohamed-ali commented on May 13, 2024

@mli I added a PR to change the css files load order: mli/mx-theme#4

from d2l-en.

ChaiBapchya avatar ChaiBapchya commented on May 13, 2024

@mohamed-ali any update on this? Looks like it's not merged yet.

from d2l-en.

mohamed-ali avatar mohamed-ali commented on May 13, 2024

@ChaiBapchya I started some translations locally which required few changes. I can push PRs with the changes and translations, but as you can the PR in my last comment is still open.

from d2l-en.

ChaiBapchya avatar ChaiBapchya commented on May 13, 2024

Yes. I'm guessing we need to first get the change to css file load order merged & then your subsequent PR for translation. Right?
But to get css file load order verified, it would be great if you could verify existing functionality doesn't break + Arabic translations work too. Just because I don't know CSS thoroughly.

from d2l-en.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.