Open Fasust opened 7 hours ago
Hi, thanks for the PR! Do you know how other solutions handle this issue? This feature is inspired by linked translations of easy_localization but they probably followed the structure of Vue i18n.
I think it is better to handle it similar to how Dart handles interpolation ($
for greedy interpolation, ${}
for edge cases).
Therefore, the following syntax might be safer to use (e.g. when somebody wants to have an actual @
in the string right after the linked translation):
{
"message": "10@:{common.nbsp}Days"
}
Here, I surrounded the path with {...}
Let me know how you think about this. It might be a little bit more difficult to implement though.
I ran into an issue with linking translations and having them immediately followed by another word character.
Example:
Message is linking to
@:common.nbsp
, but the link will be interpreted as@:common.nbspDays
which is invalid. My PR adds the option to escape linked translations: