i18n: Support concatenation in string extraction #1927
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.
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:
The text was updated successfully, but these errors were encountered: