wordpress-mobile / wordpress-mobile/WordPress-iOS

Add support for plurals in translations

Open
#6,327 15 comments 0 reactions 1 assignee View on GitHub

@frosty is already working on this.

Since Dec 13, 2016.

[Pri] Low [Type] Bug i18n
Dominant language
Swift
Stars
3.9k
Forks
1.2k
Avg merge
23h 51m
Merged PRs (30d)
58

Description

@frosty In #6208 you introduced the construct:

    if (count == 1) {
        self.noResultsView.titleText = NSLocalizedString(@"You have 1 hidden WordPress site.", "Message informing the user that all of their sites are currently hidden (singular)");
        self.noResultsView.messageText = NSLocalizedString(@"To manage it here, set it to visible.", @"Prompt asking user to make sites visible in order to use them in the app (singular)");
    } else {
        self.noResultsView.titleText = [NSString stringWithFormat:NSLocalizedString(@"You have %lu hidden WordPress sites.", "Message informing the user that all of their sites are currently hidden (plural)"), count];
        self.noResultsView.messageText = NSLocalizedString(@"To manage them here, set them to visible.", @"Prompt asking user to make sites visible in order to use them in the app (plural)");
    }

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.