Comments (9)
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.
@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.
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.
Sure, you may follow the instructions of http://book.d2l.ai/ to play with any example you like.
from d2l-en.
@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.
@mli I added a PR to change the css files load order: mli/mx-theme#4
from d2l-en.
@mohamed-ali any update on this? Looks like it's not merged yet.
from d2l-en.
@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.
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)
- module 'd2l.torch' has no attribute 'count_corpus' HOT 3
- A question about 4.7.3.3. Label Shift Correction HOT 1
- PyTorch Colab of Chapter 13.5 is having an IndexError HOT 2
- Free copy for the first 100 contributors
- Ethics?
- MLX support HOT 1
- Add type hinting to functions HOT 1
- Incorrect Use of torch.no_grad() in fit_epoch Method in d2l/torch.py::Trainer::fit_epoch HOT 2
- Not able to render :begin_tab:toc
- Errors in train_ch3 in tensorflow version softmax-regression-scratch.ipynb HOT 1
- [**emergency**] the comment block is down, please fix it right now HOT 1
- Chinese version of the code is out of date
- The discussion link can not be accessed. HOT 7
- The mlm loss computation in the function _get_batch_loss_bert seems wrong in d2l pytorch code HOT 2
- Can't build the book on MacOS when trying to add MLX implementation
- Some issues with the book
- WikiText-2 is not a zip file HOT 2
- question about ”d2l = sys.modules[__name__]“
- Website of preview version is down. HOT 5
- The content is outdated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d2l-en.