Skip to content

Add localized selection count strings to all locale files#501

Merged
schuyler merged 1 commit into
mainfrom
claude/i18n-selection-count-strings-c780fe54-9415-42da-a97f-edc4d58e5e30
Jul 1, 2026
Merged

Add localized selection count strings to all locale files#501
schuyler merged 1 commit into
mainfrom
claude/i18n-selection-count-strings-c780fe54-9415-42da-a97f-edc4d58e5e30

Conversation

@schuyler

@schuyler schuyler commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

PR #460 added a selection character-count feature to the word-count widget and introduced three new plural string keys, but only in en.lproj. In any other locale, NSLocalizedString returns the key name (not an English fallback) when the key is absent, so JJPluralForm can't parse it and the widget shows "ERR" when text is selected. Reported by rcuisnier in French during rc.1 testing.

This adds the three keys to all 25 non-English locales:

  • WORDS_SELECTED_PLURAL_STRING
  • CHARACTERS_SELECTED_PLURAL_STRING
  • CHARACTERS_NO_SPACES_SELECTED_PLURAL_STRING

Approach

Each locale's translation was built from its existing base plural vocabulary (WORDS_PLURAL_STRING, etc.) plus the word for "selected," with grammatical agreement matched per language — gender/number in Romance, Slavic, Hebrew, Arabic, Icelandic; case agreement in Finnish; invariant participles where appropriate (German, Dutch, Turkish, Hindi, CJK). The two-form "%@ singular;%@ plural" structure and JJ_PLURAL_FORM_RULE = "1" convention are preserved.

A few forms were refined after review:

  • Japanese uses the state form 選択中 ("currently selected") rather than a verb reading as a command.
  • Arabic / Hebrew place the participle adjacent to the noun; Hebrew uses מסומן ("marked/selected") with correct final-vs-medial nun across gender/number.

Verification

  • grep -L confirms all 25 non-English files now contain the keys; none missing.
  • en.lproj unchanged; no existing keys altered; only the three additions per file (25 files changed, 175 insertions).
  • Non-Latin strings decoded to Unicode codepoints to confirm correct letters and logical byte order (independent of terminal shaping/BiDi).

Related to #452

NSLocalizedString returns the key name (not an English fallback)
when a locale's strings file exists but lacks the key, causing
JJPluralForm to display "ERR" instead of the count.

Related to #452
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report

Current Coverage: 0.00%

Coverage Details (Summary)
Coverage unavailable - xccov failed

@schuyler schuyler merged commit 04b5e61 into main Jul 1, 2026
8 of 9 checks passed
@schuyler schuyler deleted the claude/i18n-selection-count-strings-c780fe54-9415-42da-a97f-edc4d58e5e30 branch July 1, 2026 19:23
schuyler added a commit that referenced this pull request Jul 1, 2026
## Summary

PR #460 added a selection character-count feature to the word-count
widget and introduced three new plural string keys, but only in
`en.lproj`. In any other locale, `NSLocalizedString` returns the **key
name** (not an English fallback) when the key is absent, so
`JJPluralForm` can't parse it and the widget shows **"ERR"** when text
is selected. Reported by rcuisnier in French during rc.1 testing.

This adds the three keys to all 25 non-English locales:

- `WORDS_SELECTED_PLURAL_STRING`
- `CHARACTERS_SELECTED_PLURAL_STRING`
- `CHARACTERS_NO_SPACES_SELECTED_PLURAL_STRING`

## Approach

Each locale's translation was built from its **existing** base plural
vocabulary (`WORDS_PLURAL_STRING`, etc.) plus the word for "selected,"
with grammatical agreement matched per language — gender/number in
Romance, Slavic, Hebrew, Arabic, Icelandic; case agreement in Finnish;
invariant participles where appropriate (German, Dutch, Turkish, Hindi,
CJK). The two-form `"%@ singular;%@ plural"` structure and
`JJ_PLURAL_FORM_RULE = "1"` convention are preserved.

A few forms were refined after review:
- **Japanese** uses the state form `選択中` ("currently selected") rather
than a verb reading as a command.
- **Arabic / Hebrew** place the participle adjacent to the noun; Hebrew
uses `מסומן` ("marked/selected") with correct final-vs-medial nun across
gender/number.

## Verification

- `grep -L` confirms all 25 non-English files now contain the keys; none
missing.
- `en.lproj` unchanged; no existing keys altered; only the three
additions per file (`25 files changed, 175 insertions`).
- Non-Latin strings decoded to Unicode codepoints to confirm correct
letters and logical byte order (independent of terminal shaping/BiDi).

Related to #452
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