Skip to content

Add localization for 5 languages#2

Merged
vasylenko merged 7 commits into
mainfrom
feature/localization
Mar 28, 2026
Merged

Add localization for 5 languages#2
vasylenko merged 7 commits into
mainfrom
feature/localization

Conversation

@vasylenko
Copy link
Copy Markdown
Owner

@vasylenko vasylenko commented Mar 28, 2026

Summary

  • Add localization for German (de), Spanish (es), Hindi (hi), Ukrainian (uk), and Chinese Simplified (zh-Hans) using a single String Catalog (Localizable.xcstrings)
  • Change SleepMode.label and .description return types from String to LocalizedStringResource for auto-extraction — new UI strings are picked up on build without manual registration
  • Rename SleepMode.description to modeDescription to avoid shadowing CustomStringConvertible convention
  • Add Localization section and CLI Commands quick reference to CLAUDE.md

Test plan

  • Build passes (xcodebuild build)
  • All 7 tests pass (xcodebuild test)
  • String Catalog JSON validated (python3 -m json.tool)
  • All 11 keys present with translations for all 5 languages
  • Ukrainian locale tested via CLI: open Vigil.app --args -AppleLanguages '(uk)'
  • Default (English) locale verified after locale test
  • Visual check of segmented picker width in German and Hindi (longest translations)

Created with Claude Code under the supervision of Serhii Vasylenko

- Change SleepMode.label and .description return types from String
  to LocalizedStringResource for auto-extraction into String Catalogs
- Create Localizable.xcstrings with 11 translated strings for
  de, es, hi, and zh-Hans
- Clean up knownRegions to match actual target languages
- assertionReason strings intentionally left in English (system-facing)

Created with Claude Code under the supervision of Serhii Vasylenko
Document String Catalog workflow, LocalizedStringResource convention,
and how to add new translatable strings.

Created with Claude Code under the supervision of Serhii Vasylenko
11 strings translated to Ukrainian (uk). Added uk to knownRegions.

Created with Claude Code under the supervision of Serhii Vasylenko
Created with Claude Code under the supervision of Serhii Vasylenko
Build, test, build-and-run, locale testing, and assertion
verification — all in copy-pasteable form.

Created with Claude Code under the supervision of Serhii Vasylenko
awk pattern was too greedy, matched wrong build setting.
Use grep + sed for exact BUILT_PRODUCTS_DIR match.

Created with Claude Code under the supervision of Serhii Vasylenko
Avoids shadowing the CustomStringConvertible.description convention,
especially now that the return type is LocalizedStringResource not String.

Created with Claude Code under the supervision of Serhii Vasylenko
@vasylenko vasylenko changed the title Add localization for 5 languages via String Catalog Add localization for 5 languages Mar 28, 2026
@vasylenko vasylenko merged commit 9c8a424 into main Mar 28, 2026
6 checks passed
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