3

I am trying out weblate self hosting package (MaxOs Docker, to test it out) to manage my translations for an iOS and Android app. I see that pluralisation is possible, but I haven't found a way to add these to a project.

When clicking on start new translation I don't see an option to change the translation into a pluralised form. So how do I add a translations and have the option to change this?

When exporting the translations as android xml file I am looking for something like this.

<resources>
    <plurals name="plural_name">
        <item quantity="zero">zero plural</item>
        <item quantity="other">other plural</item>
    </plurals>
</resources>

On a side note I am also looking for a way to have one key set to share between the android and iOS component. It seems like I have to define all keys and translations twice. I thought I read in the docs that is could be merged, but not clear as how to do this.

1 Answers1

1

Right now, it's not possible to add plurals within Weblate, but it can edit any plurals present in the file. The usual workflow is that the initial strins are added by developers when creating the feature to the English file and it is then translated or proofread within Weblate.

Anyway the iOS strings format doesn't support plurals (see https://docs.weblate.org/en/latest/formats.html#translation-types-capabilities) and Weblate doesn't yet support stringsdict (see https://github.com/WeblateOrg/weblate/issues/623).

PS: For upcoming Weblate release it will be possible to add new plural strings, but probably only using API. I've implemented it today in https://github.com/WeblateOrg/weblate/commit/94669ab8a3a3c2f86e01055ea6150407929a2435.

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
  • Thanks for the answer, but when I import the above android strings xml example weblate was not able to load the file, so how to add the plural then? – Ruben Oppenhuizen Sep 21 '20 at 07:46
  • What happened when it was not able to load the file? Did you get some error? – Michal Čihař Oct 07 '20 at 13:48
  • I was using weblate 4.2.2 first uploaded an strings.xml, but it needs to be a zip file. So I put the strings.xml into a zipfile. And is still couldn't get imported it keeps saying **Unsupported file format.** this is the xml file: ` AndroidPluralString %d item %d items ` – Ruben Oppenhuizen Oct 09 '20 at 07:12
  • Seems like you're doing something wrongly, see https://docs.weblate.org/en/latest/admin/projects.html#adding-translation-projects-and-components – Michal Čihař Oct 12 '20 at 07:50