Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate content to Arabic #540

Open
SilentJMA opened this issue Nov 25, 2019 · 6 comments
Open

Translate content to Arabic #540

SilentJMA opened this issue Nov 25, 2019 · 6 comments
Assignees
Projects
Milestone

Comments

@SilentJMA
Copy link
Contributor

@SilentJMA SilentJMA commented Nov 25, 2019

These are the chapters to be translated, and they exist in the content directory:

  • accessibility
  • caching
  • cdn
  • cms
  • compression
  • css
  • ecommerce
  • fonts
  • http2
  • javascript
  • markup
  • media
  • mobile-web
  • page-weight
  • performance
  • pwa
  • resource-hints
  • security
  • seo
  • third-parties

Additionally the following pages need translated too in the language specific templates directory:

  • base.html
  • base_chapter.html
  • chapter.html
  • contributors.html
  • index.html
  • methodology.html
  • table_of_contents.html

There is no need to translate the chapters HTML pages are they are generated off the markdown combined with the above templates.

Common notes for writing consistency are here: https://github.com/HTTPArchive/almanac.httparchive.org/wiki/Translators'-Guide. Feel free to edit that and/or add Arabic-specific extras by editing this comment.

Arabic-specific extra advice:

  • None yet
@bazzadp

This comment has been minimized.

Copy link
Contributor

@bazzadp bazzadp commented Nov 25, 2019

Greats stuff @SilentJMA - I've updated your first comment showing what needs to be done. Feel free to stick your name against an item, clone the repo, and submit pull requests (PRs) with your translations.

Note a lot of the visualisation graphics are due to change in #511 so might want to hold off for that for some of the chapters, but the JavaScript, Accessibility and HTTP/2 chapters are good to go now.

Unfortunately my Arabic is non-existent so would be good to have someone else fluent in the language to review your PRs. I'm happy to give PRs a once over for other technical issues though.

@bazzadp bazzadp assigned bazzadp and SilentJMA and unassigned bazzadp Nov 25, 2019
@bazzadp bazzadp added the Translation label Nov 25, 2019
@rviscomi rviscomi added this to TODO in Web Almanac via automation Nov 25, 2019
@rviscomi rviscomi added this to the Après Ski milestone Nov 25, 2019
@SilentJMA

This comment has been minimized.

Copy link
Contributor Author

@SilentJMA SilentJMA commented Nov 27, 2019

Greats stuff @SilentJMA - I've updated your first comment showing what needs to be done. Feel free to stick your name against an item, clone the repo, and submit pull requests (PRs) with your translations.

Note a lot of the visualisation graphics are due to change in #511 so might want to hold off for that for some of the chapters, but the JavaScript, Accessibility and HTTP/2 chapters are good to go now.

Unfortunately my Arabic is non-existent so would be good to have someone else fluent in the language to review your PRs. I'm happy to give PRs a once over for other technical issues though.

in #540 we will need a change from Left to Right is it possible because it's different to FR/EN/ES.. which start from left to right

@bazzadp

This comment has been minimized.

Copy link
Contributor

@bazzadp bazzadp commented Nov 27, 2019

in #540 we will need a change from Left to Right is it possible because it's different to FR/EN/ES.. which start from left to right

Yes this is possible.

Everything inherits based off of the src/templates/_LANG_/2019/base.html template. This will need to be translated anyway.

This language-specific base.html inherits from the main, language-independent, src/templates/base.html file which has the following at the top of the file:

<!doctype html>
<html lang="{% block lang %}{{ language.lang_attribute }}{% endblock %}">

It is possible to override {% %} blocks, so when creating the src/templates/ar/2019/base.html file as part of your translation process, override the {% block lang %} section of the main src/templates/base.html file to add the dir attribute by adding the following after the {% extends "base.html" %} line:

{%block lang %}{{ language.lang_attribute }}" dir="rtl{% endblock %}

This will make it evaluate to:

<html lang="ar" dir="rtl">

Now this is a bit of a hack to be honest as I'm basically setting the language to ar" dir="rtl and depending on the quotes matching. But it'll do for now and we'll fix it up in a better way later.

@SilentJMA

This comment has been minimized.

Copy link
Contributor Author

@SilentJMA SilentJMA commented Nov 27, 2019

in #540 we will need a change from Left to Right is it possible because it's different to FR/EN/ES.. which start from left to right

Yes this is possible.

Everything inherits based off of the src/templates/_LANG_/2019/base.html template. This will need to be translated anyway.

This language-specific base.html inherits from the main, language-independent, src/templates/base.html file which has the following at the top of the file:

<!doctype html>
<html lang="{% block lang %}{{ language.lang_attribute }}{% endblock %}">

It is possible to override {% %} blocks, so when creating the src/templates/ar/2019/base.html file as part of your translation process, override the {% block lang %} section of the main src/templates/base.html file to add the dir attribute by adding the following after the {% extends "base.html" %} line:

{%block lang %}{{ language.lang_attribute }}" dir="rtl{% endblock %}

This will make it evaluate to:

<html lang="ar" dir="rtl">

Now this is a bit of a hack to be honest as I'm basically setting the language to ar" dir="rtl and depending on the quotes matching. But it'll do for now and we'll fix it up in a better way later.

Maybe i can fix it if i try but i don't know i will test it later and see .........

@bazzadp

This comment has been minimized.

Copy link
Contributor

@bazzadp bazzadp commented Nov 27, 2019

Maybe i can fix it if i try but i don't know i will test it later and see .........

Submitted #551 to add this ability. will leave you to do the hard part (the translations!). 😀

@bazzadp

This comment has been minimized.

Copy link
Contributor

@bazzadp bazzadp commented Dec 21, 2019

Interesting article I came across about handling rtl text: https://www.rtlstyling.com/posts/rtl-styling/

Reminded me of this issue so I thought I’d post here (in part to remind myself!) in case we need to do any more with the styling after translations are done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Web Almanac
  
TODO
3 participants
You can’t perform that action at this time.