Skip to content

Conversation

@sjoblomj
Copy link
Contributor

@sjoblomj sjoblomj commented Oct 26, 2025

Locales are not supported in mpqcli, see #113. This PR, along with several subsequent PRs will add locale support to mpqcli, with one PR per subcommand (split up this way in order to try to make it all more manageable). This PR is the base, which paves the way for the other subsequent PRs.

In this PR:

  • locales.cpp and locales.h, which defines the locales and adds related functions.
  • Locale support for the list subcommand.
  • A fixture in conftest, which sets up MPQs with locales.
  • Minor fixes and paving the path for adding locales to the other subcommands in subsequent PRs.

This PR builds on top of #117, and the functionality in it will be needed for testing that locales work as expected in the subsequent PRs.

Subsequent PRs:

@thomaslaurenson
Copy link
Collaborator

Again - this looks like an awesome addition. Some of this is new to me, so will do some reading and testing and report back.

@sjoblomj
Copy link
Contributor Author

sjoblomj commented Nov 1, 2025

Again - this looks like an awesome addition. Some of this is new to me, so will do some reading and testing and report back.

A file is uniquely identified by its filename, locale and platform. Only one platform has ever been observed, so StormLib doesn't seem to expose it via its API - so only the filename and locale is of relevance. A brief mention of it is in the format file here: https://github.com/ladislav-zezula/StormLib/blob/master/doc/The%20MoPaQ%20File%20Format%201.0.txt#L89-L98

The tests I made in conftest.py create an MPQ with different locales for testing (although the tests were added in this PR, the implementation is in #119). Let me know if you would like an MPQ from "the wild" to test with.

Comment on lines +19 to +35
{0x000, "enUS"}, // Default - English (US)
{0x404, "zhTW"}, // Chinese (Taiwan)
{0x405, "csCZ"}, // Czech
{0x407, "deDE"}, // German
{0x409, "enUS"}, // English (US)
{0x40a, "esES"}, // Spanish (Spain)
{0x40c, "frFR"}, // French
{0x410, "itIT"}, // Italian
{0x411, "jaJP"}, // Japanese
{0x412, "koKR"}, // Korean
{0x413, "nlNL"}, // Dutch
{0x415, "plPL"}, // Polish
{0x416, "ptPT"}, // Portuguese (Portugal)
{0x419, "ruRU"}, // Russian
{0x804, "zhCN"}, // Chinese (Simplified)
{0x809, "enGB"}, // English (UK)
{0x80A, "esMX"} // Spanish (Mexico)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This list might not be exhaustive. Some locales are mentioned here and here, but both those links appear dated. I don't know if WoW or other games post ~2010 introduced more locales or not. I guess the MPQ format itself allows pretty much any locale value, so the question is which ones have been used by Blizzard. It's trivial to add more later as needed, in any case.

@thomaslaurenson thomaslaurenson merged commit 9820211 into TheGrayDot:main Nov 23, 2025
11 checks passed
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.

2 participants