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

Plurals support #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Plurals support #17

wants to merge 3 commits into from

Conversation

Nohus
Copy link

@Nohus Nohus commented Aug 9, 2020

Added support for <plurals> strings. Quickly hacked together, seems to work fine, but I am not familiar with the project at all, nor do I know PHP, so the code is likely very bad. Opening this PR in the hope this can be useful to someone, it's good enough for my use case.

Some comments:

  • Different languages have different types of plurals, which the tool has to know. I have made this configurable and added configuration for the 3 languages I need. Languages without plurals configuration will still work fine, but will prompt for translations for all possible plurals' types, even though not all are used in a given language.
  • For showing the English reference translation, I am using the "one" value for the "one" plural, and "other" value for all other plurals ("zero", "few", "many"...).
  • I have not tested if this hasn't broken other types of strings (e.g. <string-array>), as I am not using them. Please test before using/merging.

@Nohus Nohus changed the title Plurals support (Implements #7) Plurals support Aug 9, 2020
@Nohus Nohus mentioned this pull request Aug 9, 2020
@erickok
Copy link
Owner

erickok commented Aug 13, 2020

This looks pretty good to me, though I will try to try it out myself before merging.

@Nohus
Copy link
Author

Nohus commented Jun 11, 2022

Bump

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

Successfully merging this pull request may close these issues.

2 participants