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

Make language sync support creating blank language files; clarify lang/README-programmers.txt #1079

Merged
merged 2 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion desktop_version/lang/README-programmers.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
=== I N T R O D U C T I O N ===

This file will explain what you need to know when maintaining translations of VVVVVV (like adding new strings and syncing them across languages).
This file will explain what you need to know when maintaining translations of VVVVVV (like adding new strings to the game and syncing them across languages).

For making new translations of the game, read README-translators.txt instead.



Expand Down
2 changes: 2 additions & 0 deletions desktop_version/lang/README-translators.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The English language files are basically templates for other languages (all the

To create a new language, simply copy the `en` folder, and start by filling out meta.xml (further explained below).

Alternatively, you can create an empty language folder, and then use the in-game sync tool (translator > maintenance > sync language files) to populate it.



=== E X C E L ===
Expand Down
11 changes: 11 additions & 0 deletions desktop_version/src/LocalizationMaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ static void sync_lang_file(const std::string& langcode)
FILESYSTEM_saveTiXml2Document((langcode + "/strings.xml").c_str(), doc);
}

if (!load_lang_doc("numbers", doc, langcode))
{
/* If numbers.xml doesn't exist _at all_, then simply copy it from English,
* so that you can make a new translation simply by making a folder and syncing. */

if (load_lang_doc("numbers", doc, "en"))
{
FILESYSTEM_saveTiXml2Document((langcode + "/numbers.xml").c_str(), doc);
}
}

if (load_lang_doc("strings_plural", doc, "en"))
{
/* Form 255 is technically invalid, but we have to account for it */
Expand Down
5 changes: 5 additions & 0 deletions desktop_version/src/LocalizationStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ static void loadmeta(LangMeta& meta, const std::string& langcode = lang)
{
meta.active = true;
meta.code = langcode;
meta.nativename = langcode;
meta.credit = "";
meta.action_hint = "Press Space, Z, or V to select";
meta.gamepad_hint = "Press {button} to select";
meta.autowordwrap = true;
meta.toupper = true;
meta.toupper_i_dot = false;
Expand Down Expand Up @@ -238,6 +242,7 @@ void resettext(bool final_shutdown)
number[i] = "";
}
SDL_zeroa(number_plural_form);
number_plural_form[1] = 1;

SDL_zeroa(translation_roomnames);
SDL_zeroa(explanation_roomnames);
Expand Down