Skip to content

Remove JS gettext() in templates - #2057

Merged
sarina merged 1 commit into
masterfrom
ormsbee/js_gettext
Jan 9, 2014
Merged

Remove JS gettext() in templates#2057
sarina merged 1 commit into
masterfrom
ormsbee/js_gettext

Conversation

@ormsbee

@ormsbee ormsbee commented Dec 30, 2013

Copy link
Copy Markdown
Contributor

Move to server-side substitutions. @nedbat

@singingwolfboy

Copy link
Copy Markdown
Contributor

If I recall correctly, the reason for this change is so that we can more easily extract translation strings from our templates. Is that correct? The better solution to this problem would be to move all Javascript into separate .js files, so that Babel or GNU gettext or whatever knows how to extract the contents of gettext() calls in .js files.

I'm not saying that this PR is a bad idea -- this is a good first step for getting our i18n system working properly. This comment exists mostly so that (a) someone can contradict me if my assumption is wrong, and (b) this comment works as documentation if my assumption is correct.

@ormsbee

ormsbee commented Dec 31, 2013

Copy link
Copy Markdown
Contributor Author

Test failure, looking into it.

@nedbat

nedbat commented Dec 31, 2013

Copy link
Copy Markdown
Contributor

@singingwolfboy you are correct: as the files were written, the strings were not being extracted. The larger improvement would be to move this code into separate js files. This is a smaller change that avoids having to decide to move the js code.

Comment thread lms/templates/help_modal.html Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asterisks here shouldn't be part of the translation strings. (I know you didn't put them there..) Also, the <span class='tip'> should be in the showFeedback function, no? How do you feel about cleaning that up?

@sarina

sarina commented Jan 8, 2014

Copy link
Copy Markdown
Contributor

Hi I addressed review comments, fixed the broken tests, and verified all the changes manually on local dev. Any other comments before I squash & merge?

Comment thread lms/templates/help_modal.html Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is left-over? The new argument isn't used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop yep i thought I deleted that.

@nedbat

nedbat commented Jan 9, 2014

Copy link
Copy Markdown
Contributor

We're still talking about how to properly quote text like this being turned into Javascript strings, but this PR is ready to merge. 👍

sarina added a commit that referenced this pull request Jan 9, 2014
Remove JS gettext() in templates
@sarina
sarina merged commit 2f8088e into master Jan 9, 2014
@sarina
sarina deleted the ormsbee/js_gettext branch January 9, 2014 15:54
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Aug 8, 2017
* Fix Bug. Mod activate account process. openedx#2047

* Fix review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants