Skip to content

Conversation

@mKoonrad
Copy link
Contributor

๐ŸŽŸ๏ธ Tracking

#1912

๐Ÿ“” Objective

I added plurals by stringsdict file.

๐Ÿ“ธ Screenshots

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

@mKoonrad mKoonrad requested review from a team and matt-livefront as code owners September 28, 2025 22:57
@bitwarden-bot
Copy link

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-26248
Link: https://bitwarden.atlassian.net/browse/PM-26248

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title Add plurals [PM-26248] Add plurals Sep 28, 2025
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

โœ… All modified and coverable lines are covered by tests.
โœ… Project coverage is 85.29%. Comparing base (41181fc) to head (5ce1221).
โš ๏ธ Report is 94 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1999      +/-   ##
==========================================
- Coverage   85.29%   85.29%   -0.01%     
==========================================
  Files        1691     1691              
  Lines      144250   144248       -2     
==========================================
- Hits       123044   123042       -2     
  Misses      21206    21206              

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KatherineInCode
Copy link
Contributor

๐Ÿค” It looks like some other issues have come up with conflicts and the like. Do you mind if I take this PR and run with it (though probably in a separate PR because GitHub, I'll have to see) to clean some remaining stuff up and get all the ducks in a row?

@mKoonrad
Copy link
Contributor Author

Feel free to edit!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 3eb2d9df-2a7f-43ce-b051-3147369306b7

Great job! No new security vulnerabilities introduced in this pull request

@KatherineInCode
Copy link
Contributor

After spending some time futzing with git and the code, I determined that I thought it would be easier to break out adding these plurals into a couple PRs, potentially, so as to get a more-focused look at them, and handle some ancillary improvements that can be made at the same time. I'll still keep this open as a way of keeping tabs on what still might need to be migrated, as we can keep merging main into it, which should hopefully Just Work.

@KatherineInCode
Copy link
Contributor

@mKoonrad I think with #2199 I've finished pulling in all the plurals you identified here, aside from the ones that got shifted around in the interim. Can you check to make sure nothing got missed? And then if you're okay with it, we can close this PR.

@mKoonrad
Copy link
Contributor Author

@KatherineInCode First of all, thank you for your work! ๐ŸŽ†

It's done, it's works, but in some cases transaltors could transalte it in the wrong way.

Some sentences were split into two parts:

  1. The static part (the main sentence) was in the top-level key.
  2. The dynamic part (the number and the noun) was inside the plural variations.

Why this was bad: Translators in Crowdin only saw small fragments like %d items or %d characters without knowing the rest of the sentence. In many languages (like Polish), the words before the number need to change their form (grammar/declension) based on that number. When the string is fragmented, it is impossible to translate it with 100% grammatical accuracy.

Crowdin links the same %d items translations for part of sentences and standalone string.

I suggest to move entire sentence into plural rules. What improved:

  • Better Context: Translators now see the complete sentence in Crowdin (e.g., "Your PIN must be at least %d characters" instead of just "%d characters").
  • Grammatical Correctness: It allows for different word orders and correct declension across all languages.
  • Easier Localization: Translators don't have to guess where the fragment is being used.

Current:
image
image

After improvement:

image

Does this make sense to you? Should I prepare PR or do you want to take care of it?

@KatherineInCode
Copy link
Contributor

Crowdin links the same %d items translations for part of sentences and standalone string.

Ah, dang, I didn't quite realize that. Yeah, that makes sense. I can swing back through on this. Though it does look like Crowdin provides the context of where things are used in the places where it doesn't do the matching, as well ๐Ÿค” but yes, that makes sense. I'll circle back to it when I can.

@KatherineInCode
Copy link
Contributor

KatherineInCode commented Jan 8, 2026

@mKoonrad I've been thinking about this over the holidays, and I'm curious. What would be your recommendation for how best to handle sentences with two different (number + noun)s in them?

For instance, take the following English sentence:

The app will play X songs and show Y pictures.

In the way I've done it before at other jobs (that admittedly had translations into much fewer languages), and did with the stringsdict here, it would be to break out subdictionaries. This is what the Apple docs indicate, though now it's just in a single line and doesn't have a clear example; this page shows some examples of it. That looks like:

The app will play [songs] and show [pictures]

where [songs] and [pictures] would break into "0 song / N songs" and "0 picture / N pictures", respectively.

However, this can cause problems because of CrowdIn's translation memory, where "N songs" gets assumed to be the same unit everywhere, even though in some languages it would inflect differently if it were the subject vs. the object.

As well, there are languages like Hungarian that have polypersonal agreement, where the verb is inflected also in accordance with the count of the objects. As well, as you indicated, Polish also has grammatical features similar to this. How best to handle this?

My initial instinct is to also pull in the verbs:

The app will [play songs] and [show pictures]

But that 1) relies way too much on English word order, and 2) in this case, I completely ignored that it's actually "will play" and "will show"โ€”that is, future tense, which some languages inflect in the verb itself instead of having an auxiliary verb like English. It very much wouldn't work.

So I'm a little stymied, short of breaking it up into two sentences (which may not always be an option, depending exactly on how it's constructed, thinking particularly of the "X hours and Y minutes" sorts of constructions).

Do you have any thoughts/opinions/advice on the matter? Could something fancy be done with the "nested dependencies" as they're called in that example page I linked earlier?

@mKoonrad
Copy link
Contributor Author

@KatherineInCode Sorry for the late reply! For now, I recommend the standard solution.
The app will play X songs and show X pictures

Any special string will get format updates.

Regarding to Crowdin memory:
Unfortunately, we can't fully prevent translator errors. In all other cases, we should aim to make their job easier (e.g. by providing full sentences in plural forms rather than using variables, comments etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants