Repository navigation
Conversation
The window title already used {i18n:Translate ui.window.profiles.name}, but the
in-window header next to the menu bar was hard-coded to the literal string
"Profiles", so it stayed English in every non-English locale.
CollectionsWindow already routes its equivalent header through the translation
extension:
<TextBlock Text="{i18n:Translate ui.window.collections.name}" ... />
Do the same here. The key ui.window.profiles.name already exists in all 17
locale files (zh: "配置方案"), so no new translations are needed.
Two kinds of user-facing text still bypassed the translation system, so they
stayed English in every locale.
File / folder picker dialogs
The native dialogs opened from the Profile Editor, the Profile Export window
and the Settings window had hard-coded titles:
"Open Mod Profile", "Export Profile",
"Select the mod folder",
"Select the output folder for mods installed via Stardrop",
"Select the folder that collections install their mods to"
and the profile import filter was hard-coded to "JSON files".
"Export Profile" reuses the existing ui.window.profiles_export.name key; the
rest got new ui.*.dialogs.* keys. The bare "JSON" filter in the export dialog
is language neutral and was left alone.
Nexus preferred server dropdown
The combo was populated from each server's [Description] attribute, which is
English-only. It now builds ComboBoxItem entries the same way the mod grouping
combo already does: the enum stays on Tag (so the stored setting is unaffected
by localization) and the visible label comes from translation.
This deliberately does *not* translate NexusServers' [Description] values.
Those strings are not just labels - they are the serverName argument handed to
the Nexus API, e.g. in MainWindow's GetFileDownloadLink calls - so localizing
them would break downloads. Only the display label is localized, via the new
ui.settings_window.nexus_servers.* keys, and the code falls back to the
[Description] for any server that has no display key yet.
Key coverage: default.json and zh.json both at 380 keys, no missing, obsolete or
empty entries, and every key referenced from C#/XAML resolves. Builds clean with
0 errors.
Settings are read without a JsonStringEnumConverter, so System.Text.Json does not validate the numeric value of NexusServers. A settings file that holds a value outside the enum (hand-edited, or written by a future build) previously produced an undefined enum value here. Replace First with FirstOrDefault when preselecting the combo box: an unmatched value now leaves the box unselected, matching the tolerance of the previous description-based lookup, instead of throwing InvalidOperationException while the settings window is opening.
|
Hi! Nice catch on the localization improvements! I originally contributed the Bulgarian translation ( I've prepared Bulgarian translations for all of them. Would you mind including them in this PR as well? That would bring the Bulgarian translation to 380/380 keys, without needing a separate PR. Here are the translations: Thanks! |
Contributed by AcTePuKc, who wrote bg.json (see PR Floogen#371) and offered the translations in a comment on this PR rather than opening a separate one. bg.json was at 367 keys against default.json's 380; it is now at 380/380 with no missing, extra or empty keys. Only bg.json is touched, and it keeps its existing CRLF line endings and no-BOM convention.
|
Done! I've added all 13 Bulgarian translations to A few notes on what I did:
The push also refreshes this PR automatically, so no separate PR is needed on your side. Thanks again! |
Every locale was missing exactly these 13 keys, so all of them are now at 380 keys with no missing, extra or empty entries. City names follow each language's own Wikipedia article title rather than a literal transliteration, so they match what speakers of that language expect (de Prag not Prague, es Amsterdam with the accent, uk and ru spelled differently, th and ja/ko transliterated). Three Wikipedia titles carried a disambiguation suffix that is not part of the place name, and that suffix is dropped: ko Paris is listed as "파리 (프랑스)", hu Miami as "Miami (Florida)" and th Singapore as a country article. Nexus CDN stays in English everywhere, same as default.json. The UI strings reuse each locale's existing vocabulary for mod, folder and profile, which I read out of the files that were already translated, instead of inventing new terms. Each file keeps its own conventions, which are not uniform across the repo: fr.json indents with four spaces and tr.json with tabs, while the rest use two. All of them stay CRLF with no BOM, matching what they were before. Only additions - no existing key was removed or edited, including the stale keys that some files still carry from older upstream versions.
Summary
A few UI strings were still hard-coded in the C# source, so they stayed English in every locale. The Nexus server names had no translation keys at all. This adds the missing keys, moves those strings into the translation files, and brings all 16 locales to full coverage of the 13 new keys (380 each), with none missing and none empty.
bg.json,zh.json,default.jsonand the 14 remaining locales each gained exactly these 13 keys.New translation keys (13)
default.jsonui.profile_editor.dialogs.open_profileui.profile_editor.dialogs.json_filterui.settings_window.dialogs.select_mod_folderui.settings_window.dialogs.select_mod_install_folderui.settings_window.dialogs.select_collection_install_folderui.settings_window.nexus_servers.nexus_cdnui.settings_window.nexus_servers.chicagoui.settings_window.nexus_servers.parisui.settings_window.nexus_servers.amsterdamui.settings_window.nexus_servers.pragueui.settings_window.nexus_servers.los_angelesui.settings_window.nexus_servers.miamiui.settings_window.nexus_servers.singaporeSource changes
ProfileEditor.axaml— the in-window header was a literalText="Profiles", so it never followed the language even though the windowTitledid. It now uses{i18n:Translate ui.window.profiles.name}, the same key the title uses.CollectionsWindow.axamlwas already doing this correctly.ProfileEditor.axaml.cs,ProfileExportWindow.axaml.cs— replaced the hard-coded file dialogTitle/ filterNamestrings withProgram.translation.Get(...). Left the othernew FileDialogFilter { Name = "JSON" }alone, since that one is language-neutral.SettingsWindow.axaml.cs— the preferred server combo previously keyed its items byEnumParser.GetDescription(server). Those[Description]values are not translatable by design: they are theserverNameargument handed to the Nexus API (see theGetFileDownloadLink/GetCollectionArchiveLinkcalls). The combo now follows the pattern the mod grouping combo next to it already uses — the enum goes inComboBoxItem.Tagand onlyContentis translated — so localizing the label cannot change the persisted setting or the value sent to the API. A server added upstream still shows up, falling back to its[Description].Translations
City names follow each language's own Wikipedia article title rather than a literal transliteration, so they read the way speakers of that language expect:
deuses Prag,esaccents Ámsterdam,ukandruspell the same city differently, andja/ko/thuse their own forms. Three Wikipedia titles carry a disambiguation suffix that is not part of the place name, and it is dropped:koParis is listed as 파리 (프랑스),huMiami as Miami (Florida), andthSingapore as a country article.Nexus CDNstays in English everywhere, matchingdefault.json.The UI strings reuse each locale's existing vocabulary for mod, folder and profile — read out of the parts of those files that were already translated — rather than introducing new terms.
The Bulgarian strings were contributed by @AcTePuKc, who wrote
bg.jsonand offered them in a comment here instead of opening a separate PR. Thanks!Notes
NexusServers.csis untouched; its[Description]values remain the API values.fr.jsonindents with four spaces andtr.jsonwith tabs, while the others use two. All of them stay CRLF with no BOM, as before. The changes are additions only — no existing key was removed or edited, including the stale keys some files still carry from older upstream versions.NexusServersis read from settings without aJsonStringEnumConverter, so a hand-edited settings file could hold a value outside the enum. The preselection usesFirstOrDefaultrather thanFirst, so that case leaves the box unselected instead of throwing while the settings window opens — the tolerance the previous description-based lookup had.dotnet build Stardrop/Stardrop.csproj -c Release→ 0 errors. The remaining warnings are pre-existing and none of them point at the changed lines.