diff --git a/languages/english.lang b/languages/english.lang index 8e4a5f1..3b63034 100644 --- a/languages/english.lang +++ b/languages/english.lang @@ -1,16 +1,19 @@ -msgid "\\ue000 Confirm - \\ue001 Cancel" +msgid "Press \\ue044 to exit." msgstr "" -msgid "\\ue000 Yes - \\ue001 No" +msgid "\\ue000: Copy \\ue001: Back" msgstr "" -msgid "\\ue000: Select Task \\ue001: Back" +msgid "\\ue000: Export \\ue001: Back" msgstr "" -msgid "\\ue000: Select Game \\ue001: Back" +msgid "\\ue000: Import \\ue001: Back" msgstr "" -msgid "\\ue000: Backup \\ue001: Back" +msgid "\\ue000: Wipe \\ue001: Back" +msgstr "" + +msgid "\\ue000: Restore \\ue001: Back" msgstr "" msgid "" @@ -23,22 +26,19 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "\\ue000: Restore \\ue001: Back" -msgstr "" - -msgid "\\ue000: Wipe \\ue001: Back" +msgid "\\ue000: Backup \\ue001: Back" msgstr "" -msgid "\\ue000: Import \\ue001: Back" +msgid "\\ue000: Select Game \\ue001: Back" msgstr "" -msgid "\\ue000: Export \\ue001: Back" +msgid "\\ue000: Select Task \\ue001: Back" msgstr "" -msgid "\\ue000: Copy \\ue001: Back" +msgid "\\ue000 Yes - \\ue001 No" msgstr "" -msgid "Press \\ue044 to exit." +msgid "\\ue000 Confirm - \\ue001 Cancel" msgstr "" #: src/main.cpp:63 diff --git a/languages/spanish.lang b/languages/spanish.lang index a0eedca..b4fa533 100644 --- a/languages/spanish.lang +++ b/languages/spanish.lang @@ -1,17 +1,20 @@ -msgid "\\ue000 Confirm - \\ue001 Cancel" -msgstr "\\ue000 Confirmar - \\ue001 Cancelar" +msgid "Press \\ue044 to exit." +msgstr "Presiona \\ue044 para salir." -msgid "\\ue000 Yes - \\ue001 No" -msgstr "\\ue000 Sí - \\ue001 No" +msgid "\\ue000: Copy \\ue001: Back" +msgstr "\\ue000: Copiar \\ue001: Atrás" -msgid "\\ue000: Select Task \\ue001: Back" -msgstr "\\ue000: Seleccionar Tarea \\ue001: Atrás" +msgid "\\ue000: Export \\ue001: Back" +msgstr "\\ue000: Exportar \\ue001: Atrás" -msgid "\\ue000: Select Game \\ue001: Back" -msgstr "\\ue000: Seleccionar Juego \\ue001: Atrás" +msgid "\\ue000: Import \\ue001: Back" +msgstr "\\ue000: Importar \\ue001: Atrás" -msgid "\\ue000: Backup \\ue001: Back" -msgstr "\\ue000: Copiar \\ue001: Atrás" +msgid "\\ue000: Wipe \\ue001: Back" +msgstr "\\ue000: Borrar \\ue001: Atrás" + +msgid "\\ue000: Restore \\ue001: Back" +msgstr "\\ue000: Restaurar \\ue001: Atrás" msgid "" msgstr "" @@ -23,23 +26,20 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "\\ue000: Restore \\ue001: Back" -msgstr "\\ue000: Restaurar \\ue001: Atrás" - -msgid "\\ue000: Wipe \\ue001: Back" -msgstr "\\ue000: Borrar \\ue001: Atrás" +msgid "\\ue000: Backup \\ue001: Back" +msgstr "\\ue000: Copiar \\ue001: Atrás" -msgid "\\ue000: Import \\ue001: Back" -msgstr "\\ue000: Importar \\ue001: Atrás" +msgid "\\ue000: Select Game \\ue001: Back" +msgstr "\\ue000: Seleccionar Juego \\ue001: Atrás" -msgid "\\ue000: Export \\ue001: Back" -msgstr "\\ue000: Exportar \\ue001: Atrás" +msgid "\\ue000: Select Task \\ue001: Back" +msgstr "\\ue000: Seleccionar Tarea \\ue001: Atrás" -msgid "\\ue000: Copy \\ue001: Back" -msgstr "\\ue000: Copiar \\ue001: Atrás" +msgid "\\ue000 Yes - \\ue001 No" +msgstr "\\ue000 Sí - \\ue001 No" -msgid "Press \\ue044 to exit." -msgstr "Presiona \\ue044 para salir." +msgid "\\ue000 Confirm - \\ue001 Cancel" +msgstr "\\ue000 Confirmar - \\ue001 Cancelar" #: src/main.cpp:63 msgid "Disclaimer:" diff --git a/src/language/gettext.cpp b/src/language/gettext.cpp index 223813a..a8dbf8c 100644 --- a/src/language/gettext.cpp +++ b/src/language/gettext.cpp @@ -43,27 +43,17 @@ typedef struct _MSG { } MSG; static MSG *baseMSG = NULL; -#define HASHWORDBITS 32 - -/* Defines the so called `hashpjw' function by P.J. Weinberger - [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, - 1986, 1987 Bell Telephone Laboratories, Inc.] */ -static inline uint32_t hash_string(const char *str_param) { - uint32_t hval, g; - const char *str = str_param; - - /* Compute the hash value for the given string. */ - hval = 0; - while (*str != '\0') { - hval <<= 4; - hval += (uint8_t) *str++; - g = hval & ((uint32_t) 0xf << (HASHWORDBITS - 4)); - if (g != 0) { - hval ^= g >> (HASHWORDBITS - 8); - hval ^= g; - } - } - return hval; +#define HASHMULTIPLIER 31 // or 37 + +// Hashing function from https://stackoverflow.com/a/2351171 +static inline uint32_t hash_string(const char *str) { + unsigned int h; + unsigned char *p; + + h = 0; + for (p = (unsigned char*)str; *p != '\0'; p++) + h = HASHMULTIPLIER * h + *p; + return h; } /* Expand some escape sequences found in the argument string. */ diff --git a/src/main.cpp b/src/main.cpp index 825f011..c5d1351 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1048,6 +1048,7 @@ int main() { free(versionList); deinitFS(); + gettextCleanUp(); OSScreenShutdown(); WHBLogFreetypeFree();