diff --git a/README.md b/README.md index a78b793ca..05c727a7a 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,17 @@ benilla builds and runs on macOS, Linux and Windows. You need: Xcode command line tools, on Linux the ALSA and udev development packages and pkg-config, on Windows the MSVC build tools that the Rust installer sets up. +This fork also reads community **ruRU language packs for 1.12.1** from `Data/ruRU`. +Keep the base MPQs in `Data` and the Russian `patch-*.MPQ` files in that subfolder; +`WOW_DATA` points to `Data`, not to `ruRU`. An installed pack selects Russian automatically. +`WOW_LOCALE=ruRU` requires the pack, `WOW_LOCALE=enUS` selects the English base chain, and +`WOW_LOCALE=auto` restores automatic selection. Restart the client after changing the language. +The selected chain supplies DBC names, interface strings, fonts, textures and audio; missing +localized files fall back to the base chain. Benilla's own settings and menu captions also have +Russian translations. The login sends the selected locale to the server; server-supplied quest, +NPC and item text requires translations on that server. Packs for later expansions are unsupported. +`moonwell-deploy stage` preserves an installed `ruRU` archive folder in the distribution. + ```sh WOW_DATA=/path/to/WoW/Data cargo run --release -p benilla ``` diff --git a/crates/benilla-app/assets/ui/GameMenuAdapters.xml b/crates/benilla-app/assets/ui/GameMenuAdapters.xml index 43cf5fea8..80a0405c4 100644 --- a/crates/benilla-app/assets/ui/GameMenuAdapters.xml +++ b/crates/benilla-app/assets/ui/GameMenuAdapters.xml @@ -39,7 +39,7 @@ -- space: a width or height of 0 is no size in 1.12's layout, not a flat rect. -- Literal: 1.12 has no GAMEMENU_OPTIONS; its OPTIONS_MENU is "Options Menu". - GameMenuButtonOptions:SetText("Options") + GameMenuButtonOptions:SetText(BenillaUiText("Options")) GameMenuButtonOptions:ClearAllPoints() GameMenuButtonOptions:SetPoint("TOP", GameMenuFrame, "TOP", 0, -32) GameMenuButtonOptions:SetScript("OnClick", function() @@ -66,12 +66,12 @@ local editMode = CreateFrame("Button", "BenillaGameMenuButtonEditMode", GameMenuFrame, "GameMenuButtonTemplate") editMode:SetPoint("TOP", GameMenuButtonKeybindings, "TOP", 0, -19) - editMode:SetText("Edit Mode") + editMode:SetText(BenillaUiText("Edit Mode")) editMode:Disable() local support = CreateFrame("Button", "BenillaGameMenuButtonSupport", GameMenuFrame, "GameMenuButtonTemplate") support:SetPoint("TOP", editMode, "BOTTOM", 0, 0) - support:SetText("Support") + support:SetText(BenillaUiText("Support")) support:Disable() GameMenuButtonMacros:SetPoint("TOP", support, "BOTTOM", 0, 0) diff --git a/crates/benilla-app/assets/ui/KeyBindingsPage.xml b/crates/benilla-app/assets/ui/KeyBindingsPage.xml index 03d4de7ee..7cb1e7e9a 100644 --- a/crates/benilla-app/assets/ui/KeyBindingsPage.xml +++ b/crates/benilla-app/assets/ui/KeyBindingsPage.xml @@ -471,7 +471,7 @@ } -- Reset To Default confirms, as the era's does; our string, since 1.12 has none. StaticPopupDialogs["BENILLA_CONFIRM_RESET_KEYBINDINGS"] = { - text = "Are you sure you want to reset all keybindings to their defaults?", + text = BenillaUiText("Are you sure you want to reset all keybindings to their defaults?"), button1 = BenillaKeyBindings_String("OKAY", "Okay"), button2 = BenillaKeyBindings_String("CANCEL", "Cancel"), OnAccept = function() @@ -491,7 +491,7 @@ for i = 1, GetNumBindings() do local command = GetBinding(i) if not BenillaKeyBindings_IsHeader(command) then - local tag = string.upper(BenillaKeyBindings_String("BINDING_NAME_" .. command, command)) + local tag = BenillaUiUpper(BenillaKeyBindings_String("BINDING_NAME_" .. command, command)) local s = BenillaOptionsSearch_Score(tag, words) if s then table.insert(out, { score = s, index = i }) diff --git a/crates/benilla-app/assets/ui/OptionsFrame.xml b/crates/benilla-app/assets/ui/OptionsFrame.xml index 9b425483a..d97b4d18e 100644 --- a/crates/benilla-app/assets/ui/OptionsFrame.xml +++ b/crates/benilla-app/assets/ui/OptionsFrame.xml @@ -118,6 +118,7 @@ -- The wash at the era atlas size, in the 1.14 hover steel-blue. function BenillaOptionsCategoryRow_OnLoad(row, key, label) + label = BenillaUiText(label) row.categoryKey = key row.pageTitle = label row:SetText(label) @@ -180,7 +181,7 @@ -- Results are the live rows, so writes work mid-search. function BenillaOptionsSearch_Words(text) - local up = string.upper(text) + local up = BenillaUiUpper(text) local words = { up } for w in string.gfind(up, "([^, ]+)") do table.insert(words, w) @@ -324,7 +325,7 @@ BenillaKeyBindingsPage.searchPainted = nil BenillaKeyBindings_SetSelected(nil) BenillaOptionsFrameContainerUnbind:Hide() - BenillaOptionsFrameContainerTitle:SetText("Search Results") + BenillaOptionsFrameContainerTitle:SetText(BenillaUiText("Search Results")) BenillaOptionsFrameContainerDefaults:Hide() local order, groups = BenillaOptionsSearch_FindMatches(text) @@ -434,6 +435,24 @@ .. "which it could only do in exclusive fullscreen. benilla applies it to the " .. "finished image instead, so it works in both display modes." + if GetLocale() == "ruRU" then + BENILLA_TOOLTIP_RENDER_SCALE = + "Меняет разрешение трёхмерного мира относительно размера окна. Интерфейс не меняется.\n\n" + .. "Значения ниже 100% повышают частоту кадров, но снижают чёткость. " + .. "Значения выше 100% сглаживают края за счёт производительности. " + .. "Изменение вступает в силу после нажатия кнопки «Применить»." + BENILLA_TOOLTIP_BACKGROUND_SOUND = + "Продолжает воспроизведение звука игры, когда активно другое окно.\n\n" + .. "Если выключено, при переключении в другое окно игра становится беззвучной. " + .. "Звуки при этом продолжают идти и могут закончиться до вашего возвращения." + BENILLA_TOOLTIP_DISPLAY_MODE = + "Оконный режим на весь экран использует окно без рамки. Обычный оконный режим " + .. "оставляет рамку и заголовок окна.\n\nЭксклюзивный полноэкранный режим не используется." + BENILLA_TOOLTIP_BRIGHTNESS = + "Делает изображение светлее или темнее, в том числе ночью, в пещерах и помещениях.\n\n" + .. "Коррекция применяется к готовому изображению и работает в обоих режимах экрана." + end + BENILLA_OPTIONS_PAGE_ROWS = { -- The era Controls order first; the rest follow their 1.12 box's columns. Controls = { @@ -493,9 +512,10 @@ -- `tip` is a GlobalStrings key, resolved at hover as UIOptionsFrame.lua:265 does. function BenillaOptionsRow_OnLoad(row, cvar, label, tip, child) + label = BenillaUiText(label) row.cvar = cvar row.tip = tip - row.searchTag = string.upper(label) + row.searchTag = BenillaUiUpper(label) -- BenillaOptionsRow_SetEnabled's disabled font must keep the child size. row.child = child local l = getglobal(row:GetName() .. "Label") @@ -633,7 +653,7 @@ local row = dd:GetParent() for _, e in ipairs(row.entries) do local info = {} - info.text = e.text + info.text = BenillaUiText(e.text) info.value = e.value info.func = BenillaOptionsDropdownEntry_OnClick UIDropDownMenu_AddButton(info) @@ -670,7 +690,7 @@ end if match then dd.selectedValue = match.value - UIDropDownMenu_SetText(match.text, dd) + UIDropDownMenu_SetText(BenillaUiText(match.text), dd) -- As UIOptionsFrameCameraDropDown_OnClick retargets OPTION_TOOLTIP_CAMERA. if match.tip then row.tip = match.tip end else @@ -3075,6 +3095,7 @@ wheel stay off until a capsule is selected (BenillaKeyBindings_SetSelected). --> this:EnableKeyboard(false) + BenillaUiLocalize(this) this:EnableMouseWheel(false) BenillaKeyBindings_OnKeyDown() diff --git a/crates/benilla-app/assets/ui/ScriptLogFrame.xml b/crates/benilla-app/assets/ui/ScriptLogFrame.xml index 13fd9dcc0..b0542f773 100644 --- a/crates/benilla-app/assets/ui/ScriptLogFrame.xml +++ b/crates/benilla-app/assets/ui/ScriptLogFrame.xml @@ -78,13 +78,13 @@ local summary if total == 0 then - summary = "No problems this session." + summary = BenillaUiText("No problems this session.") elseif total > shown then - summary = format("%d problems (%d older not kept)", total, total - shown) + summary = format(BenillaUiText("%d problems (%d older not kept)"), total, total - shown) elseif total == 1 then - summary = "1 problem" + summary = BenillaUiText("1 problem") else - summary = format("%d problems", total) + summary = format(BenillaUiText("%d problems"), total) end getglobal("BenillaScriptLogSummary"):SetText(summary) @@ -370,7 +370,7 @@ - BenillaScriptLogFrame_OnLoad() + BenillaUiLocalize(this); BenillaScriptLogFrame_OnLoad() BenillaScriptLogFrame_OnMouseWheel(arg1) BenillaScriptLog_Update() diff --git a/crates/benilla-app/assets/ui/ScrollTemplates.xml b/crates/benilla-app/assets/ui/ScrollTemplates.xml index 19a3f3e8a..7ad383fd2 100644 --- a/crates/benilla-app/assets/ui/ScrollTemplates.xml +++ b/crates/benilla-app/assets/ui/ScrollTemplates.xml @@ -7,6 +7,127 @@ because the loader runs every `` block in order. -->