Skip to content

fix(l10n): Use plural forms for the file and folder counts - #4477

Open
rakekniven wants to merge 1 commit into
masterfrom
fix/l10n-plural-file-folder-count
Open

rakekniven wants to merge 1 commit into
masterfrom
fix/l10n-plural-file-folder-count

Conversation

@rakekniven

Copy link
Copy Markdown
Member

A translator asked at Transifex whether a number comes before "files". It does: the section footer of the file list and the trash join the count with _file_/_files_ and _folder_/_folders_ ("12 files • 3.4 MB"). The "1 vs. more than 1" check only works for languages with two plural forms; languages like Russian or Polish need more.

This PR:

  • adds _files_count_ ("%ld file" / "%ld files") and _folders_count_ ("%ld folder" / "%ld folders") to en.lproj/Localizable.stringsdict
  • uses them with String.localizedStringWithFormat in NCSectionFooter.swift and NCTrash+CollectionView.swift
  • removes the now unused keys _file_, _files_, _folder_, _folders_ from en.lproj/Localizable.strings

The text stays the same in English. I could not build the app locally.

🤖 Generated with Claude Code

The section footer and the trash joined a number with "file"/"files" or
"folder"/"folders", which only works for languages with two plural forms.
Use stringsdict plural rules instead and drop the four old keys.
Reported at Transifex.

Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant