Repository navigation
tsinghuax i18n changes #353
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
Changes from 19 commits
3b9bfce
77ea94f
ae49ccf
b1c99fb
9af2dd2
0ee771f
34704cb
27bda76
adaaa92
e06ee08
4424620
e323815
d52f63a
c32fea5
de14761
eada11f
f73cba7
21988c4
2b52220
0783154
6553d18
e610bb4
714acde
5663cf3
3663a39
7376f3f
96355df
c3cedc2
88d3035
2c37959
d1f35e9
bd941bf
4d748d1
6f58545
3e95303
f62565a
36829fa
526d144
b887825
4ae4f6c
aa74c77
9dd63de
b872cc0
d3c0cd5
95ed581
d3bbe8a
4b33347
c234223
6e5791d
fadb986
6f2e58e
07838fe
8858211
09e90f1
54a4990
adb1e46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,13 +79,13 @@ CMS.Models.Settings.CourseGrader = Backbone.Model.extend({ | |
| // FIXME somehow this.collection is unbound sometimes. I can't track down when | ||
| var existing = this.collection && this.collection.some(function(other) { return (other != this) && (other.get('type') == attrs['type']);}, this); | ||
| if (existing) { | ||
| errors.type = "There's already another assignment type with this name."; | ||
| errors.type = gettext("There's already another assignment type with this name."); | ||
| } | ||
| } | ||
| } | ||
| if (attrs['weight']) { | ||
| if (!isFinite(attrs.weight) || /\D+/.test(attrs.weight)) { | ||
| errors.weight = "Please enter an integer between 0 and 100."; | ||
| errors.weight = gettext("Please enter an integer between 0 and 100."); | ||
| } | ||
| else { | ||
| attrs.weight = parseInt(attrs.weight); // see if this ensures value saved is int | ||
|
|
@@ -99,18 +99,18 @@ CMS.Models.Settings.CourseGrader = Backbone.Model.extend({ | |
| }} | ||
| if (attrs['min_count']) { | ||
| if (!isFinite(attrs.min_count) || /\D+/.test(attrs.min_count)) { | ||
| errors.min_count = "Please enter an integer."; | ||
| errors.min_count = gettext("Please enter an integer."); | ||
| } | ||
| else attrs.min_count = parseInt(attrs.min_count); | ||
| } | ||
| if (attrs['drop_count']) { | ||
| if (!isFinite(attrs.drop_count) || /\D+/.test(attrs.drop_count)) { | ||
| errors.drop_count = "Please enter an integer."; | ||
| errors.drop_count = gettext("Please enter an integer."); | ||
| } | ||
| else attrs.drop_count = parseInt(attrs.drop_count); | ||
| } | ||
| if (attrs['min_count'] && attrs['drop_count'] && attrs.drop_count > attrs.min_count) { | ||
| errors.drop_count = "Cannot drop more " + attrs.type + " than will assigned."; | ||
| errors.drop_count = gettext("Cannot drop more %s than will assigned.").split("%s").join(attrs.type); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could be done more nicely with interpolate. Like this example:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, the risk here is that someone translates the actual '%(date)' - which is the keyname - which would break the later subsitution. |
||
| } | ||
| if (!_.isEmpty(errors)) return errors; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%inherit file="base.html" /> | ||
| <%block name="title">Page Not Found</%block> | ||
| <%block name="title">${_("Page Not Found")}</%block> | ||
|
|
||
| <%block name="content"> | ||
|
|
||
| <div class="wrapper-content wrapper"> | ||
| <section class="content"> | ||
|
|
||
| <h1>Page not found</h1> | ||
| <p>The page that you were looking for was not found. Go back to the <a href="/">homepage</a> or let us know about any pages that may have been moved at <a href="mailto:technical@edx.org">technical@edx.org</a>.</p> | ||
| <h1>${_("Page not found")}</h1> | ||
| <p>${_('The page that you were looking for was not found. Go back to the <a href="/">homepage</a> or let us know about any pages that may have been moved at <a href="mailto:technical@edx.org">technical@edx.org</a>.')}</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull out the two links. |
||
| </section> | ||
| </div> | ||
|
|
||
| </%block> | ||
| </%block> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,19 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%inherit file="base.html" /> | ||
|
|
||
| <%block name="title">Studio Server Error</%block> | ||
| <%block name="title">${_("Studio Server Error")}</%block> | ||
|
|
||
| <%block name="content"> | ||
|
|
||
| <div class="wrapper-content wrapper"> | ||
| <section class="content"> | ||
| <h1>The <em>Studio</em> servers encountered an error</h1> | ||
| <h1>${_("The <em>Studio</em> servers encountered an error")}</h1> | ||
| <p> | ||
| An error occurred in Studio and the page could not be loaded. Please try again in a few moments. | ||
| We've logged the error and our staff is currently working to resolve this error as soon as possible. | ||
| If the problem persists, please email us at <a href="mailto:technical@edx.org">technical@edx.org</a>. | ||
| ${_("An error occurred in Studio and the page could not be loaded. Please try again in a few moments.")} | ||
| ${_("We've logged the error and our staff is currently working to resolve this error as soon as possible.")} | ||
| ${_('If the problem persists, please email us at <a href="mailto:technical@edx.org">technical@edx.org</a>.')} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull out the link? |
||
| </p> | ||
| </section> | ||
| </div> | ||
|
|
||
| </%block> | ||
| </%block> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%inherit file="base.html" /> | ||
|
|
||
| <%block name="content"> | ||
|
|
@@ -6,9 +7,9 @@ | |
| <div> | ||
|
|
||
| <section class="activation"> | ||
| <h1>Account already active!</h1> | ||
| <p> This account has already been activated. <a href="/signin">Log in here</a>.</p> | ||
| <h1>${_("Account already active!")}</h1> | ||
| <p>${_('This account has already been activated. <a href="/signin">Log in here</a>.')}</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split up to avoid HTML in the internationalized string? |
||
| </div> | ||
| </section> | ||
|
|
||
| </%block> | ||
| </%block> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,13 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%inherit file="base.html" /> | ||
|
|
||
| <%block name="content"> | ||
|
|
||
| <section class="tos"> | ||
| <div> | ||
| <h1>Activation Complete!</h1> | ||
| <p>Thanks for activating your account. <a href="/signin">Log in here</a>.</p> | ||
| <h1>${_("Activation Complete!")}</h1> | ||
| <p>${_('Thanks for activating your account. <a href="/signin">Log in here</a>.')}</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull out href. |
||
| </div> | ||
| </section> | ||
|
|
||
| </%block> | ||
| </%block> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| <%! from django.utils.translation import ugettext as _ %> | ||
| <%inherit file="base.html" /> | ||
|
|
||
| <%block name="content"> | ||
| <section class="tos"> | ||
| <div> | ||
| <h1>Activation Invalid</h1> | ||
| <h1>${_("Activation Invalid")}</h1> | ||
|
|
||
| <p>Something went wrong. Check to make sure the URL you went to was | ||
| correct -- e-mail programs will sometimes split it into two | ||
| lines. If you still have issues, e-mail us to let us know what happened | ||
| at <a href="mailto:bugs@mitx.mit.edu">bugs@mitx.mit.edu</a>.</p> | ||
| <p>${_('Something went wrong. Check to make sure the URL you went to was correct -- e-mail programs will sometimes split it into two lines. If you still have issues, e-mail us to let us know what happened at <a href="mailto:bugs@mitx.mit.edu">bugs@mitx.mit.edu</a>.')}</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull out e-mail address. |
||
|
|
||
| <p>Or you can go back to the <a href="/">home page</a>.</p> | ||
| <p>${_('Or you can go back to the <a href="/">home page</a>.')}</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pull out href. |
||
| </div> | ||
| </section> | ||
| </%block> | ||
| </%block> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to internationalize these
analytics.trackcalls? I don't think these show up for users, but are used for segmenting in our reports.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My vote: no
@markchang will have to confirm but I believe that these are really used as 'keys'. Which is unfortunate as there's a mixed semantics here between key name and display name. Myself, I like to keep keys non-localizable. I'd be interested if theres a way to define a mapping between key name and a localizable display name.
But that's just my $0.02.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also vote no.