-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for plurals in translations #6327
Comments
Just an update: we're waiting on some GlotPress changes so it can handle |
More than supporting the specific format, I'm not sure if GlotPress can handle multiple files. |
One idea that's been growing on me today is to forget about adding new importers to GlotPress and handling everything on our side, merging all our strings into a big PO file, which GlotPress can understand perfectly. Then we'd export each translation as a PO file as well, and use that and the original strings/stringsdict/xliff files generated by Xcode to generate the translated files that Xcode wants. Also, neither |
Some candidates for plural support (there might be more):
|
Correct but not set in stone, this can be easily arranged that an imported file augments the existing strings and/or to import two files in one go. It could be done with a GlotPress plugin.
I like that a lot. A problem with generating the |
Progress so far: It looks like xgettext has some support for Objective-C (which also works on Swift). Unfortunately it doesn't pick up the existing translation comments. I decided to leave string extraction to I have this new macro: #define NSLocalizedStringPlural(singular, plural, number) NSLocalizedString(singular, @"") What we can do with this, is to have // Translators: Message informing the user that all of their sites are currently hidden
self.noResultsView.titleText = NSLocalizedStringPlural(@"You have 1 hidden WordPress site.", @"You have %lu hidden WordPress sites.", count);
// Translators: Prompt asking user to make sites visible in order to use them in the app
self.noResultsView.messageText = NSLocalizedStringPlural(@"To manage it here, set it to visible.", @"To manage them here, set them to visible.", count); And we can have
The next step would be to be able to convert that PO into a Once we have that, I believe the rest will be easy, as the gettext tools to work with PO files are really good and support merging and comparing files really well. They even support reading and writing |
FYI work has commenced in GlotPress/GlotPress#666 to address that difference in plural definition which will allow the implementation of thr |
This issue has been marked as stale and will be automatically closed. This happened because:
However, discussion is still welcome! If the issue is still valid, please leave a comment with a brief explanation so the issue can be reopened. |
This issue has been marked as stale because:
Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority (cc @designsimply). |
@akirk just checking in on this issue, I noticed GlotPress/GlotPress#666 is still open, is that a blocker for this issue in the iOS app? |
Correct, unfortunately GlotPress development seems to have halted for now. I'll see if we can get it moving again. |
This issue has been marked as stale because:
Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions. |
Still valid! @akirk may I check in with you again about the status of GlotPress/GlotPress#666? I'm asking because this issue is stale, not because it's prioritized. So an update to say it's still in progress is acceptable and that will make it so we put it on hold again but check back in on it in a year if it goes stale again. 🙂 |
This issue has been marked as stale because:
Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions. |
Thanks for reporting! 👍 |
@frosty In #6208 you introduced the construct:
Unfortunately this cannot be translated properly because some languages don't just have a different plural for
count != 1
(for example Russian, they use one form for 1, 21, 31; another one for 2, 3, 4; and yet another one for 5, 6, …). Please see Handling Noun Plurals and Units of Measurement in the iOS docs on how this can be done universally. Thanks!The text was updated successfully, but these errors were encountered: