Skip to content

feat(localization): add French localization support#176

Open
itishermann wants to merge 1 commit intosozercan:mainfrom
itishermann:main
Open

feat(localization): add French localization support#176
itishermann wants to merge 1 commit intosozercan:mainfrom
itishermann:main

Conversation

@itishermann
Copy link
Copy Markdown

Description

Adds French (Français) as a selectable app UI language, introduces localized strings for all 280 keys including Romanize Lyrics and Enable %@ Scrobbling, and normalizes Localizable.xcstrings with Xcode-style spacing ("key" : value).

AI Prompt (Optional)

🤖 AI Prompt Used
- add French localization
- GeneralSettingsView: localize "Romanize Lyrics"
- ScrobblingSettingsView: localize dynamic "Enable \(service) Scrobbling"
- keep new strings in the catalog; align xcstrings with Xcode like spacing

AI Tool: Claude Code

Type of Change

  • ✨ New feature (non-breaking change that adds functionality)
  • 🎨 UI/UX improvement
  • 🧪 Test update

Changes Made

  • French (fr): fr localizations added across Localizable.xcstrings (alongside existing ar / ko / tr / id), full fr.lproj/Localizable.strings (280 entries), SettingsManager.ContentLanguage.french (languageCode: fr, picker label Français).
  • Tests: AppLocalizationTests covers French Artist ("Artiste") and Subscribe %@ ("S'abonner") formatting.
  • Romanize Lyrics: Catalog key + French translation ("Romaniser les paroles"), matching entry in fr.lproj.
  • Enable %@ Scrobbling: French translation ("Activer le Scrobbling %@") in catalog and .lproj; %@ placeholder moves to end to match French grammar.
  • Localizable.xcstrings: Normalized to Xcode-style JSON (space before :) after edits so future diffs are mostly substantive.

Testing

  • Unit tests pass (swift test --skip KasetUITests — 1121 tests, all passing)
  • Manual testing performed
  • UI tested on macOS 26+

Checklist

  • My code follows the project's style guidelines
  • I have run swiftlint --strict && swiftformat .
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • I have checked for any performance implications
  • My changes generate no new warnings (none introduced by these edits; existing project warnings may remain)

Additional Notes

  • %@ in Enable %@ Scrobbling lets French place the service name (e.g. Last.fm) where grammar requires — here at the end: "Activer le Scrobbling %@".
  • French uses « guillemets » for quotation marks in longer strings (e.g. the passkey note), following typographic convention.
  • To reapply Xcode-style xcstrings after a tool emits compact JSON:
python3 -c "
import json, pathlib
p = pathlib.Path('Sources/Kaset/Resources/Localizable.xcstrings')
d = json.loads(p.read_text(encoding='utf-8'))
out = json.dumps(d, ensure_ascii=False, indent=2, separators=(', ', ' : '))
p.write_text('\n'.join(line.rstrip() for line in out.splitlines()) + '\n', encoding='utf-8')
"

* Introduce French localization strings for the app.
* Update SettingsManager to include French as a supported language.
* Add unit tests to verify French localization for specific strings.

Signed-off-by: Hermann Kao <38349706+itishermann@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 8, 2026 10:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds French UI localization support to Kaset, wiring a new selectable UI language into settings and providing French translations in the string catalog and generated .strings resources.

Changes:

  • Add SettingsManager.ContentLanguage.french with display name and fr language code.
  • Add French (fr) translations to Localizable.xcstrings and generate fr.lproj/Localizable.strings.
  • Add unit tests verifying French bundle localization and formatted-string behavior.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
Tests/KasetTests/AppLocalizationTests.swift Adds a French localization test covering a plain key (Artist) and formatted key (Subscribe %@).
Sources/Kaset/Services/SettingsManager.swift Introduces ContentLanguage.french and maps it to language code fr for bundle lookup/locale.
Sources/Kaset/Resources/Localizable.xcstrings Adds fr localizations (and normalizes formatting) including keys used by settings/UI.
Sources/Kaset/Resources/fr.lproj/Localizable.strings Adds generated French strings resource file for runtime localization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants