Skip to content

Add plural labels for subjects and sections - #15

Merged
Jeehut merged 1 commit into
mainfrom
wip/plural-subject-section-labels
Oct 12, 2026
Merged

Jeehut merged 1 commit into
mainfrom
wip/plural-subject-section-labels

Conversation

@Jeehut

@Jeehut Jeehut commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Closes #3.

Answers the first question in #3 by @The-Wolfson: there were no plural versions of TK.Label.subject and TK.Label.section.

  • TranslateKitEducation gets TK.Label.subjects ("Subjects").
  • TranslateKitMusic and TranslateKitMagazinesAndNewspapers each get TK.Label.sections ("Sections"), the two modules that already carry the singular.

Each plural uses the same word as the singular next to it in that catalog (de "Fach" → "Fächer", "Abschnitt" → "Abschnitte" in Music, "Bereich" → "Bereiche" in Magazines), so a list header and its rows match. Languages without a plural form for nouns (ja, ko, zh, th, vi, id, ms) keep the singular word, as their own UIs do.

This adds plural labels, not plural variations (%lld subjects). Counted strings are a different feature and not part of 2.0.

How this was verified

PluralLabelTests reads the three compiled bundles for any language that lacks the new key. With the entries reduced to English it failed for all three; on this branch it passes:

# new entries in English only
✘ pluralLabelIsTranslatedIntoEveryLanguage(key:target:) with 3 test cases failed with 3 issues.

# this branch
✔ Test run with 6 tests in 2 suites passed.

swift test --build-system swiftbuild on Xcode 26.6 / Swift 6.3.3, as in CI. Tests/TranslateKitTests/CompiledCatalog.swift is the same helper as in #12–#14.

Lists and headers need the plural, which a translator cannot derive
from the singular label. Education gets 'Subjects', Music and Magazines
and Newspapers get 'Sections', each translated in the same terms as the
singular next to it.
@Jeehut
Jeehut force-pushed the wip/plural-subject-section-labels branch from 0177471 to 3b9e06c Compare October 12, 2026 09:36
@Jeehut
Jeehut merged commit 54306dc into main Oct 12, 2026
1 check passed
@Jeehut
Jeehut deleted the wip/plural-subject-section-labels branch October 12, 2026 09:39
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.

[Feat] Are there plurals available?

1 participant