Problem parsing curly braces

There are parsing errors:

  1. Can’t have curly braces next to each other
$  tx push -s
tx INFO: Pushing resource webapp-31.en_gbjson
tx INFO: Pushing source file (lang-transifex/en_GB.json)
tx ERROR: Error received from server: Invalid format of pluralized entry with key: "Onboarding\.ActivatePackage\.BikeFreeDaysHeader", serialized translations: "one {# day} other {# days}} {apostrophe". Could not parse the string at or near the following chunk: "} {apostrophe". It contains either invalid braces ("{", "}") or invalid characters.
tx ERROR: Could not upload source file. You can use --skip to ignore this error and continue the execution.
tx ERROR: Error received from server: Invalid format of pluralized entry with key: "Onboarding\.ActivatePackage\.BikeFreeDaysHeader", serialized translations: "one {# day} other {# days}} {apostrophe". Could not parse the string at or near the following chunk: "} {apostrophe". It contains either invalid braces ("{", "}") or invalid characters.

  "Onboarding.ActivatePackage.BikeFreeDaysHeader": {
    "string": "{formattedAmount, plural, one {# day} other {# days}} {apostrophe} free bike insurance"
  },
  "Onboarding.ActivatePackage.BikeFreeMonthsHeader": {
    "string": "{formattedAmount, plural, one {# month} other {# months}} {apostrophe} free bike insurance"
  },
  1. Can’t have prefixes to curly braces in only one translation:
$  tx push -t --skip
tx INFO: Pushing resource webapp-31.en_gbjson
tx WARNING: Pushing 'nl_NL' translations (file: lang-transifex/nl_NL.json)
tx ERROR: Error received from server: Could not import file: expected plurals rules '['one', 'other']' instead got '['other']' for resource string '405496100' and language 'nl_NL', expected plurals rules '['one', 'other']' instead got '['other']' for resource string '405496101' and language 'nl_NL'
tx ERROR: Error received from server: Could not import file: expected plurals rules '['one', 'other']' instead got '['other']' for resource string '405496100' and language 'nl_NL', expected plurals rules '['one', 'other']' instead got '['other']' for resource string '405496101' and language 'nl_NL'
tx INFO: Done.

En

"PaymentForm.DiscountMessageFreeDays": {
    "string": "{amount, plural, one {# day} other {# days}} of free cover will be added to your account"
  },
  "PaymentForm.DiscountMessageFreeMonths": {
    "string": "{amount, plural, one {# month} other {# month}} of free cover will be added to your account"
  },

In the NL translation there is a prefix to the plural and this isn’t accepted. I have to remove ‘Er wordt’ to get it to sync.

  "PaymentForm.DiscountMessageFreeDays": {
    "string": "Er wordt {amount, plural, one {# dag} other {# dagen}} gratis dekking aan uw account toegevoegd"
  },
  "PaymentForm.DiscountMessageFreeMonths": {
    "string": "Er wordt {amount, plural, one {# maand} other {# maanden}} gratis dekking aan uw account toegevoegd"
  },

Hi Nicole,

Thank you for posting here the issue you are facing.

I responded to your message already using our existing support thread but I will respond to your issue here as well in case another user finds this information useful in the future.

The issue is that the system expects a full message inside the curly brackets of each form. Repeating the sub-messages in all plural forms (one, other etc…) is necessary so that each form will contain the full sentence no matter what form the translator will choose to translate in the editor. This is a structure that is also recommended by ICU specifications.

So, to address the issue, the strings need to be formated as follows:

Current version:
“Onboarding.ActivatePackage.BikeFreeDaysHeader”: {
“string”: “{formattedAmount, plural, one {# day} other {# days}} {apostrophe} free bike insurance”
}

Recommended version:
“Onboarding.ActivatePackage.BikeFreeDaysHeader”: {
“string”: “{formattedAmount, plural, one {{# day} {apostrophe} free bike insurance} other {{# days} {apostrophe} free bike insurance}}”
}

I sent you a private message including both source and translation files revised following the syntax described above.

I hope this helps but in case of any questions, please let us know :slight_smile: