Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fc16ee3a
Commit
fc16ee3a
authored
Jul 16, 2014
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks for i18n docs
parent
fba7bb91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
docs/en_us/developers/source/i18n.rst
+9
-0
No files found.
docs/en_us/developers/source/i18n.rst
View file @
fc16ee3a
...
...
@@ -187,6 +187,10 @@ native Coffeescript features that break the extraction from the .js files:
# Translators: this won't get to the translators!
message = gettext("Welcome, #{student_name}!") # This won't work!
# YES like this:
`// Translators: this will get to the translators.`
message = gettext("This works")
###
Translators: This will work, but takes three lines :(
###
...
...
@@ -425,6 +429,11 @@ which is now invalid Javascript. This can be avoided by using double-quotes
for the Javascript string. The better solution is to use a filtering function
that properly escapes the string for Javascript use::
<%!
from django.utils.translation import ugettext as _
from django.utils.html import escapejs
%>
...
<script>
var feeling = '${escapejs(_("I love you."))}';
</script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment