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

Should throw exception when variable names doesn't match #83

Closed
MrOrz opened this issue May 15, 2017 · 5 comments
Closed

Should throw exception when variable names doesn't match #83

MrOrz opened this issue May 15, 2017 · 5 comments

Comments

@MrOrz
Copy link
Contributor

MrOrz commented May 15, 2017

When resolving po files containing errors in variable names, babel plugin should throw an error.

For instance:

msgid "Created at ${ createdAtStr }"
msgstr "作成日 ${ cratedAtStr }"  # typo here

Currently the po file above will cause ReferenceError late at runtime.

@MrOrz
Copy link
Contributor Author

MrOrz commented May 15, 2017

After digging in the code, I found that it would be easier to check if all expressions in the source string appears in the localized strings.

This would stops translators from deliberately omitting expressions. However, I personally did not have such use case, so maybe I will just implement this way.

@AlexMost
Copy link
Member

makes sense

@oleksandr-kuzmenko
Copy link
Member

👍

@vharitonsky
Copy link

Also, it would be cool to check if no new expressions were introduced. This way will prevent copy/paste errors.

@AlexMost
Copy link
Member

AlexMost commented Jun 6, 2017

works in 0.5.6

@AlexMost AlexMost closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants