Skip to content
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

Temporary fix for translations of ES6/JSX files #513

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

spencerhance
Copy link
Contributor

@spencerhance spencerhance commented Aug 1, 2018

This PR is a temporary fix for a bug in xgettext (the library that django, and consequently, our i18n tool uses for string extractions) that breaks parsing when there are backticks in the file.

  • Adds lint rule to prevent use of ES6 template strings (i.e. backticks)
  • Converts all template strings in credentials to interpolations or concatenations

All this work should eventually be reverted once we switch to a different parsing library, or xgettext adds support.

Original ticket:
https://openedx.atlassian.net/browse/LEARNER-5085

Bugs Filed:
https://openedx.atlassian.net/browse/LEARNER-6038
openedx/i18n-tools#75

@spencerhance spencerhance force-pushed the spencerhance/temp-fix-for-es6-translation branch 2 times, most recently from da4100f to 70ce681 Compare August 2, 2018 17:25
Copy link
Contributor

@dianakhuang dianakhuang left a comment

Choose a reason for hiding this comment

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

Just one note that doesn't require any changes. Otherwise, it looks great.

@@ -103,15 +103,19 @@ class ProgramRecord extends React.Component {

const date = new Date(isoDate);

return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear().toString().slice(2)}`;
return StringUtils.interpolate('{month}/{date}/{year}', {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is okay for now, but this date may need to become localized in the future for locales that use something besides the month/day/year format.

@spencerhance spencerhance force-pushed the spencerhance/temp-fix-for-es6-translation branch from 70ce681 to bd91d52 Compare August 3, 2018 15:38
@spencerhance spencerhance merged commit 4dce03f into master Aug 3, 2018
@spencerhance spencerhance deleted the spencerhance/temp-fix-for-es6-translation branch August 3, 2018 16:51
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.

2 participants