Skip to content

Commit e29070f

Browse files
committed
Add French translations (WIP), push 1.0.3 in the mean time
1 parent 930da68 commit e29070f

File tree

14 files changed

+160
-159
lines changed

14 files changed

+160
-159
lines changed

Includes/Helpers/Helpers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace CTRPluginFramework {
2626

2727
namespace Helpers {
2828
struct ColoredText {
29-
const char *name;
29+
string name;
3030
int val;
3131
};
3232

Includes/Helpers/Lookup.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ namespace CTRPluginFramework {
903903
break;
904904

905905
case 386: // Deoxys
906-
options = {"Normal", "Attack", "Defense", "Speed"};
906+
options = {"Normal", language("Attack", "Attaque"), language("Defense", "Défense"), language("Speed", "Vitesse")};
907907
break;
908908

909909
case 412: // Burmy
@@ -1112,7 +1112,7 @@ namespace CTRPluginFramework {
11121112
break;
11131113

11141114
case 386: // Deoxys
1115-
options = {"Normal", "Attack", "Defense", "Speed"};
1115+
options = {"Normal", language("Attack", "Attaque"), language("Defense", "Défense"), language("Speed", "Vitesse")};
11161116
break;
11171117

11181118
case 412: // Burmy

Library/Sources/CTRPluginFrameworkImpl/Menu/PluginMenuTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,8 @@ namespace CTRPluginFramework {
647647
static Clock clock;
648648
static bool timesup = true;
649649

650-
static const char version[] = "Version: 1.0.2";
651-
static const char compiled[] = "Compiled: March 19, 2023";
650+
static const char version[] = "Version: 1.0.3";
651+
static const char compiled[] = "Compiled: April 7, 2023";
652652
const char *info[3] = {SystemModel().c_str(), InternetAccess().c_str(), CurrentTime().c_str()};
653653

654654
{

Library/lib/libctrpf.a

0 Bytes
Binary file not shown.

Sources/Folders/Battle.cpp

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace Battle {
2828
else goto none;
2929
}
3030

31-
else none: party[i] = Color::Gray << "None";
31+
else none: party[i] = Color::Gray << language("None", "Aucun");
3232
}
3333

3434
return party;
@@ -45,32 +45,32 @@ namespace Battle {
4545
pointer[i] = Helpers::Battle::offset[i] + ((slot - 1) * 0x4);
4646

4747
Message::Completed();
48-
entry->Name() = "Slot: " << Color::Gray << Utils::ToString(slot, 0);
48+
entry->Name() = language("Slot: ", "Emplacement: ") << Color::Gray << Utils::ToString(slot, 0);
4949
}
5050
}
5151
}
5252

5353
static int isAffected, conditionOption;
5454

5555
struct Conditions {
56-
const char *name;
56+
string name;
5757
int value;
5858
};
5959

6060
void Condition(MenuEntry *entry) {
6161
Conditions conditions[5] = {
62-
{"Paralyzed", Helpers::AutoRegion(0x20, 0x28)},
63-
{"Asleep", Helpers::AutoRegion(0x24, 0x30)},
64-
{"Frozen", Helpers::AutoRegion(0x28, 0x38)},
65-
{"Burned", Helpers::AutoRegion(0x2C, 0x40)},
66-
{"Poisoned", Helpers::AutoRegion(0x30, 0x48)}
62+
{language("Paralyzed", "Paralysie"), Helpers::AutoRegion(0x20, 0x28)},
63+
{language("Asleep", "Endormi"), Helpers::AutoRegion(0x24, 0x30)},
64+
{language("Frozen", "Congelé"), Helpers::AutoRegion(0x28, 0x38)},
65+
{language("Burned", "Brûlé"), Helpers::AutoRegion(0x2C, 0x40)},
66+
{language("Poisoned", "Empoisonné"), Helpers::AutoRegion(0x30, 0x48)}
6767
};
6868

69-
static const vector<string> choices = {"None", "Affected"};
69+
static const vector<string> choices = {language("None", "Aucun"), language("Affected", "Affecté")};
7070
vector<string> options;
7171
KeyboardPlus keyboard;
7272

73-
for (const Conditions &nickname : conditions)
73+
for (Conditions &nickname : conditions)
7474
options.push_back(nickname.name);
7575

7676
if (IsInBattle()) {
@@ -106,7 +106,7 @@ namespace Battle {
106106
static u8 boostVal[7];
107107

108108
void StatisticsKB(MenuEntry *entry) {
109-
static const vector<string> choice = {"Base", "Boosts"}, baseChoices = {"Attack", "Defense", "Sp. Atk", "Sp. Def", "Speed"}, boostsChoices = {"Attack", "Defense", "Sp. Atk", "Sp. Def", "Speed", "Accuracy", "Evasiveness"};
109+
static const vector<string> choice = {language("Base", "Stats de base"), "Boosts"}, baseChoices = {language("Attack", "Attaque"), language("Defense", "Défense"), language("Sp. Atk", "Attaque Sp."), language("Sp. Def", "Défense Sp."), language("Speed", "Vitesse")}, boostsChoices = {language("Attack", "Attaque"), language("Defense", "Défense"), language("Sp. Atk", "Attaque Sp."), language("Sp. Def", "Défense Sp."), language("Speed", "Vitesse"), language("Accuracy", "Précision"), language("Evasiveness", "Esquive")};
110110
u16 getBaseVal;
111111
u8 getBoostVal;
112112

@@ -233,7 +233,7 @@ namespace Battle {
233233
static u8 staminaVal;
234234

235235
void InvincibilityKB(MenuEntry *entry) {
236-
static const vector<string> choices = {"Health", "Stamina"};
236+
static const vector<string> choices = {language("HP", "PV"), "PP"};
237237
u16 getHealthVal;
238238
u8 getStaminaVal;
239239

@@ -244,7 +244,7 @@ namespace Battle {
244244
keyboard.SetKeyboard(entry->Name() + ":", true, choices, invincibilityOption);
245245

246246
if (invincibilityOption == 0) {
247-
if (KB<u16>("Health:", true, false, 3, getHealthVal, 0, 1, 999, Callback16)) {
247+
if (KB<u16>(language("HP:", "PV:"), true, false, 3, getHealthVal, 0, 1, 999, Callback16)) {
248248
healthVal = getHealthVal;
249249
Message::Completed();
250250
}
@@ -253,7 +253,7 @@ namespace Battle {
253253
}
254254

255255
else if (invincibilityOption == 1) {
256-
if (KB<u8>("Stamina:", true, false, 2, getStaminaVal, 0, 1, 99, Callback8)) {
256+
if (KB<u8>("PP:", true, false, 2, getStaminaVal, 0, 1, 99, Callback8)) {
257257
staminaVal = getStaminaVal;
258258
Message::Completed();
259259
}
@@ -306,7 +306,8 @@ namespace Battle {
306306
static int attackSlot;
307307

308308
void Attacks(MenuEntry *entry) {
309-
static const vector<string> options = {"Move 1", "Move 2", "Move 3", "Move 4"};
309+
static const string langName = language("Move", "Attaque");
310+
static const vector<string> options = {langName + " 1", langName + " 2", langName + " 3", langName + " 4"};
310311
KeyboardPlus keyboard;
311312

312313
if (IsInBattle()) {
@@ -367,14 +368,14 @@ namespace Battle {
367368
}
368369

369370
void RevertDefault(MenuEntry *entry) {
370-
if (MessageBox(CenterAlign("Revert everything?"), DialogType::DialogYesNo, ClearScreen::Both)()) {
371+
if (MessageBox(CenterAlign(language("Revert everything?", "Tout réinitialiser?")), DialogType::DialogYesNo, ClearScreen::Both)()) {
371372
isRevert = true;
372-
entry->Name() = "Revert to Default: " << Color::Green << "On";
373+
entry->Name() = language("Revert to Default: ", "Retourner aux paramètres par défaut: ") << Color::Green << language("On", "Activé");
373374
Message::Completed();
374375
return;
375376
}
376377

377-
entry->Name() = "Revert to Default: " << Color::Red << "Off";
378+
entry->Name() = language("Revert to Default: ", "Retourner aux paramètres par défaut: ") << Color::Red << language("Off", "Désactivé");
378379
isRevert = false;
379380
}
380381

@@ -393,7 +394,7 @@ namespace Battle {
393394
static PK6 *pkmn = new PK6;
394395
static const u32 pointer = Helpers::AutoRegion(Helpers::GetVersion(0x81FF744, 0x81FEEC8), Helpers::GetVersion(0x3003035C, 0x30030544));
395396
static u32 location = pointer;
396-
static const vector<string> stats = {"HP", "Atk", "Def", "Spe", "SpA", "SpD"};
397+
static const vector<string> stats = {language("HP", "PV"), language("Atk", "Atq"), "Def", language("Spe", "Vit"), language("SpA", "AtqS"), language("Def", "DefS")};
397398

398399
if (!screen.IsTop)
399400
return false;
@@ -407,36 +408,36 @@ namespace Battle {
407408
location -= 0x1E4;
408409

409410
if (infoScreen == 0)
410-
screen.Draw(Color::Gray << "Slot: " << Utils::ToString(((location + 0x1E4 - pointer) / 0x1E4), 0), 5, 5, Color::White, Color::Black);
411+
screen.Draw(Color::Gray << language("Slot: ", "Emplacement: ") << Utils::ToString(((location + 0x1E4 - pointer) / 0x1E4), 0), 5, 5, Color::White, Color::Black);
411412

412413
if (IsValid(location, pkmn)) {
413414
if (infoScreen == 0) {
414-
screen.Draw("Species: " << Color(0xF2, 0xCE, 0x70) << allPkmn[pkmn->species - 1], 5, 15, Color::White, Color::Black);
415+
screen.Draw(language("Species: ", "Espece: ") << Color(0xF2, 0xCE, 0x70) << allPkmn[pkmn->species - 1], 5, 15, Color::White, Color::Black);
415416
screen.Draw("Nature: " << Color::White << allNatures[pkmn->nature], 5, 25, Color::White, Color::Black);
416-
screen.Draw("Item: " << (pkmn->heldItem == 0 ? Color::Gray : Color::White) << (pkmn->heldItem == 0 ? "None" : allItems[pkmn->heldItem - 1]), 5, 35, Color::White, Color::Black);
417-
screen.Draw("Ability: " << Color::White << allAbilities[pkmn->ability - 1], 5, 45, Color::White, Color::Black);
417+
screen.Draw(language("Item: ", "Objet: ") << (pkmn->heldItem == 0 ? Color::Gray : Color::White) << (pkmn->heldItem == 0 ? "None" : allItems[pkmn->heldItem - 1]), 5, 35, Color::White, Color::Black);
418+
screen.Draw(language("Ability: ", "Capacite: ") << Color::White << allAbilities[pkmn->ability - 1], 5, 45, Color::White, Color::Black);
418419
}
419420

420421
else if (infoScreen == 1) {
421-
screen.Draw(Color::SkyBlue << "Moves", 5, 5, Color::White, Color::Black);
422+
screen.Draw(Color::SkyBlue << language("Moves", "Attaques"), 5, 5, Color::White, Color::Black);
422423

423424
for (int i = 0; i < 4; i++) {
424425
if (pkmn->moves[i] > 0)
425426
screen.Draw(to_string(i + 1) + ": " << Color::White << allMoves[pkmn->moves[i] - 1], 5, 15 + (i * 10), Color::White, Color::Black);
426427

427-
else screen.Draw(to_string(i + 1) + ": " << Color::Gray << "None", 5, 15 + (i * 10), Color::White, Color::Black);
428+
else screen.Draw(to_string(i + 1) + ": " << Color::Gray << language("None", "Aucun"), 5, 15 + (i * 10), Color::White, Color::Black);
428429
}
429430
}
430431

431432
else if (infoScreen == 2) {
432-
screen.Draw(Color::Magenta << "IVs", 5, 5, Color::White, Color::Black);
433+
screen.Draw(Color::Magenta << language("IVs", "VIs"), 5, 5, Color::White, Color::Black);
433434

434435
for (int j = 0; j < stats.size(); j++)
435436
screen.Draw(stats[j] + ": " + to_string((u8)(pkmn->iv32 >> (5 * j)) & 0x1F), 5, 15 + (j * 10), Color::White, Color::Black);
436437
}
437438

438439
else if (infoScreen == 3) {
439-
screen.Draw(Color::Olive << "EVs", 5, 5, Color::White, Color::Black);
440+
screen.Draw(Color::Olive << language("EVs", "VEs"), 5, 5, Color::White, Color::Black);
440441

441442
for (int k = 0; k < stats.size(); k++)
442443
screen.Draw(stats[k] + ": " + to_string(pkmn->evs[k]), 5, 15 + (k * 10), Color::White, Color::Black);
@@ -466,7 +467,7 @@ namespace Battle {
466467
}
467468

468469
void PokeView(MenuEntry *entry) {
469-
static const vector<string> options = {"Enable", "Disable"};
470+
static const vector<string> options = {language("Enable", "Activer"), language("Disable", "Désactiver")};
470471
KeyboardPlus keyboard;
471472

472473
if (IsInBattle()) {
@@ -517,7 +518,7 @@ namespace Battle {
517518
if (Bit::Read8(address, data8, true) && data8 != 1) {
518519
Sleep(Seconds(1));
519520

520-
if (MessageBox(CenterAlign("Unlock full Mega Evolution?"), DialogType::DialogYesNo, ClearScreen::Both)()) {
521+
if (MessageBox(CenterAlign(language("Unlock full Mega Evolution?", "Débloquer la méga-évolution complète?")), DialogType::DialogYesNo, ClearScreen::Both)()) {
521522
if (Bit::Read8(address, data8, true))
522523
Bit::Write8(address, 1, true);
523524
}
@@ -626,8 +627,8 @@ namespace Battle {
626627
KeyboardPlus keyboard;
627628

628629
if (pokemon > 0) {
629-
if (KB<u8>("Level:", true, false, 3, level, 0, 1, 100, Callback8)) {
630-
if (keyboard.SetKeyboard("Form:", true, CTRPluginFramework::Gen6::Forms(pokemon), form) != -1) {
630+
if (KB<u8>(language("Level:", "Niveau:"), true, false, 3, level, 0, 1, 100, Callback8)) {
631+
if (keyboard.SetKeyboard(language("Form:", "Forme:"), true, CTRPluginFramework::Gen6::Forms(pokemon), form) != -1) {
631632
InitPokemon(pokemon, form, level, Helpers::GetVersion(false, true));
632633
Message::Completed();
633634
}
@@ -647,7 +648,7 @@ namespace Battle {
647648
static const vector<string> options = {
648649
Helpers::GetVersion<string>(
649650
{"Mewtwo", Helpers::PickGame("Xerneas", "Yveltal"), "Zygarde"},
650-
{Helpers::PickGame("Ho-Oh", "Lugia"), Helpers::PickGame("Latias", "Latios"), Helpers::PickGame("Groudon", "Kyogre"), "Rayquaza", "Deoxys", Helpers::PickGame("Palkia", "Dialga"), "Heatran", "Regigigas", "Giritina", Helpers::PickGame("Tornadus", "Thunderus"), "Landorus", "Kyruem"}
651+
{Helpers::PickGame("Ho-Oh", "Lugia"), Helpers::PickGame("Latias", "Latios"), Helpers::PickGame("Groudon", "Kyogre"), "Rayquaza", "Deoxys", Helpers::PickGame("Palkia", "Dialga"), "Heatran", "Regigigas", "Giritina", Helpers::PickGame(language("Tornadus", "Boréas"), language("Thunderus", "Fulguris")), language("Landorus", "Démétéros"), "Kyruem"}
651652
)};
652653

653654
KeyboardPlus keyboard;
@@ -930,8 +931,8 @@ namespace Battle {
930931
KeyboardPlus keyboard;
931932

932933
if (pokemon > 0) {
933-
if (keyboard.SetKeyboard("Form:", true, CTRPluginFramework::Gen7::Forms(pokemon), form) != -1) {
934-
if (KB<u8>("Level:", true, false, 3, level, 0, 1, 100, Callback8))
934+
if (keyboard.SetKeyboard(language("Form:", "Forme:"), true, CTRPluginFramework::Gen7::Forms(pokemon), form) != -1) {
935+
if (KB<u8>(language("Level:", "Niveau:"), true, false, 3, level, 0, 1, 100, Callback8))
935936
entry->SetGameFunc(InitPokemon);
936937
Message::Completed();
937938
}
@@ -947,7 +948,7 @@ namespace Battle {
947948
{0x33013264, 0x33013266, 0x33013268, 0x3301322C, 0x33013712, 0x3301379F, 0x33013796}
948949
)};
949950

950-
static const vector<string> options = {"Tapu Koko", "Tapu Lele", "Tapu Bulu", "Tapu Fini", "Cosmog", Helpers::PickGame("Solgaleo", "Lunala"), "Necrozma"};
951+
static const vector<string> options = {language("Tapu Koko", "Tokorico"), language("Tapu Lele", "Tokopiyon"), language("Tapu Bulu", "Tokotoro"), language("Tapu Fini", "Tokopisco"), "Cosmog", Helpers::PickGame("Solgaleo", "Lunala"), "Necrozma"};
951952
KeyboardPlus keyboard;
952953

953954
static const vector<bool> rightSide = {true, true, true, true, false, false, false};
@@ -1121,7 +1122,7 @@ namespace Battle {
11211122
}
11221123

11231124
void MusicKB(MenuEntry *entry) {
1124-
static const vector<string> options = {"Wild Encounter", "Trainer"};
1125+
static const vector<string> options = {language("Wild Encounter", "Rencontres Sauvages"), language("Trainer", "Combats de Dresseurs")};
11251126
KeyboardPlus keyboard;
11261127

11271128
if (keyboard.SetKeyboard(entry->Name() + ":", true, options, musicType) != -1) {
@@ -1132,7 +1133,7 @@ namespace Battle {
11321133
getMusicFiles.push_back(nickname.name);
11331134
}
11341135

1135-
if (keyboard.SetKeyboard(entry->Name() + ":\n\nSelect the music file you would like to use.", true, getMusicFiles, music) != -1) {
1136+
if (keyboard.SetKeyboard(entry->Name() + ":\n\n" + language("Select the music file you would like to use.", "Choisissez le fichier de musique que vous souhaitez utiliser."), true, getMusicFiles, music) != -1) {
11361137
musicSelected = true;
11371138
entry->SetGameFunc(ApplyMusic);
11381139
Message::Completed();

0 commit comments

Comments
 (0)