Skip to content

l10n: add complete Swedish localization - #168

Merged
LNPANDY merged 4 commits into
LNPANDY:mainfrom
yeager:l10n/swedish
Oct 29, 2026
Merged

LNPANDY merged 4 commits into
LNPANDY:mainfrom
yeager:l10n/swedish

Conversation

@yeager

@yeager yeager commented Oct 28, 2026

Copy link
Copy Markdown

Summary

  • add Swedish as a selectable and system-detected language
  • provide reviewed Swedish text for all 616 localization keys
  • generate the matching Qt catalog from the Swift source

Validation

  • swift test --package-path frontend (251 passed; 7 visual-capture tests skipped without their opt-in environment variables)
  • Qt generator and Python bytecode checks
  • placeholder comparison against English (0 mismatches)
  • l10n-lint, svlang, Hunspell review, and scoped Gitleaks scan

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Qt language toggle switches to languages that do not match its labels and prevents users from selecting Swedish through the button.

1 open issue
What changed in this PR

Adds Swedish localization to the NX2Apple launcher, using the Swift catalog as the source for both frontends.

Changes:

  • Adds Swedish translations for all 616 localization keys, with English fallback for future missing entries.
  • Extends language detection and selection handling for Swedish.
  • Updates Qt catalog generation and adds Swift catalog assertions.
File Description
frontend/​Tests/​NSPortBuilderTests/​OnboardingTests.swift Adds assertions for Swedish catalog lookups.
frontend/​Sources/​NSPortBuilder/​Localization.swift Adds Swedish translations, detection, saved preference handling, and fallback.
frontend/​Sources/​NSPortBuilder/​ContentView.swift Adds Swedish to the settings picker and controller navigation.
frontend-qt/​nspb_qt/​localization.py Regenerates the shared catalog with Swedish translations and lookup support.
frontend-qt/​nspb_qt/​i18n.py Adds Swedish language detection and updates toggle handling.
frontend-qt/​gen_localization.py Generates Swedish catalog entries from the Swift overlay.

Review effort: Balanced

Comment thread frontend-qt/nspb_qt/i18n.py Resolved
@LNPANDY

LNPANDY commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Approved (owner) — merge into the next release, not v0.6.0 (already shipped). Adding a full new language is exactly the kind of change that deserves a release of its own rather than riding in a patch release. @v0lumehi please review the localization plumbing (the same L10n table and tests every language goes through) before merging; the translations themselves are yeager's.

@LNPANDY
LNPANDY merged commit 8ee2656 into LNPANDY:main Oct 29, 2026
subyoung added a commit to subyoung/NX2Apple that referenced this pull request Oct 29, 2026
The host already writes a timing row per frame when DM_NVN_TSV names a file (the rows
scripts/bench.py reads), but only from the command line. A game's launch options now have
a Frame times section: a switch makes Play pass DM_NVN_TSV (timing rows only,
DM_NVN_TSV_CALLS=0) to a new file in <library>/frame-times/<title ID>/, and the last three
recordings are summed up as bench.py counts them (nearest-rank percentiles: median, 99 %,
slowest, frames over 50 ms, dropped frames) and charted, the hitches marked. Off by default.

Rebased onto main: the desktop Play now builds its environment with GameStart.environment, and the recording is added on top of it by one helper (FrameTimes.recordingEnvironment) that console mode's Play calls too, so a game whose recording is on is recorded however it is started. The strings have their Swedish entries (LNPANDY#168).

Checked after the rebase: swift build; swift test, 368 tests, 0 failures (FrameTimesTests gains testBothWaysOfStartingAGameRecordTheSame and checks the Swedish entries; ConsoleLiveTests unchanged).
@v0lumehi v0lumehi mentioned this pull request Oct 29, 2026
3 tasks done
subyoung added a commit to subyoung/NX2Apple that referenced this pull request Oct 29, 2026
The host already writes a timing row per frame when DM_NVN_TSV names a file (the rows
scripts/bench.py reads), but only from the command line. A game's launch options now have
a Frame times section: a switch makes Play pass DM_NVN_TSV (timing rows only,
DM_NVN_TSV_CALLS=0) to a new file in <library>/frame-times/<title ID>/, and the last three
recordings are summed up as bench.py counts them (nearest-rank percentiles: median, 99 %,
slowest, frames over 50 ms, dropped frames) and charted, the hitches marked. Off by default.

Rebased onto main: the desktop Play now builds its environment with GameStart.environment, and the recording is added on top of it by one helper (FrameTimes.recordingEnvironment) that console mode's Play calls too, so a game whose recording is on is recorded however it is started. The strings have their Swedish entries (LNPANDY#168).

Checked after the rebase: swift build; swift test, 368 tests, 0 failures (FrameTimesTests gains testBothWaysOfStartingAGameRecordTheSame and checks the Swedish entries; ConsoleLiveTests unchanged).
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 30, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a fifth entry in the
Settings language picker and its controller cycle, and a fourth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Koshindai Koshindai mentioned this pull request Oct 30, 2026
4 of 5 tasks
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 30, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 30, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 30, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 31, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Koshindai added a commit to Koshindai/NX2Apple that referenced this pull request Oct 31, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).
v0lumehi pushed a commit to Koshindai/NX2Apple that referenced this pull request Nov 1, 2026
French players had the English interface. This adds a complete French
catalogue to the Mac launcher and, through the generator, to the Qt front end,
following the Swedish pattern (LNPANDY#168): an `fr` overlay below the (zh, en)
table, a `.fr` case in Lang chosen for fr* devices, a sixth entry in the
Settings language picker and its controller cycle (after German), and a fifth Qt column.

- Every key is translated (vous form, "compiler" for build). Names, units
  and button letters that read the same are listed in the test.
- French spacing: no-break spaces (\u{a0}) before : ; ? !, inside « », and
  between a number and its unit, so they never start a line.
- Qt: Lang.FR, detected from "fr" alone or before a separator (fr_FR, fr-CA)
  and from "French" in a Windows locale name, not from a longer code (fry).
- FrenchLocalizationTests: every key has French, nothing else is left in
  English, placeholders (%@, %d, %ld, %%, %1$@, %.1f) match the English.
- French reads the English section of bilingual release notes.
- Release Info.plist lists fr in CFBundleLocalizations.

Builds on l10n/untranslated-strings (launch options, stage and key names).
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.

4 participants