Skip to content

Conversation

@ormsbee
Copy link
Contributor

@ormsbee ormsbee commented Dec 30, 2013

Move to server-side substitutions. @nedbat

@singingwolfboy
Copy link
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
Copy link
Contributor Author

ormsbee commented Dec 31, 2013

Test failure, looking into it.

@nedbat
Copy link
Contributor

nedbat commented Dec 31, 2013

@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.

Copy link
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
Copy link
Contributor

sarina commented Jan 8, 2014

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?

Copy link
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
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
Copy link
Contributor

nedbat commented Jan 9, 2014

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.

5 participants