Skip to content

Add Swedish (sv) translation - #4

Open
dchaudhari7177 wants to merge 1 commit into
gaborvidovics76:mainfrom
dchaudhari7177:i18n/swedish
Open

Add Swedish (sv) translation#4
dchaudhari7177 wants to merge 1 commit into
gaborvidovics76:mainfrom
dchaudhari7177:i18n/swedish

Conversation

@dchaudhari7177

Copy link
Copy Markdown

Closes #1.

Adds Swedish to claude_usage/i18n.py.

What changed

  • "sv": "Svenska" added to LANG_NAMES, so it shows up under right-click → Language using the language's own name.
  • A "sv" entry for all 148 STRINGS keys — nothing falls back to English.

Only additions: 149 inserted lines, 0 deletions. No existing translation or formatting was touched.

Translation notes

  • Placeholders — every {} is preserved, in the same order and count as the English string. I checked this programmatically across all 148 keys rather than by eye.
  • Panel strings are deliberately short, since the panel is small: 5 T / VECKA for the short labels, VECKOGRÄNS for the weekly limit, 5-TIMMARSFÖNSTER for the 5-hour window. The longer prose is confined to the settings and sign-in dialogs, where there is room.
  • Swedish spacing convention — a space before the percent sign ({} %/tim), which is standard Swedish typography and matches how the existing European locales handle their own conventions.
  • Windows terminologyaktivitetsfältet (taskbar), Startmenyn (Start menu), Starta med Windows (start with Windows), to match what Swedish Windows 11 itself calls these.

How I tested

python -c "import claude_usage.i18n as i;
i.set_language('sv');
print(i.tr('panel.updated','12:30'), i.tr('hist.stat_forecast'))"
  • The module imports and STRINGS parses.
  • Asserted 'sv' in LANG_NAMES, and that 0 of 148 keys are missing an sv entry.
  • Asserted the {} count matches English for every key — 0 mismatches.

I do not have a Windows 11 desktop session to run the PySide6 panel in, so I have not visually confirmed overflow in the live panel. I kept the panel labels at or below the length of the existing German/Dutch strings, which are the longest currently shipping, so they should not be the ones that overflow first — but please do give it a look on your machine.

Note on the sibling issues

I have also opened PRs for #2 (Japanese) and #3 (Chinese). They each touch the same 148 blocks in i18n.py, so whichever merges first will leave the others needing a trivial rebase. Happy to rebase mine as soon as you merge any one of them — just say the word.

Adds "sv": "Svenska" to LANG_NAMES and a Swedish entry for all 148
STRINGS keys, so nothing falls back to English.

Placeholders are kept in the same order and count as the English source.
Panel strings are kept short (5 T, VECKA, VECKOGRANS) so they fit the
small panel; the longer prose lives in the settings and login dialogs
where there is room.

Closes gaborvidovics76#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant