phrase-cli icon indicating copy to clipboard operation
phrase-cli copied to clipboard

Switch existing key into plural form not taken into account

Open L4ngu0r opened this issue 4 months ago • 3 comments

We use the Phrase CLI in version 2.43.0, in a workflow to uploads the keys

We use the phrase uploads create command

Context

Some time we created a key in single form, that is switched to plural form later (or the other way)

The upload does not reflect any change in Phrase, we have to manually change the key in the UI. This is cumbersome and error prone, and update the associated translation.

Is there a way to tell Phrase with the CLI or API to take into account the change to plural/single form?

L4ngu0r avatar Sep 25 '25 10:09 L4ngu0r

@L4ngu0r I just tried uploading Ruby/Rails YAML format and it updates the key type accordingly:

---
en-GB:
  plural:
    one: one tr 1
    other: other tr 1
    zero: zero tr 1

converts the key plural to plural type with given translations, and

---
en-GB:
  plural: just a singular now

converts it to singular.

jablan avatar Sep 25 '25 10:09 jablan

We use i18next_4 format and JSON

L4ngu0r avatar Sep 25 '25 11:09 L4ngu0r

Tried it now with i18next v4, and it also updates the key type (I was also using update_translations: true option):

{
  "plural_one": "one tr 3",
  "plural_other": "other tr 3",
  "plural_zero": "zero tr 3"
}

and

{
  "plural": "is now singular"
}

convert the translation key named plural between singular and plural, with corresponding translations

jablan avatar Sep 25 '25 12:09 jablan