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

Identifiers are changed after export happens #85

Open
flodaniel opened this issue Nov 7, 2019 · 1 comment
Open

Identifiers are changed after export happens #85

flodaniel opened this issue Nov 7, 2019 · 1 comment

Comments

@flodaniel
Copy link

So we store our localization strings in a javascript file, which looks like this:

module.exports = {
    "yes": "Yes",
    "no": "No",
    "type-a-message": "Type a message",
}

In the strings.xml and Localizable.strings however the entries look like this:

Android:

  <string name="no">"No"</string>
  <string name="yes">"Yes"</string>
  <string name="_type_a_message_Z13yvex">"Type a message"</string>

iOS:

"no" = "Nein";
"yes" = "Ja";
"_type_a_message_Z13yvex" = "Nachricht schreiben";

As we use firebase cloud messaging and want to generate localized push notifications with titleLocKey and bodyLocKey (see FCM Documentation for details) it is extremely annoying that "type-a-message" is converted to "_type_a_message_Z13yvex".

Is this a bug? Is this expected behaviour because we use "-" in the identifiers?

It is definitely strange that any identifier would change like this.

@felixkrautschuk
Copy link

I'm experiencing the same thing when using a - within the key name.
The other plugin nativescript-i18n does not allow using a - within keys at all, as the build fails on Android saying Error: '-' is not a valid resource name character.

So I think it is generally a better idea to prevent using '-' within key names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants