Skip to content

Commit

Permalink
Added language translations
Browse files Browse the repository at this point in the history
  • Loading branch information
larsenv committed Oct 7, 2017
1 parent ff61cf0 commit 13fea53
Showing 1 changed file with 134 additions and 22 deletions.
156 changes: 134 additions & 22 deletions rssmii/source/main.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <mxml.h>

#define LANG_GER lang == 2
#define LANG_FRE lang == 3
#define LANG_SPA lang == 4
#define LANG_DUT lang == 6
int lang;

static void *xfb = NULL;
Expand All @@ -27,17 +30,26 @@ void AddJobs()
//u64 homebrewtitleid = 0x0001000848424D4CLL;//TitleID for wiibrew+hackmii mail: 00010008-HBML. This is only an ID used for WC24, it's not a real NAND title.
u64 homebrewtitleid = 0x0001000846454544LL; //TitleID for RSS-Feed mail: 00010008-FEED.
if (LANG_GER) printf("WC24 initialisieren...");
else if (LANG_FRE) printf("Initialisation de WiiConnect24...");
else if (LANG_SPA) printf("Iniciando WC24...");
else if (LANG_DUT) printf("WC24 aan het opstarten...");
else printf("Initializing WC24...\n");

s32 retval = WC24_Init();
if(retval<0)
{
if (LANG_GER) printf("WC24_Init returned %d\n", retval);
else if (LANG_FRE) printf("WC24_Init a retourné %d\n", retval);
else if (LANG_SPA) printf("WC24_Init regresó %d\n", retval);
else if (LANG_DUT) printf("WC24_Init meldde %d\n", retval);
else printf("WC24_Init returned %d\n", retval);
return;
}

if (LANG_GER) printf("Vorherige records&entries loeschen...\n");
else if (LANG_FRE) printf("Suppression des anciennes entrées...\n");
else if (LANG_SPA) printf("Eliminando datos y entradas previas...\n");
else if (LANG_DUT) printf("Bezig met verwijderen vorige opnames en registraties...\n");
else printf("Deleting previous records&entries...\n");

while((retval=WC24_FindRecord((u32)homebrewtitleid, &myrec))!=LIBWC24_ENOENT)
Expand All @@ -50,17 +62,7 @@ void AddJobs()
{
if (LANG_GER)
{
printf("In welchem Zeitabstand soll auf Neuigkeiten im RSS-Feed \"%s\" geprueft werden? (A: 1 min, B: 5 min, 1: 15 min, 2: 30 min)\n", jobs[i].name);
which = -1;
while (which == -1)
{
WPAD_ScanPads();
u32 pressed = WPAD_ButtonsDown(0);
if (pressed & WPAD_BUTTON_A) which = 1;
if (pressed & WPAD_BUTTON_B) which = 5;
if (pressed & WPAD_BUTTON_1) which = 15;
if (pressed & WPAD_BUTTON_2) which = 30;
}
which = 60;
printf("Record&entry erstellen...\n");
//Will now compose url:
memset(jobs[i].final_url, 0, 512);
Expand All @@ -71,19 +73,48 @@ void AddJobs()
printf("WC24_CreateRecord ergab %d\n", retval);
}
}
else
else if (LANG_FRE)
{
which = 60;
printf("Création des nouvelles entrées...\n");
//Will now compose url:
memset(jobs[i].final_url, 0, 512);
snprintf(jobs[i].final_url, 511, "http://rss.wii.rc24.xyz/rss_displayer.php?feedurl=%s&title=%s", jobs[i].url, jobs[i].name);
s32 retval = WC24_CreateRecord(&myrec, &myent, (u32)homebrewtitleid, homebrewtitleid, /*0x4842*/0x4645, WC24_TYPE_MSGBOARD, WC24_RECORD_FLAGS_DEFAULT, WC24_FLAGS_HB, which, 0x5a0, 0, jobs[i].final_url, NULL);
if (retval<0)
{
printf("WC24_CreateRecord a retourné %d\n", retval);
}
}
else if (LANG_SPA)
{
which = 60;
printf("Creando datos y entradas...\n");
//Will now compose url:
memset(jobs[i].final_url, 0, 512);
snprintf(jobs[i].final_url, 511, "http://rss.wii.rc24.xyz/rss_displayer.php?feedurl=%s&title=%s", jobs[i].url, jobs[i].name);
s32 retval = WC24_CreateRecord(&myrec, &myent, (u32)homebrewtitleid, homebrewtitleid, /*0x4842*/0x4645, WC24_TYPE_MSGBOARD, WC24_RECORD_FLAGS_DEFAULT, WC24_FLAGS_HB, which, 0x5a0, 0, jobs[i].final_url, NULL);
if (retval<0)
{
printf("WC24_CreateRecord regresó %d\n", retval);
}
}
else if (LANG_DUT)
{
printf("How often should I look for News at the RSS-Feed \"%s\"? (A: every 1 min, B: every 5 min, 1: every 15 min, 2: every 30 min)\n", jobs[i].name);
which = -1;
while (which == -1)
which = 60;
printf("Bezig met maken nieuwe opname en registratie...\n");
//Will now compose url:
memset(jobs[i].final_url, 0, 512);
snprintf(jobs[i].final_url, 511, "http://rss.wii.rc24.xyz/rss_displayer.php?feedurl=%s&title=%s", jobs[i].url, jobs[i].name);
s32 retval = WC24_CreateRecord(&myrec, &myent, (u32)homebrewtitleid, homebrewtitleid, /*0x4842*/0x4645, WC24_TYPE_MSGBOARD, WC24_RECORD_FLAGS_DEFAULT, WC24_FLAGS_HB, which, 0x5a0, 0, jobs[i].final_url, NULL);
if (retval<0)
{
WPAD_ScanPads();
u32 pressed = WPAD_ButtonsDown(0);
if (pressed & WPAD_BUTTON_A) which = 1;
if (pressed & WPAD_BUTTON_B) which = 5;
if (pressed & WPAD_BUTTON_1) which = 15;
if (pressed & WPAD_BUTTON_2) which = 30;
printf("WC24_CreateRecord meldde %d\n", retval);
}
}
else
{
which = 60;
printf("Creating record&entry...\n");
//Will now compose url:
memset(jobs[i].final_url, 0, 512);
Expand Down Expand Up @@ -119,6 +150,63 @@ void AddJobs()
if (retval_save < 0) printf("Fehler beim Speichern: %d\n", retval_save);
}
}
else if (LANG_FRE)
{
printf("Téléchargement de %s...\n", jobs[i].name);

s32 retval = WC24_FindEntry((u32)homebrewtitleid, jobs[i].final_url, &myent, 0);
if (retval < 0)
{
printf("ERREUR FATALE: Entrée introuvable\n");
}
else
{
u32 retval_download = KD_Download(KD_DOWNLOADFLAGS_MANUAL, (u16)retval, 0x0);
if (retval_download < 0) printf("Erreur lors du téléchargement : %d\n", retval_download);

//Save mail, so the mail content won't get overwritten
u32 retval_save = KD_SaveMail();
if (retval_save < 0) printf("Erreur lors de la sauvegarde : %d\n", retval_save);
}
}
else if (LANG_SPA)
{
printf("Descargando %s...\n", jobs[i].name);

s32 retval = WC24_FindEntry((u32)homebrewtitleid, jobs[i].final_url, &myent, 0);
if (retval < 0)
{
printf("ERROR FATAL: No se pudo encontrar la entrada.\n");
}
else
{
u32 retval_download = KD_Download(KD_DOWNLOADFLAGS_MANUAL, (u16)retval, 0x0);
if (retval_download < 0) printf("Error al descargar: %d\n", retval_download);

//Save mail, so the mail content won't get overwritten
u32 retval_save = KD_SaveMail();
if (retval_save < 0) printf("Error al guardar: %d\n", retval_save);
}
}
else if (LANG_DUT)
{
printf("Downloaden %s...\n", jobs[i].name);

s32 retval = WC24_FindEntry((u32)homebrewtitleid, jobs[i].final_url, &myent, 0);
if (retval < 0)
{
printf("KRITIEKE FOUT: Kon registratie niet vinden\n");
}
else
{
u32 retval_download = KD_Download(KD_DOWNLOADFLAGS_MANUAL, (u16)retval, 0x0);
if (retval_download < 0) printf("Fout tijdens het downloaden: %d\n", retval_download);

//Save mail, so the mail content won't get overwritten
u32 retval_save = KD_SaveMail();
if (retval_save < 0) printf("Fout tijdens het opslaan: %d\n", retval_save);
}
}
else
{
printf("Downloading %s...\n", jobs[i].name);
Expand All @@ -142,17 +230,26 @@ void AddJobs()
}

if (LANG_GER) printf("WC24 herunterfahren...\n");
else if (LANG_FRE) printf("Arrêt de WiiConnect24...\n");
else if (LANG_SPA) printf("Apagando WC24...\n");
else if (LANG_DUT) printf("WC24 aan het afsluiten...\n");
else printf("Shutting down WC24...\n");

retval = WC24_Shutdown();
if(retval<0)
{
if (LANG_GER) printf("WC24_Shutdown ergab %d\n", retval);
else if (LANG_FRE) printf("WC24_Shutdown a retourné %d\n", retval);
else if (LANG_SPA) printf("WC24_Shutdown regresó %d\n", retval);
else if (LANG_DUT) printf("WC24_Shutdown meldde %d\n", retval);
else printf("WC24_Shutdown returned %d\n", retval);
return;
}
printf("\n\n");
if (LANG_GER) printf("Fertig.\n");
else if (LANG_FRE) printf("Terminé.\n");
else if (LANG_SPA) printf("Hecho.\n");
else if (LANG_DUT) printf("Klaar.\n");
else printf("Done.\n");
}

Expand Down Expand Up @@ -248,6 +345,9 @@ void end()
void fail(int val)
{
if (LANG_GER) printf("Fehler: %i\nMit HOME zurueck zum Loader.", val);
else if (LANG_FRE) printf("Erreur : %i\nRetournez sur le loader Homebrew en appuyant sur le bouton HOME.", val);
else if (LANG_SPA) printf("Error: %i\nVuelve al cargador usando el botón HOME.", val);
else if (LANG_DUT) printf("Fout: %i\nKeer terug naar de Loader door op de HOME-knop te drukken.", val);
else printf("Error: %i\nGet back to the Loader by pressing the HOME-Button.", val);
while (1)
{
Expand Down Expand Up @@ -299,6 +399,9 @@ int main(int argc, char **argv) {

printf("\x1b[2;0H");
if (LANG_GER) printf("Willkommen bei rssmii!\n\n");
else if (LANG_FRE) printf("Bienvenue sur rssmii !\n\n");
else if (LANG_SPA) printf("Bienvenido a rssmii!\n\n");
else if (LANG_DUT) printf("Welkom bij rssmii!\n\n");
else printf("Welcome to rssmii!\n\n");

int retval = load_feeds();
Expand All @@ -308,13 +411,19 @@ int main(int argc, char **argv) {
}

if(LANG_GER) printf("Die folgenden RSS-Feeds wurden von der SD-Karte gelesen und werden abonniert und alle vorherigen Abonnements werden geloescht:\n");
else if(LANG_FRE) printf("Les flux RSS suivants ont été lus depuis la carte SD et vous allez vous abonnez à ces dernières tandis que les anciens abonnements seront supprimés :\n");
else if(LANG_SPA) printf("Los siguientes RSS-Feeds han sido leidos desde la tarjeta SD y tu serás suscrito a ellos y todas las suscripciones anteriores serán eliminadas:\n");
else if(LANG_DUT) printf("De volgende RSS-feeds zijn afkomstig van jouw SD-kaart en je zal geabboneerd worden op die feeds, terwijl alle vorige abbonementen worden verwijderd:\n");
else printf("The following RSS-Feeds were read from the SD-Card and you will subscribe to them while all previous subscriptions will be deleted:\n");
for (int i = 0; i < ijobs; i++)
{
printf(" %s\n", jobs[i].name);
}

if (LANG_GER) printf("\n\nSind sie sicher? (A: Fortsetzen; HOME: Abbrechen)");
else if (LANG_FRE) printf("\n\nÊtes-vous sûr ? (A: Continuer; HOME: Annuler)");
else if (LANG_SPA) printf("\n\nEstás seguro?: (A: Continuar; HOME: Abortar)");
else if (LANG_DUT) printf("\n\nWeet je het zeker? (A: Verder gaan; HOME: Afsluiten)");
else printf("\n\nAre you sure? (A: Continue; HOME: Abort");

while (1)
Expand All @@ -328,7 +437,10 @@ int main(int argc, char **argv) {

//printf("\n\nDone.");
if (LANG_GER) printf("\nMit HOME zurueck zum Loader.");
else printf("\nGet back to the Loader with the HOME-Button.");
else if (LANG_FRE) printf("\nMit HOME zurueck zum Loader.");
else if (LANG_SPA) printf("\nVuelve al cargador con el botón HOME.");
else if (LANG_DUT) printf("\nGa terug naar jouw loader door op de HOME-knop te drukken.");
else printf("\nRetournez sur le loader Homebrew en appuyant sur le bouton HOME.");

while (1)
{
Expand Down

3 comments on commit 13fea53

@KcrPL
Copy link
Collaborator

@KcrPL KcrPL commented on 13fea53 Oct 7, 2017

Choose a reason for hiding this comment

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

Wow. Are you seriously rewriting it?

@larsenv
Copy link
Author

@larsenv larsenv commented on 13fea53 Oct 7, 2017

Choose a reason for hiding this comment

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

No, it's just language support.

@KcrPL
Copy link
Collaborator

@KcrPL KcrPL commented on 13fea53 Oct 7, 2017

Choose a reason for hiding this comment

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

👌
Hopefully it will be working soon™️

Please sign in to comment.