mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
ebfd9d034dc2f34de24f12016893bba0e7d5a62c
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ebfd9d034d |
feat(localization): complete and correct the Russian locale (#130)
* feat(localization): complete and correct the Russian locale
The Russian locale was 99 keys behind enUS, so a Russian client kept the
English strings for ClassicAPI's own options: the AddOn Options title and
its game-menu button, every page name, header, control label and tooltip,
the AoE Loot binding, and the generic strings the options pages gained
(FOCUS_TOKEN_NOT_FOUND, LUA_ERROR, RELOADUI, PLAYER_LIST_DELIMITER,
SYMBOLIC_NEGATIVE_NUMBER, SYMBOLIC_POSITIVE_NUMBER and the money texture
formats). All 327 keys are now present, in enUS order, so the two files
diff key by key.
Focus follows the client's modern terms — «Взять в фокус», «Сбросить
фокус», «Выбрать фокус» and «Взять цель в фокус» — matching the existing
/фокус and /сбросфокуса aliases. The rest uses the 1.12 Russian client's
vocabulary where it has one (модификация, цель, панель команд, время
восстановления, табличка с именем) and «динамическое выделение» /
«мягкая цель» for action targeting. The money strings keep their |4
plural forms, which GetCoinText expects.
Fixes:
- LARGE_NUMBER_SEPERATOR was "", which turned digit grouping off. It is
now a space, as in the tooltip's 1 234 567.
- FIRST/SECOND_NUMBER_CAP and their _NO_SPACE twins carry the leading
space, because Abbreviate concatenates the number and the suffix
directly.
- EQUIPMENT_MANAGER_ITEMS_MISSING_TOOLTIP printed a slot number where
the missing count belongs; it now takes the missing count.
- SETTINGS_BIND_KEY_TO_COMMAND_OR_CANCEL was missing a space before
«или нажмите».
- SET_FRIENDNOTE_LABEL had a |3-5 declension token, which 1.12 renders
literally.
- ITEM_SLOTS_IGNORED and ITEMS_NOT_IN_INVENTORY had wrong third plural
forms, ITEM_MOD_HIT_MELEE_RATING_SHORT had a double space, and the flat
stat labels (Защита, Уклонение, Парирование, Блок) read wrong after a
signed value, so they use the same «к …» form as the other ITEM_MOD
labels.
The TOC gains ## Notes-ruRU next to ## Notes.
* fix(localization): restore retail ruRU focus, number and log strings
Follow-up to the Russian locale completion, which had changed several
strings that the retail ruRU client already translates. Each is now
the retail text, or a correction where the new wording was wrong:
- Focus: the FOCUSTARGET / TARGETFOCUS binding labels were swapped
(FOCUSTARGET runs FocusUnit("target"), TARGETFOCUS runs
TargetUnit("focus")). All focus strings use retail ruRU's terms
again: Запомнить цель, Восстановить цель, Отменить запоминание цели,
Запомненная цель, <фокус отсутствует>.
- EVENTTRACE_LOG_DISCARD is the message logged after the log is
discarded; it had become an option-style label. Retail: Журнал
сброшен. EVENTTRACE_BUTTON_DISCARD_FILTER read "cancel all"; retail:
Сбросить все.
- FIRST/SECOND_NUMBER_CAP and their _NO_SPACE variants go back to
retail Т / М. AbbreviateNumbers appends the _NO_SPACE suffix
directly by design ("1.2K"), so " тыс." widened compact numbers.
- LARGE_NUMBER_SEPERATOR goes back to retail "" (as frFR). A plain
space also let a number wrap across lines. The separate-large-numbers
tooltip drops its "1 234 567" example, which no longer applies.
- The loose-target option read "whom the soft target follows". The
normal target is the one that follows, so it is now "обычная цель",
and the choices name the soft enemy / soft friend.
* fix(localization): pick language rules by locale name, not 4.3.4's index
1.12.1's locale index (VAR_LOCALE_INDEX, 0xC0E080) is the Wow.ini
Language+Country tag's position in the eight-entry name table at
0x8558A4 (enUS koKR frFR deDE zhCN zhTW esES xxYY), stored once at
0x402562 and 0 when nothing matches. It is never 8. The Russian branches
ported from 4.3.4 switched on 4.3.4's own slot numbers (esMX 7, ruRU 8),
so they could never run: a client whose GetLocale() is "ruRU" fell
through to the default plural rule ("5 предмета") and got no ё/е folding
in bag search.
Localization::Locale::Client() reads the same entry Script_GetLocale
(0x48D8B0) pushes, table[index], and Is(code) compares against it. The
language-rule sites now go through it:
- Text::Grammar's plural index (|4 expansion) keys koKR/frFR/zhCN/zhTW
and ruRU by name.
- Container::Search picks its accent-folding set by name, as a Folding
value instead of an index switch.
- Localization::Numbers' ClientIsAsian reuses IsAsianLocale on the name.
- AddOns::TocRewrite drops its private copy of the reader, and the
slot-8 clamp, which guarded an index that cannot occur.
The DBC column reads keep using the index, which is what it is for.
---------
Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
|
||
|
|
6259e22480 |
feat(lua): ItemUtil from retail
Util/ItemUtil.lua is now the ItemUtil table of retail
Blizzard_FrameXMLUtil/ItemUtil.lua, in retail's own text. As its header
lists, it leaves out ItemButtonUtil and DoesAnyItemSlotMatchItemContext
(retail drives them from frames this client does not have), the transmog
mixin, the currency path of GetItemDetails, and GetCraftingReagentCount
(reagent and account banks).
New for what it calls:
- Enum.BagIndex in the DLL, with Classic Era's names and this client's
indices: Keyring -2, Bank -1, Backpack 0, Bag_1..4 = 1..4 and
BankBag_1..6 = 5..10. Era's bank bags start at 6, after its reagent
bag. The indices live in Offsets.h now, and container/Search.cpp drops
its local copies.
- C_PaperDollInfo.GetInventorySlotInfoForInvSlot in the DLL. It takes the
first PaperDollItemFrame.dbc row with that SlotNumber, and walks the
rows the way the engine's GetInventorySlotInfo (0x004C81B0) does.
- C_Container.GetContainerNumSlots and C_Container.PickupContainerItem as
Lua aliases of the stock globals in Compat.lua, next to
C_ActionBar.ShouldShowKeyring, which is always true.
- ContainerFrame_GetContainerNumSlots and NUM_TOTAL_BAG_FRAMES from
retail's ContainerFrame.lua, and GameTooltip_SuppressAutomaticCompareItem.
Nothing reads that flag, because nothing compares items automatically.
docs/API.md covers all of it, plus Item objects and
C_Item.GetItemIDForItemInfo.
Verified in game: Enum.BagIndex.Keyring is -2, the backpack has 16 slots,
ShouldShowKeyring is true, slot 18 returns the ranged row with checkRelic
true, GetEmptyEquipSlotTooltip(1) is "Head", and FilterOwnedItems({6948})
finds a Hearthstone in the bags.
|
||
|
|
38337c841d |
feat(container): SetItemSearch, IsContainerFiltered
Port of 4.3.4's bag search (CGContainerInfo): C_Container.SetItemSearch, C_Container.IsContainerFiltered and INVENTORY_SEARCH_UPDATE. An item matches on its equipment sets' names, its suffixed name, its subclass short name or its equip slot name, case- and accent-folded per locale. The keyring is searched; non-ASCII search text is folded whole. C_Container.GetContainerItemInfo now reports isFiltered and takes an optional table to fill and return, so bag addons can read every slot without a new table per call. Item::Location::ResolveBagArgs resolves the caller's own bag/slot args without wiping the stack. |