-
Notifications
You must be signed in to change notification settings - Fork 397
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
Use generated message as a default one in sourceLocale catalog #212
Comments
@sladek-jan I've just created a PR and it should be merged soon. Just curious: if there were a better way to add metadata to translations, would you still use custom IDs? For example adding metadata to comments: // i18n: some context here
i18n.t`Word` Generated message catalog might look like this:
Just an idea I had in the past. |
@tricoder42 Ok, thank you! I guess it depends on what such a way would look like exactly. But I find comments just fine too. |
Adding context directly to code might be even better. We just have to remember to remove it from production bundle as context is just for documentation purposes (for translators). I'll think about it, what solution is easier. |
Fixed and released in v2.2.0. Thanks to all involved! |
Hi,
In an attempt to add metadata ("context" for linguists) to translations, I used this new feature as follows:
i18n('Word // some context here')`Word`
The docs say
Generated message is used as a default one
. If I understand it correctly, in this case a keyWord // some context here
should be created in the catalog, with a default English translationWord
(as long as sourceLang="en").This is not what happens. The entry created in the catalog for
en
is:This is logical, because of this commit which copies translation IDs over as default translations into source locale. But isn't this in conflict with what the docs say?
I am currently using version 2.0.1 until another issue is resolved.
Thank you for the great lib btw.
The text was updated successfully, but these errors were encountered: