Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare supporting additional languages #1397

Merged
merged 16 commits into from
Jun 25, 2023
Merged

Conversation

dgelessus
Copy link
Contributor

@dgelessus dgelessus commented Jun 3, 2023

Technical improvements to allow introducing new languages gradually and without breaking anything. Specifically:

  • Fixed various issues in code that iterates over all defined languages.
  • Added a list of "usable" languages that work well enough for normal play. For now, these are all the languages that were already selectable on the login screen (English, French, German, Spanish, Italian). All other languages (e. g. Japanese) are not considered "usable" and can only be used with an internal client.
  • Added language definitions for Dutch, Russian, Polish, and Czech. This matches Myst V's internal language list and the definitions should be fully compatible. These languages are not marked as "usable", because they have no translations (though some Russian translations have already been submitted in Feature/russian language moul-assets#235).

Standard disclaimer: I cannot test changes to the Max plugin beyond "it compiles".

@dgelessus
Copy link
Contributor Author

@Hoikas When you have the time, could you pull this PR into TrollLand? It would help with testing H-uru/moul-assets#235. I think this PR has a small conflict with my other PR #1379 though - not sure if that will cause issues for you...

plLocalization::SetLanguage(plLocalization::kJapanese);

for (const auto &lang : plLocalization::GetAllLanguages()) {
if (plLocalization::GetLanguageName(lang).compare_i(params[0]) == 0) {
Copy link
Member

Choose a reason for hiding this comment

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

How would we feel about ISO language codes (i.e., en, fr, de, it, es, etc.) rather that names? That would open us to support region-specific localizations (such as spelling "Neighbourhood" properly in en-GB)

Although I guess that complicates the .loc files too, eh?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally we would use standard language codes everywhere instead of custom names, yeah. Migrating the existing .loc files would be quite painful though - it would be a big incompatible change to all existing content, which would break open PRs and require changes to other tools like Korman.

@Hoikas
Copy link
Member

Hoikas commented Jun 3, 2023

3f17917 is now on TL.

Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp Outdated Show resolved Hide resolved
Comment on lines 542 to 545
if (
plLocalization::IsLanguageUsable(lang)
&& theElement.find(plLocalization::GetLanguageName(lang)) == theElement.end()
) {
Copy link
Member

Choose a reason for hiding this comment

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

This is difficult to parse, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can pull plLocalization::GetLanguage(lang) out into a variable I suppose?

ST_LITERAL("Spanish"), // kSpanish
ST_LITERAL("Italian"), // kItalian
ST_LITERAL("Japanese") // kJapanese
const std::array<std::set<ST::string>, plLocalization::kNumLanguages> plLocalization::fLangCodes = {{
Copy link
Member

Choose a reason for hiding this comment

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

Why not an array of std::unordered_set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was already an ordered std::set before, so I kept it that way. Looks like nothing relies on the order though, so it should be safe to change to std::unordered_set.

Sources/Plasma/PubUtilLib/plResMgr/plLocalization.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Hoikas Hoikas left a comment

Choose a reason for hiding this comment

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

This LTGM, but I'll hold off if you're still waiting on some Russian strings.

dgelessus and others added 2 commits June 21, 2023 23:50
Had to make the "Starting URU. Please wait..." popup a little bit wider
to fit the Russian version of the text.

Co-authored-by: Alexander Diener <[email protected]>
@dgelessus
Copy link
Contributor Author

Russian translations of strings added now.

As mentioned in H-uru/moul-assets#237 (review), there are still problems with Cyrillic text in journals, but I can also fix those separately later (if they're even caused by a code bug at all).

@dgelessus
Copy link
Contributor Author

problems with Cyrillic text in journals

For reference, these are tracked in #1403 and fixed in #1405. The underlying problem was unrelated to this PR or the Russian/Cyrillic fonts.

@Hoikas Hoikas merged commit dd0498a into H-uru:master Jun 25, 2023
@dgelessus dgelessus deleted the more_languages branch November 29, 2023 21:21
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.

3 participants