Skip to content

Commit

Permalink
Merge pull request #557 from edx/sarina/i18n-update
Browse files Browse the repository at this point in the history
Update i18n documentation about Mako and Underscore templates.
  • Loading branch information
sarina committed Sep 22, 2015
2 parents 51573f8 + 2607b58 commit b2b4b17
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions en_us/developers/source/internationalization/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The code samples below show how to do each of these things for:
* `JavaScript files`_
* `Coffeescript files`_
* `Underscore template files`_
* `Other kinds of code`_
* `Other types of content`_

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
Expand Down Expand Up @@ -137,9 +137,14 @@ functions first. Here's a Mako template example::

<%! from django.utils.translation import ugettext as _ %>
## Translators: message to the translator
## Translators: message to the translator. This comment may
## wrap on to multiple lines if needed, as long as they are
## lines directly above the marked up string.
${_("Welcome!")}

Make sure that all Mako comments, including translators comments, begin
with *two* pound signs (#).

JavaScript files
================

Expand Down Expand Up @@ -221,8 +226,15 @@ Note: it is recommended that you use ``<%-`` for all translated strings
as this will HTML escape the string before including it in the page. This
ensures that translations are free to use non-HTML characters.

Other kinds of code
===================
Currently, translators comments are not supported in Underscore template files,
as the underlying library does not parse them out. We recommend you add them in
using standard comment syntax, so that when work is done to support these comments,
we already have them defined. Additionally, translators comments in the code
will enable us to answer questions from translators.


Other types of content
======================

We have not yet established guidelines for internationalizing the following.

Expand Down

0 comments on commit b2b4b17

Please sign in to comment.