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

i18n: Support concatenation in string extraction #1927

Closed
aduth opened this issue Jul 17, 2017 · 0 comments
Closed

i18n: Support concatenation in string extraction #1927

aduth opened this issue Jul 17, 2017 · 0 comments
Assignees
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Build Tooling Issues or PRs related to build tooling [Type] Enhancement A suggestion for improvement.

Comments

@aduth
Copy link
Member

aduth commented Jul 17, 2017

The i18n utility uses static analysis to extract translated strings from code, and is therefore not able to handle complex logic. Currently, the argument to localization functions must be a simple string. While we cannot feasibly support complex logic, we can at least support string concatenation, since it is parsed into a relatively-easy-to-handle BinaryExpression type. This would be useful to allow long strings to be split across multiple lines.

AST Example:

http://astexplorer.net/#/gist/2440bf8d51046508fb754b528e054bc5/19c4c4dcace89a8d8fe42f525f95d9577212ef6d

Possible implementation inspiration:

@aduth aduth added [Type] Build Tooling Issues or PRs related to build tooling Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Enhancement A suggestion for improvement. labels Jul 17, 2017
@aduth aduth self-assigned this Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Build Tooling Issues or PRs related to build tooling [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant