Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
9a10c322
Commit
9a10c322
authored
11 years ago
by
Sarina Canelake
Browse files
Options
Downloads
Plain Diff
Merge pull request #2495 from edx/sarina/update-i18n-guide
Update i18n coding guidelines
parents
b9edc195
5f841f28
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/en_us/developers/source/i18n.rst
+31
-12
31 additions, 12 deletions
docs/en_us/developers/source/i18n.rst
with
31 additions
and
12 deletions
docs/en_us/developers/source/i18n.rst
+
31
−
12
View file @
9a10c322
...
...
@@ -14,6 +14,13 @@ See also:
* `Django Translation guidelines <https://docs.djangoproject.com/en/dev/topics/i18n/translation/>`_
* `Django Format localization <https://docs.djangoproject.com/en/dev/topics/i18n/formatting/>`_
Presented in this document are the following sections:
* `General internationalization rules`_
* `Editing source files`_
* `Coverage testing`_
* `Style guidelines`_
General internationalization rules
**********************************
...
...
@@ -57,9 +64,17 @@ do:
produce the best translation. They have a "Translators:" marker. They must
appear on the line preceding the text they describe.
The code samples below show how to do each of these things. Note that you have
to take into account not just the programming language involved, but the type
of file: Javascript embedded in an HTML Mako template is treated differently
The code samples below show how to do each of these things for:
* `Python source code`_
* `Django template files`_
* `Mako template files`_
* `Javascript files`_
* `Coffeescript files`_
* `Other kinds of code`_
Note that you have to take into account not just the programming language involved,
but the type of file: Javascript embedded in an HTML Mako template is treated differently
than Javascript in a pure .js file.
Python source code
...
...
@@ -210,16 +225,20 @@ the strings, or checking the translations into Github, see use cases).
$ rake i18n:generate
4. Django should be ready to go. The next time you run Studio or LMS with a
browser set to Esperanto, the accented-English strings (from step 3, above)
should be displayed. Be sure that your settings for ``USE_I18N`` and
``USE_L10N`` are both set to True. ``USE_I18N`` is set to False by default
in common.py, but is set to True in development settings files.
4. Django should be ready to go. The next time you run Studio or LMS, append
``?preview-lang=eo`` to the URL to turn on Esperanto as a dark language. The
accented-English strings (from step 3, above) should be displayed.
If you experience issues, be sure that your settings for ``USE_I18N`` and
``USE_L10N`` are both set to True.
5. With Esperanto turned on as a dark language (see Step 4), review the pages
affected by your code and verify that you see fake translations. If you see
plain English instead, your code is not being properly translated. Review
the steps in editing source files (above).
5. With your browser set to Esperanto, review the pages affected by your code
and verify that you see fake translations. If you see plain English instead,
your code is not being properly translated. Review the steps in editing
source files (above).
6. When you are done reviewing, append ``?clear-lang`` to the LMS or Studio URL
to reset your session to English.
Coverage testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment