diff --git a/Makefile b/Makefile index f206a0e..fb9a117 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ SOURCES := src \ src/game \ src/gui \ src/kernel \ + src/language \ src/menu \ src/menu/tv \ src/menu/drc \ diff --git a/data/images/settingButton.png b/data/images/settingButton.png deleted file mode 100644 index ae07542..0000000 Binary files a/data/images/settingButton.png and /dev/null differ diff --git a/data/images/settingSelectedButton.png b/data/images/settingSelectedButton.png deleted file mode 100644 index ae07542..0000000 Binary files a/data/images/settingSelectedButton.png and /dev/null differ diff --git a/data/images/twittergithub.png b/data/images/twittergithub.png deleted file mode 100644 index f7e4fa8..0000000 Binary files a/data/images/twittergithub.png and /dev/null differ diff --git a/languages/english.lang b/languages/english.lang new file mode 100644 index 0000000..21a6bb0 --- /dev/null +++ b/languages/english.lang @@ -0,0 +1,316 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-13 18:55+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/menu/drc/content/ContentController.cpp:29 +#: src/menu/drc/content/ContentController.cpp:29 +msgid "Currently no device is connected." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:33 +#: src/menu/drc/content/ContentController.cpp:33 +msgid "Device connected. You can test it by pressing buttons." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:34 +#: src/menu/drc/content/ContentController.cpp:34 +msgid "Press A to remap to a new controller." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:35 +#: src/menu/drc/content/ContentController.cpp:35 +msgid "Mouse connected. You can test it by pressing buttons." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:36 +#: src/menu/drc/content/ContentController.cpp:36 +msgid "Keyboard connected. You can test it by pressing buttons." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:37 +#: src/menu/drc/content/ContentController.cpp:37 +msgid "Press X to add a Keyboard." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:38 +#: src/menu/drc/content/ContentController.cpp:38 +msgid "Press X to add a Mouse." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:39 +#: src/menu/drc/content/ContentController.cpp:39 +msgid "Keyboard connected." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:40 +#: src/menu/drc/content/ContentController.cpp:40 +msgid "Mouse connected." +msgstr "" + +#: src/menu/drc/content/ContentController.cpp:51 +#: src/menu/drc/content/ContentController.cpp:51 +msgid "Press A to map a controller to " +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:20 src/menu/drc/MenuListDRC.cpp:40 +#: src/menu/drc/content/ContentHelp.cpp:20 src/menu/drc/MenuListDRC.cpp:40 +msgid "Help" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:39 +#: src/menu/drc/content/ContentHelp.cpp:39 +msgid "My controller is not working!" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:46 +#: src/menu/drc/content/ContentHelp.cpp:46 +msgid "Make sure you have a valid config in the folder \"sd:/wiiu/controller\"" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:54 +#: src/menu/drc/content/ContentHelp.cpp:54 +msgid "Where do I get the config files from?" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:61 +#: src/menu/drc/content/ContentHelp.cpp:61 +msgid "You can create them by yourself or download them from " +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:69 +#: src/menu/drc/content/ContentHelp.cpp:69 +msgid "https://github.com/Maschell/controller_patcher_configs" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:76 +#: src/menu/drc/content/ContentHelp.cpp:76 +msgid "I have no idea how create a own config!" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:83 +#: src/menu/drc/content/ContentHelp.cpp:83 +msgid "You're lucky! There a whole wiki about creating them:" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:97 +#: src/menu/drc/content/ContentHelp.cpp:97 +msgid "XYZ is not working!" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:104 +#: src/menu/drc/content/ContentHelp.cpp:104 +msgid "If you find a bug, please open an issue on github" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:111 +#: src/menu/drc/content/ContentHelp.cpp:111 +msgid "Could you add feature XYZ? Please!" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:118 +#: src/menu/drc/content/ContentHelp.cpp:118 +msgid "Maybe.It depends on the request, I can't promise anything." +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:124 +#: src/menu/drc/content/ContentHelp.cpp:124 +msgid "Just open an issue and I'll try to do my best." +msgstr "" + +#: src/menu/drc/content/ContentHome.cpp:22 +#: src/menu/drc/content/ContentHome.cpp:22 +msgid "Welcome to HID to VPAD!" +msgstr "" + +#: src/menu/drc/content/ContentHome.cpp:23 +#: src/menu/drc/content/ContentHome.cpp:23 +msgid "" +"HID to VPAD allows you to use your USB controller on your WiiU. Currently " +"you can emulate the Gamepad or a Pro Controller." +msgstr "" + +#: src/menu/drc/content/ContentHome.cpp:24 +#: src/menu/drc/content/ContentHome.cpp:24 +msgid "" +"Before you use your controller, you may need to provide a valid config. More " +"information and config files can be found in the help section or on gbatemp." +"net (gbatemp.net/threads/424127/)." +msgstr "" + +#: src/menu/drc/content/ContentHome.cpp:25 +#: src/menu/drc/content/ContentHome.cpp:25 +msgid "" +"To map a device, select a controller from the list on the left hand side." +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:20 +#: src/menu/drc/MenuListDRC.cpp:41 +#: src/menu/drc/content/ContentNetworkHelp.cpp:20 +#: src/menu/drc/MenuListDRC.cpp:41 +msgid "Network Client" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:39 +#: src/menu/drc/content/ContentNetworkHelp.cpp:39 +msgid "What is the Network Client?" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:46 +#: src/menu/drc/content/ContentNetworkHelp.cpp:46 +msgid "It allows you to use your controller connected to your Computer with" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:54 +#: src/menu/drc/content/ContentNetworkHelp.cpp:54 +msgid "HID to VPAD. This way for example XInput- and HID-Bluetooth-Devices" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:61 +#: src/menu/drc/content/ContentNetworkHelp.cpp:61 +msgid "can be used. It connects to your console over your local network." +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:68 +#: src/menu/drc/content/ContentNetworkHelp.cpp:68 +msgid "How do I use it?" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:75 +#: src/menu/drc/content/ContentNetworkHelp.cpp:75 +msgid "Enter the IP (upper right corner!) of your console and press connect." +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:82 +#: src/menu/drc/content/ContentNetworkHelp.cpp:82 +msgid "If everything worked correctly, use the controller just like one" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:89 +#: src/menu/drc/content/ContentNetworkHelp.cpp:89 +msgid "connected via USB. You can find a detailed guide here:" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:96 +#: src/menu/drc/content/ContentNetworkHelp.cpp:96 +msgid "http://gbatemp.net/threads/hid-to-vpad.424127/" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:105 +#: src/menu/drc/content/ContentNetworkHelp.cpp:105 +msgid "Is there any input lag?" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:112 +#: src/menu/drc/content/ContentNetworkHelp.cpp:112 +msgid "With a connection via Ethernet, you shouldn't notice any lag." +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:119 +#: src/menu/drc/content/ContentNetworkHelp.cpp:119 +msgid "Wi-Fi may lead to some issues or lag, but it heavily depends on the" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:126 +#: src/menu/drc/content/ContentNetworkHelp.cpp:126 +msgid "" +"quality of your signal. If it's possible, connect everything via Ethernet." +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:133 +#: src/menu/drc/content/ContentNetworkHelp.cpp:133 +msgid "Where can I get it?" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:140 +#: src/menu/drc/content/ContentNetworkHelp.cpp:140 +msgid "It's open source and you can find it here: " +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:147 +#: src/menu/drc/content/ContentNetworkHelp.cpp:147 +msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" +msgstr "" + +#: src/menu/drc/MainWindowContent.cpp:28 src/menu/drc/MainWindowContent.cpp:28 +msgid "Exit to HBL " +msgstr "" + +#: src/menu/drc/MainWindowContent.cpp:31 src/menu/drc/MainWindowContent.cpp:31 +msgid "Apply Patches" +msgstr "" + +#: src/menu/drc/MainWindowDRC.cpp:48 src/menu/drc/MainWindowDRC.cpp:48 +msgid "TCP Server running on: " +msgstr "" + +#: src/menu/drc/MenuElementController.cpp:43 +#: src/menu/drc/MenuElementController.cpp:43 +msgid "Nothing attached" +msgstr "" + +#: src/menu/drc/MenuElementController.cpp:160 +#: src/menu/tv/TVButtonController.cpp:38 +#: src/menu/tv/TVButtonController.cpp:172 +#: src/menu/drc/MenuElementController.cpp:160 +#: src/menu/tv/TVButtonController.cpp:38 +#: src/menu/tv/TVButtonController.cpp:172 +msgid "No device" +msgstr "" + +#: src/menu/drc/MenuElementController.cpp:169 +#: src/menu/tv/TVButtonController.cpp:181 +#: src/menu/drc/MenuElementController.cpp:169 +#: src/menu/tv/TVButtonController.cpp:181 +msgid "Real Pro Controller" +msgstr "" + +#: src/menu/drc/MenuElementController.cpp:171 +#: src/menu/tv/TVButtonController.cpp:183 +#: src/menu/drc/MenuElementController.cpp:171 +#: src/menu/tv/TVButtonController.cpp:183 +msgid "Mouse / Keyboard" +msgstr "" + +#: src/menu/drc/MenuListDRC.cpp:31 src/menu/drc/MenuListDRC.cpp:32 +#: src/menu/drc/MenuListDRC.cpp:31 src/menu/drc/MenuListDRC.cpp:32 +msgid "Home" +msgstr "" + +#: src/menu/drc/MenuListDRC.cpp:39 src/menu/drc/MenuListDRC.cpp:39 +msgid "Other" +msgstr "" + +#: src/menu/drc/MenuListDRC.cpp:42 src/menu/drc/MenuListDRC.cpp:42 +msgid "About" +msgstr "" + +#: src/menu/InputGetterMenu.cpp:34 src/menu/InputGetterMenu.cpp:34 +msgid "Press any button on the USB-Controller you want to use." +msgstr "" + +#: src/menu/InputGetterMenu.cpp:35 src/menu/InputGetterMenu.cpp:35 +msgid "Press B to disable the mapping" +msgstr "" + +#: src/menu/tv/TVControllerBanner.cpp:41 src/menu/tv/TVControllerBanner.cpp:41 +msgid "Press to return to HBL" +msgstr "" + +#: src/menu/tv/TVControllerBanner.cpp:44 src/menu/tv/TVControllerBanner.cpp:44 +msgid "Press to apply patches" +msgstr "" diff --git a/languages/german.lang b/languages/german.lang new file mode 100644 index 0000000..009aed3 --- /dev/null +++ b/languages/german.lang @@ -0,0 +1,255 @@ +# German translations for PACKAGE package. +# Copyright (C) 2017 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-13 18:11+0200\n" +"PO-Revision-Date: 2017-04-13 16:51+0200\n" +"Last-Translator: \n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/menu/drc/content/ContentController.cpp:29 +msgid "Currently no device is connected." +msgstr "Derzeit ist kein Controller verbunden." + +#: src/menu/drc/content/ContentController.cpp:33 +msgid "Device connected. You can test it by pressing buttons." +msgstr "Controller verbunden. Drücke Tasten um ihn zu testen." + +#: src/menu/drc/content/ContentController.cpp:34 +msgid "Press A to remap to a new controller." +msgstr "Drücke A um einen neuen Controller zu setzen." + +#: src/menu/drc/content/ContentController.cpp:35 +msgid "Mouse connected. You can test it by pressing buttons." +msgstr "Maus verbunden. Drücke eine Taste um sie zu testen." + +#: src/menu/drc/content/ContentController.cpp:36 +msgid "Keyboard connected. You can test it by pressing buttons." +msgstr "Tastatur verbunden. Drücke eine Taste um sie zu testen." + +#: src/menu/drc/content/ContentController.cpp:37 +msgid "Press X to add a Keyboard." +msgstr "Drücke X um eine Tastatur hinzufügen." + +#: src/menu/drc/content/ContentController.cpp:38 +msgid "Press X to add a Mouse." +msgstr "Drücke X um eine Maus hinzufügen." + +#: src/menu/drc/content/ContentController.cpp:39 +msgid "Keyboard connected." +msgstr "Tastatur verbunden." + +#: src/menu/drc/content/ContentController.cpp:40 +msgid "Mouse connected." +msgstr "Maus verbunden." + +#: src/menu/drc/content/ContentController.cpp:51 +msgid "Press A to map a controller to " +msgstr "Drücke A um einen Controller festzulegen für " + +#: src/menu/drc/content/ContentHelp.cpp:20 src/menu/drc/MenuListDRC.cpp:40 +msgid "Help" +msgstr "Hilfe" + +#: src/menu/drc/content/ContentHelp.cpp:39 +msgid "My controller is not working!" +msgstr "Mein Controller funktioniert nicht!" + +#: src/menu/drc/content/ContentHelp.cpp:46 +msgid "Make sure you have a valid config in the folder \"sd:/wiiu/controller\"" +msgstr "Sei dir sicher, dass eine gültige Config im Ordner \"sd:/wiiu/controller\" ist" + +#: src/menu/drc/content/ContentHelp.cpp:54 +msgid "Where do I get the config files from?" +msgstr "Wo bekomme ich Configs her?" + +#: src/menu/drc/content/ContentHelp.cpp:61 +msgid "You can create them by yourself or download them from " +msgstr "Du kannst sie selbst erstellen oder hier runterladen:" + +#: src/menu/drc/content/ContentHelp.cpp:69 +msgid "https://github.com/Maschell/controller_patcher_configs" +msgstr "" + +#: src/menu/drc/content/ContentHelp.cpp:76 +msgid "I have no idea how create a own config!" +msgstr "Wie erstelle ich selbst eine?" + +#: src/menu/drc/content/ContentHelp.cpp:83 +msgid "You're lucky! There a whole wiki about creating them:" +msgstr "Du hast Glück! Es gibt ein Wiki mit allen Informationen." + +#: src/menu/drc/content/ContentHelp.cpp:97 +msgid "XYZ is not working!" +msgstr "XYZ funktioniert nicht." + +#: src/menu/drc/content/ContentHelp.cpp:104 +msgid "If you find a bug, please open an issue on github" +msgstr "Wenn du einen Fehler findest, eröffnet bitte ein Issue auf Github" + +#: src/menu/drc/content/ContentHelp.cpp:111 +msgid "Could you add feature XYZ? Please!" +msgstr "Ist Feature XYZ möglick? BITTE!" + +#: src/menu/drc/content/ContentHelp.cpp:118 +msgid "Maybe.It depends on the request, I can't promise anything." +msgstr "Vielleicht. Es kommt drauf an, ich kann nichts versprechen." + +#: src/menu/drc/content/ContentHelp.cpp:124 +msgid "Just open an issue and I'll try to do my best." +msgstr "Eröffne ein Issue und vielleicht kann ich helfen." + +#: src/menu/drc/content/ContentHome.cpp:22 +msgid "Welcome to HID to VPAD!" +msgstr "Willkommen zu HID to VPAD!" + +#: src/menu/drc/content/ContentHome.cpp:23 +msgid "HID to VPAD allows you to use your USB controller on your WiiU. Currently you can emulate the Gamepad or a Pro Controller." +msgstr "HID to VPAD erlaubt es dir deine USB-Controller auf deiner WiiU als Gamepad oder Pro Controller zu nutzen." + +#: src/menu/drc/content/ContentHome.cpp:24 +msgid "Before you use your controller, you may need to provide a valid config. More information and config files can be found in the help section or on gbatemp.net (gbatemp.net/threads/424127/)." +msgstr "Bevor du eigene Controller verwenden kannst, brauchst du möglicherweise eine Config. Informationen findest du unter Hilfe oder auf gbatemp (gbatemp.net/threads/424127/)." + +#: src/menu/drc/content/ContentHome.cpp:25 +msgid "To map a device, select a controller from the list on the left hand side." +msgstr "Wähle links einen Controller aus um fortzufahren." + +#: src/menu/drc/content/ContentNetworkHelp.cpp:20 +#: src/menu/drc/MenuListDRC.cpp:41 +msgid "Network Client" +msgstr "Network Client" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:39 +msgid "What is the Network Client?" +msgstr "Was ist der Netzwerk Client?" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:46 +msgid "It allows you to use your controller connected to your Computer with" +msgstr "Er erlaubt es dir Controller von deinem PC mit deiner WiiU zu " + +#: src/menu/drc/content/ContentNetworkHelp.cpp:54 +msgid "HID to VPAD. This way for example XInput- and HID-Bluetooth-Devices" +msgstr "verbinden. So können XInput- and HID-Bluetooth-Geräte verwendet" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:61 +msgid "can be used. It connects to your console over your local network." +msgstr "werden. Es verbindet sich über dein Lokales Netzwerk." + +#: src/menu/drc/content/ContentNetworkHelp.cpp:68 +msgid "How do I use it?" +msgstr "Wie verwendet ich es?" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:75 +msgid "Enter the IP (upper right corner!) of your console and press connect." +msgstr "Gib die IP deiner Konsole ein und drück auf Connect. Wenn alles" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:82 +msgid "If everything worked correctly, use the controller just like one" +msgstr "geklappt hat, kannst den Controller nun so nutzen als " + +#: src/menu/drc/content/ContentNetworkHelp.cpp:89 +msgid "connected via USB. You can find a detailed guide here:" +msgstr "wäre er per USB verbunden. Weitere hilfe erhälst du hier:" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:96 +msgid "http://gbatemp.net/threads/hid-to-vpad.424127/" +msgstr "" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:105 +msgid "Is there any input lag?" +msgstr "Gibt es Input-Lag?" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:112 +msgid "With a connection via Ethernet, you shouldn't notice any lag." +msgstr "Bei einer Verbindung per Lan-Label sollte es keinen Lag geben." + +#: src/menu/drc/content/ContentNetworkHelp.cpp:119 +msgid "Wi-Fi may lead to some issues or lag, but it heavily depends on the" +msgstr "W-Lan kann unter umständen zu Problemen führen, es kommt aber" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:126 +msgid "quality of your signal. If it's possible, connect everything via Ethernet." +msgstr "auf das Signal an. Wenn möglich, nutze einen Lan-Adapter." + +#: src/menu/drc/content/ContentNetworkHelp.cpp:133 +msgid "Where can I get it?" +msgstr "Wo bekomme ich ihn her?" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:140 +msgid "It's open source and you can find it here: " +msgstr "Es ist Open-Source und kann hier geladen werden:" + +#: src/menu/drc/content/ContentNetworkHelp.cpp:147 +msgid "https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient" +msgstr "" + +#: src/menu/drc/MainWindowContent.cpp:28 +msgid "Exit to HBL " +msgstr "Zurück zum HBL" + +#: src/menu/drc/MainWindowContent.cpp:31 +msgid "Apply Patches" +msgstr "System Menu" + +#: src/menu/drc/MainWindowDRC.cpp:48 +msgid "TCP Server running on: " +msgstr "TCP Server erreichbar:" + +#: src/menu/drc/MenuElementController.cpp:43 +msgid "Nothing attached" +msgstr "Nichts verbunden" + +#: src/menu/drc/MenuElementController.cpp:160 +#: src/menu/tv/TVButtonController.cpp:38 +#: src/menu/tv/TVButtonController.cpp:172 +msgid "No device" +msgstr "Kein Controller" + +#: src/menu/drc/MenuElementController.cpp:169 +#: src/menu/tv/TVButtonController.cpp:181 +msgid "Real Pro Controller" +msgstr "Echter Pro Controller" + +#: src/menu/drc/MenuElementController.cpp:171 +#: src/menu/tv/TVButtonController.cpp:183 +msgid "Mouse / Keyboard" +msgstr "Maus / Tastatur" + +#: src/menu/drc/MenuListDRC.cpp:31 src/menu/drc/MenuListDRC.cpp:32 +msgid "Home" +msgstr "Home" + +#: src/menu/drc/MenuListDRC.cpp:39 +msgid "Other" +msgstr "Sonstiges" + +#: src/menu/drc/MenuListDRC.cpp:42 +msgid "About" +msgstr "About" + +#: src/menu/InputGetterMenu.cpp:34 +msgid "Press any button on the USB-Controller you want to use." +msgstr "Drücke eine Taste auf dem Controller den du nutzen möchstest." + +#: src/menu/InputGetterMenu.cpp:35 +msgid "Press B to disable the mapping" +msgstr "Drücke B um die Verbindung zu trennen" + +#: src/menu/tv/TVControllerBanner.cpp:41 +msgid "Press to return to HBL" +msgstr " zurück zum HBL." + +#: src/menu/tv/TVControllerBanner.cpp:44 +msgid "Press to apply patches" +msgstr "Drücke zum starten." diff --git a/src/Application.cpp b/src/Application.cpp index 96c5965..4027cc3 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -44,6 +44,9 @@ Application::Application() //! create bgMusic bgMusic = new GuiSound(Resources::GetFile("bgMusic.mp3"), Resources::GetFileSize("bgMusic.mp3")); + //std::string languagePath = "sd:/wiiu/apps/hidtovpad/languages/english.lang"; + //gettextLoadLanguage(languagePath.c_str()); + exitApplication = false; } diff --git a/src/controller_patcher b/src/controller_patcher index 42fc97a..8dee7c3 160000 --- a/src/controller_patcher +++ b/src/controller_patcher @@ -1 +1 @@ -Subproject commit 42fc97a37ea624cb2719eba41a00d40e6f5e99ca +Subproject commit 8dee7c3e705ed6a292e1f1ac0e28ff46c5e83376 diff --git a/src/language/gettext.cpp b/src/language/gettext.cpp new file mode 100644 index 0000000..1a70ac0 --- /dev/null +++ b/src/language/gettext.cpp @@ -0,0 +1,283 @@ +/**************************************************************************** + * Copyright (C) 2015 Dimok + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "gettext.h" +#include "fs/CFile.hpp" +#include "utils/StringTools.h" + +typedef struct _MSG +{ + u32 id; + char* msgstr; + struct _MSG *next; +} MSG; +static MSG *baseMSG = 0; + +#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 u32 hash_string(const char *str_param) +{ + u32 hval, g; + const char *str = str_param; + + /* Compute the hash value for the given string. */ + hval = 0; + while (*str != '\0') + { + hval <<= 4; + hval += (u8) *str++; + g = hval & ((u32) 0xf << (HASHWORDBITS - 4)); + if (g != 0) + { + hval ^= g >> (HASHWORDBITS - 8); + hval ^= g; + } + } + return hval; +} + +/* Expand some escape sequences found in the argument string. */ +static char * +expand_escape(const char *str) +{ + char *retval, *rp; + const char *cp = str; + + retval = (char *) malloc(strlen(str) + 1); + if (retval == NULL) return NULL; + rp = retval; + + while (cp[0] != '\0' && cp[0] != '\\') + *rp++ = *cp++; + if (cp[0] == '\0') goto terminate; + do + { + + /* Here cp[0] == '\\'. */ + switch (*++cp) + { + case '\"': /* " */ + *rp++ = '\"'; + ++cp; + break; + case 'a': /* alert */ + *rp++ = '\a'; + ++cp; + break; + case 'b': /* backspace */ + *rp++ = '\b'; + ++cp; + break; + case 'f': /* form feed */ + *rp++ = '\f'; + ++cp; + break; + case 'n': /* new line */ + *rp++ = '\n'; + ++cp; + break; + case 'r': /* carriage return */ + *rp++ = '\r'; + ++cp; + break; + case 't': /* horizontal tab */ + *rp++ = '\t'; + ++cp; + break; + case 'v': /* vertical tab */ + *rp++ = '\v'; + ++cp; + break; + case '\\': + *rp = '\\'; + ++cp; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + { + int ch = *cp++ - '0'; + + if (*cp >= '0' && *cp <= '7') + { + ch *= 8; + ch += *cp++ - '0'; + + if (*cp >= '0' && *cp <= '7') + { + ch *= 8; + ch += *cp++ - '0'; + } + } + *rp = ch; + } + break; + default: + *rp = '\\'; + break; + } + + while (cp[0] != '\0' && cp[0] != '\\') + *rp++ = *cp++; + } while (cp[0] != '\0'); + + /* Terminate string. */ + terminate: *rp = '\0'; + return retval; +} + +static MSG *findMSG(u32 id) +{ + MSG *msg; + for (msg = baseMSG; msg; msg = msg->next) + { + if (msg->id == id) return msg; + } + return NULL; +} + +static MSG *setMSG(const char *msgid, const char *msgstr) +{ + u32 id = hash_string(msgid); + MSG *msg = findMSG(id); + if (!msg) + { + msg = (MSG *) malloc(sizeof(MSG)); + msg->id = id; + msg->msgstr = NULL; + msg->next = baseMSG; + baseMSG = msg; + } + if (msg) + { + if (msgstr) + { + if (msg->msgstr) free(msg->msgstr); + //msg->msgstr = strdup(msgstr); + msg->msgstr = expand_escape(msgstr); + } + return msg; + } + return NULL; +} + +extern "C" void gettextCleanUp(void) +{ + while (baseMSG) + { + MSG *nextMsg = baseMSG->next; + free(baseMSG->msgstr); + free(baseMSG); + baseMSG = nextMsg; + } +} + +extern "C" bool gettextLoadLanguage(const char* langFile) +{ + char *lastID = NULL; + gettextCleanUp(); + + CFile file(langFile, CFile::ReadOnly); + if (!file.isOpen()) + return false; + + std::string strBuffer; + strBuffer.resize(file.size()); + file.read((u8 *) &strBuffer[0], strBuffer.size()); + file.close(); + + //! remove all windows crap signs + size_t position; + while(1) + { + position = strBuffer.find('\r'); + if(position == std::string::npos) + break; + + strBuffer.erase(position, 1); + } + + std::vector lines = stringSplit(strBuffer, "\n"); + + + if(lines.empty()) + return false; + + for(unsigned int i = 0; i < lines.size(); i++) + { + std::string & line = lines[i]; + // lines starting with # are comments + if (line[0] == '#') + continue; + else if (strncmp(line.c_str(), "msgid \"", 7) == 0) + { + char *msgid, *end; + if (lastID) + { + free(lastID); + lastID = NULL; + } + msgid = &line[7]; + end = strrchr(msgid, '"'); + if (end && end - msgid > 1) + { + *end = 0; + lastID = strdup(msgid); + } + } + else if (strncmp(line.c_str(), "msgstr \"", 8) == 0) + { + char *msgstr, *end; + + if (lastID == NULL) continue; + + msgstr = &line[8]; + end = strrchr(msgstr, '"'); + if (end && end - msgstr > 1) + { + *end = 0; + setMSG(lastID, msgstr); + } + free(lastID); + lastID = NULL; + } + + } + return true; +} + +extern "C" const char *gettext(const char *msgid) +{ + if(!msgid) return NULL; + MSG *msg = findMSG(hash_string(msgid)); + if (msg && msg->msgstr) return msg->msgstr; + return msgid; +} + diff --git a/src/language/gettext.h b/src/language/gettext.h new file mode 100644 index 0000000..e1da228 --- /dev/null +++ b/src/language/gettext.h @@ -0,0 +1,39 @@ +/**************************************************************************** + * Copyright (C) 2015 Dimok + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + ****************************************************************************/ +#ifndef _GETTEXT_H_ +#define _GETTEXT_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + + bool gettextLoadLanguage(const char* langFile); + void gettextCleanUp(void); + /* + * input msg = a text in ASCII + * output = the translated msg in utf-8 + */ + const char *gettext(const char *msg); +#define tr(s) gettext(s) +#define trNOOP(s) s + +#ifdef __cplusplus +} +#endif + +#endif /* _GETTEXT_H_ */ diff --git a/src/main.cpp b/src/main.cpp index 05982ed..2b8289a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,8 @@ #include "version.h" #include "common/common.h" +#include "language/gettext.h" + #include "controller_patcher/ControllerPatcher.hpp" #include "utils/function_patcher.h" #include "patcher/hid_controller_function_patcher.hpp" diff --git a/src/menu/InputGetterMenu.cpp b/src/menu/InputGetterMenu.cpp index 82d73fc..8db5263 100644 --- a/src/menu/InputGetterMenu.cpp +++ b/src/menu/InputGetterMenu.cpp @@ -20,6 +20,7 @@ #include "Application.h" #include "gui/GuiElement.h" #include "utils/logger.h" +#include "language/gettext.h" #include "dynamic_libs/padscore_functions.h" CThread * InputGetterMenu::pThread = NULL; @@ -30,8 +31,8 @@ InputGetterMenu::InputGetterMenu(UController_Type controller_type) , backgroundImage(backgroundImageData) , bgBlur(1280, 720, (GX2Color){0, 0, 0, 255}) , infoController("", 70, glm::vec4(0.2f, 0.2f, 0.2f, 1.0f)) - , infoText("Press any button on the USB-Controller you want to use.", 35, glm::vec4(0.3f, 0.3f, 0.3f, 1.0f)) - , infoTextreturn("Press B to disable the mapping", 55, glm::vec4(0.3f, 0.3f, 0.3f, 1.0f)) + , infoText(gettext("Press any button on the USB-Controller you want to use."), 35, glm::vec4(0.3f, 0.3f, 0.3f, 1.0f)) + , infoTextreturn(gettext("Press B to disable the mapping"), 55, glm::vec4(0.3f, 0.3f, 0.3f, 1.0f)) , buttonBTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_B, true) , DPADButtons(0,0) { @@ -42,19 +43,19 @@ InputGetterMenu::InputGetterMenu(UController_Type controller_type) gameLauncherMenuFrame = GuiFrame(width, height); std::string name; if(controller_type == UController_Type_Gamepad){ - name = "GamePad"; + name = UController_Type_Gamepad_Name; }else if(controller_type == UController_Type_Pro1){ WPADDisconnect(0); - name = "Pro Controller 1"; + name = UController_Type_Pro1_Name; }else if(controller_type == UController_Type_Pro2){ WPADDisconnect(1); - name = "Pro Controller 2"; + name = UController_Type_Pro2_Name; }else if(controller_type == UController_Type_Pro3){ WPADDisconnect(2); - name = "Pro Controller 3"; + name = UController_Type_Pro3_Name; }else if(controller_type == UController_Type_Pro4){ WPADDisconnect(3); - name = "Pro Controller 4"; + name = UController_Type_Pro4_Name; } infoController.setText(name.c_str()); diff --git a/src/menu/InputGetterMenu.h b/src/menu/InputGetterMenu.h index ebe5d76..5d2d65b 100644 --- a/src/menu/InputGetterMenu.h +++ b/src/menu/InputGetterMenu.h @@ -20,6 +20,7 @@ #include "controller_patcher/ControllerPatcher.hpp" #include "gui/Gui.h" #include "system/CThread.h" +#include "language/gettext.h" class InputGetterMenu : public GuiFrame, public sigslot::has_slots<> { diff --git a/src/menu/drc/MainWindowContent.cpp b/src/menu/drc/MainWindowContent.cpp index 271307e..bdfc93c 100644 --- a/src/menu/drc/MainWindowContent.cpp +++ b/src/menu/drc/MainWindowContent.cpp @@ -25,10 +25,10 @@ MainWindowContent::MainWindowContent(s32 w, s32 h) , footer_img(footer_imgdata) , homebutton_imgdata(Resources::GetImageData("HomeButtonIcon.png")) , homebutton_img(homebutton_imgdata) - , exitHome("Exit to HBL ") + , exitHome(gettext("Exit to HBL ")) , plusbutton_imgdata(Resources::GetImageData("PlusButtonIcon.png")) , plusbutton_img(plusbutton_imgdata) - , exitPlus("Apply Patches") + , exitPlus(gettext("Apply Patches")) { bgImageColor.setImageColor((GX2Color){ 248, 249, 248, 255 }, 0); bgImageColor.setImageColor((GX2Color){ 248, 249, 248, 255 }, 1); diff --git a/src/menu/drc/MainWindowContent.h b/src/menu/drc/MainWindowContent.h index 27fb948..1ba1526 100644 --- a/src/menu/drc/MainWindowContent.h +++ b/src/menu/drc/MainWindowContent.h @@ -21,6 +21,7 @@ #include "system/AsyncDeleter.h" #include "MainWindowContent.h" #include "content/ContentTemplate.h" +#include "language/gettext.h" class MainWindowContent : public GuiFrame, public sigslot::has_slots<>{ public: diff --git a/src/menu/drc/MainWindowDRC.cpp b/src/menu/drc/MainWindowDRC.cpp index 6db1a51..bf5f615 100644 --- a/src/menu/drc/MainWindowDRC.cpp +++ b/src/menu/drc/MainWindowDRC.cpp @@ -45,8 +45,7 @@ MainWindowDRC::MainWindowDRC(s32 w, s32 h) versionText.setText(fmt("%s - %s",APP_VERION,__DATE__)); versionText.setAlignment(ALIGN_TOP_LEFT); versionText.setPosition(windowSplitter_img.getOffsetX()+5,-25); - - ipAddress.setText(wfmt("TCP Server running on: %u.%u.%u.%u",(hostIpAddress >> 24) & 0xFF, (hostIpAddress >> 16) & 0xFF, (hostIpAddress >> 8) & 0xFF, (hostIpAddress >> 0) & 0xFF)); + ipAddress.setText(wfmt("%s%u.%u.%u.%u",gettext("TCP Server running on: "),(hostIpAddress >> 24) & 0xFF, (hostIpAddress >> 16) & 0xFF, (hostIpAddress >> 8) & 0xFF, (hostIpAddress >> 0) & 0xFF)); ipAddress.setAlignment(ALIGN_TOP_RIGHT); ipAddress.setPosition(-5,-25); append(&windowSplitter_img); diff --git a/src/menu/drc/MainWindowDRC.h b/src/menu/drc/MainWindowDRC.h index 3603b95..49c69c2 100644 --- a/src/menu/drc/MainWindowDRC.h +++ b/src/menu/drc/MainWindowDRC.h @@ -22,6 +22,7 @@ #include "MenuListDRC.h" #include "menu/MainWindow.h" #include "MainWindowContent.h" +#include "language/gettext.h" class MainWindowDRC : public GuiConfigurationScreen, public sigslot::has_slots<>{ public: diff --git a/src/menu/drc/MenuElement.h b/src/menu/drc/MenuElement.h index 89e451f..d70ad52 100644 --- a/src/menu/drc/MenuElement.h +++ b/src/menu/drc/MenuElement.h @@ -19,6 +19,7 @@ #include "gui/GuiButton.h" #include "content/ContentTemplate.h" +#include "language/gettext.h" class MenuElement : public GuiButton { diff --git a/src/menu/drc/MenuElementController.cpp b/src/menu/drc/MenuElementController.cpp index 5de9fb6..565e96a 100644 --- a/src/menu/drc/MenuElementController.cpp +++ b/src/menu/drc/MenuElementController.cpp @@ -40,7 +40,7 @@ MenuElementController::MenuElementController(UController_Type controllertype) ,gamepad_imgdata(Resources::GetImageData("gamepad.png")) ,gamepad_img(gamepad_imgdata) ,controllerlabel("") - ,notAttachedLabel("Nothing attached") + ,notAttachedLabel(gettext("Nothing attached")) ,ledon_imgdata(Resources::GetImageData("ledon.png")) ,ledoff_imgdata(Resources::GetImageData("ledoff.png")) { @@ -157,7 +157,7 @@ void MenuElementController::draw(CVideo *v){ controllerConnected = 0; s32 found = ControllerPatcher::getActiveMappingSlot(getControllerType()); if(found == -1){ - name = "No device"; + name = gettext("No device"); }else{ controllerConnected = 1; @@ -166,9 +166,9 @@ void MenuElementController::draw(CVideo *v){ if(info->type == CM_Type_Controller){ drawControllerName(v,info->vidpid.vid,info->vidpid.pid); }else if(info->type == CM_Type_RealController){ - name = "Real Pro Controller"; + name = gettext("Real Pro Controller"); }else if(info->type == CM_Type_Mouse || info->type == CM_Type_Keyboard){ - name = "Mouse / Keyboard"; + name = gettext("Mouse / Keyboard"); } } } diff --git a/src/menu/drc/MenuElementController.h b/src/menu/drc/MenuElementController.h index cbf5ff6..0c9f4b1 100644 --- a/src/menu/drc/MenuElementController.h +++ b/src/menu/drc/MenuElementController.h @@ -21,6 +21,7 @@ #include "controller_patcher/patcher/ControllerPatcherDefs.h" #include "controller_patcher/utils/CPRetainVars.hpp" #include "utils/StringTools.h" +#include "language/gettext.h" class MenuElementController : public MenuElement{ public: diff --git a/src/menu/drc/MenuElementInfo.h b/src/menu/drc/MenuElementInfo.h index 5b21782..b0e9c01 100644 --- a/src/menu/drc/MenuElementInfo.h +++ b/src/menu/drc/MenuElementInfo.h @@ -19,6 +19,7 @@ #include "MenuElement.h" #include "content/ContentTemplate.h" +#include "language/gettext.h" class MenuElementInfo : public MenuElement{ public: diff --git a/src/menu/drc/MenuListDRC.cpp b/src/menu/drc/MenuListDRC.cpp index a20a94c..d26384a 100644 --- a/src/menu/drc/MenuListDRC.cpp +++ b/src/menu/drc/MenuListDRC.cpp @@ -28,18 +28,18 @@ MenuListDRC::MenuListDRC(s32 w, s32 h,MainWindowContent * _contentWindow) , width(w) , height(h) , bgImageColor(w, h, (GX2Color){ 0, 0, 0, 0 }) - , homeSeperator("Home") - , elementHome( "Home", "homeIcon.png", ContentTemplate::CONTENT_HOME) + , homeSeperator(gettext("Home")) + , elementHome(gettext("Home"), "homeIcon.png", ContentTemplate::CONTENT_HOME) , controllerSeperator("Controller") , elementGamePad(UController_Type_Gamepad) , elementProController1(UController_Type_Pro1) , elementProController2(UController_Type_Pro2) , elementProController3(UController_Type_Pro3) , elementProController4(UController_Type_Pro4) - , otherSeperator("Other") - , elementHelp( "Help", "helpIcon.png", ContentTemplate::CONTENT_HELP) - , elementNetworkHelp( "Network Client", "netbtn.png", ContentTemplate::CONTENT_NETWORK_HELP) - , elementAbout( "About", "aboutIcon.png", ContentTemplate::CONTENT_ABOUT) + , otherSeperator(gettext("Other")) + , elementHelp(gettext("Help"), "helpIcon.png", ContentTemplate::CONTENT_HELP) + , elementNetworkHelp( gettext("Network Client"), "netbtn.png", ContentTemplate::CONTENT_NETWORK_HELP) + , elementAbout(gettext("About"), "aboutIcon.png", ContentTemplate::CONTENT_ABOUT) , buttonUpTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_UP | GuiTrigger::STICK_L_UP, true) , buttonDownTrigger(GuiTrigger::CHANNEL_ALL, GuiTrigger::BUTTON_DOWN | GuiTrigger::STICK_L_DOWN, true) , touchTrigger(GuiTrigger::CHANNEL_1, GuiTrigger::VPAD_TOUCH) diff --git a/src/menu/drc/MenuListDRC.h b/src/menu/drc/MenuListDRC.h index 018824e..4f9e84f 100644 --- a/src/menu/drc/MenuListDRC.h +++ b/src/menu/drc/MenuListDRC.h @@ -24,6 +24,7 @@ #include "MenuElementController.h" #include "MenuElementInfo.h" #include "MenuSeperator.h" +#include "language/gettext.h" class MenuListDRC : public GuiFrame, public sigslot::has_slots<>{ public: diff --git a/src/menu/drc/content/ContentAbout.h b/src/menu/drc/content/ContentAbout.h index e10dec6..6a47e70 100644 --- a/src/menu/drc/content/ContentAbout.h +++ b/src/menu/drc/content/ContentAbout.h @@ -21,6 +21,7 @@ #include "gui/Gui.h" #include "ContentHome.h" #include "ContentTemplate.h" +#include "language/gettext.h" class ContentAbout : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentController.cpp b/src/menu/drc/content/ContentController.cpp index c2c1eb0..c51c86e 100644 --- a/src/menu/drc/content/ContentController.cpp +++ b/src/menu/drc/content/ContentController.cpp @@ -26,29 +26,30 @@ ContentController::ContentController(UController_Type controller_type_): Content , proinput(controller_type_) , connectedFrame(1280-450-2,720) , notConnectedFrame(1280-450-2,720) - , notConnectedLabel("Currently no device is connected.") + , notConnectedLabel(gettext("Currently no device is connected.")) , notConnectedLabel2("") , not_connected_imgdata(Resources::GetImageData("not_connected.png")) , not_connected_img(not_connected_imgdata) - , connectedLabel("Device connected. You can test it by pressing buttons.") - , connectedLabel2("Press A to remap to a new controller.") - , mouseConnectedLabel("Mouse connected. You can test it by pressing buttons.") - , keyboardConnectedLabel("Keyboard connected. You can test it by pressing buttons.") - , mouseConnectedLabel2("Press X to add a Keyboard.") - , keyboardConnectedLabel2("Press X to add a Mouse.") - , mouseConnectedLabel3("Keyboard connected.") - , keyboardConnectedLabel3("Mouse connected.") + , connectedLabel(gettext("Device connected. You can test it by pressing buttons.")) + , connectedLabel2(gettext("Press A to remap to a new controller.")) + , mouseConnectedLabel(gettext("Mouse connected. You can test it by pressing buttons.")) + , keyboardConnectedLabel(gettext("Keyboard connected. You can test it by pressing buttons.")) + , mouseConnectedLabel2(gettext("Press X to add a Keyboard.")) + , keyboardConnectedLabel2(gettext("Press X to add a Mouse.")) + , mouseConnectedLabel3(gettext("Keyboard connected.")) + , keyboardConnectedLabel3(gettext("Mouse connected.")) { std::string text(""); switch(controller_type){ - case UController_Type_Gamepad: {text = "GamePad"; break; } - case UController_Type_Pro1: { text = "Pro Controller 1"; break; } - case UController_Type_Pro2: { text = "Pro Controller 2"; break; } - case UController_Type_Pro3: { text = "Pro Controller 3"; break; } - case UController_Type_Pro4: { text = "Pro Controller 4"; break; } + case UController_Type_Gamepad: {text = UController_Type_Gamepad_Name; break; } + case UController_Type_Pro1: { text = UController_Type_Pro1_Name; break; } + case UController_Type_Pro2: { text = UController_Type_Pro2_Name; break; } + case UController_Type_Pro3: { text = UController_Type_Pro3_Name; break; } + case UController_Type_Pro4: { text = UController_Type_Pro4_Name; break; } default: break; } - notConnectedLabel2.setText(strfmt("Press A to map a controller to \"%s\".",text.c_str()).c_str()); + notConnectedLabel2.setText(strfmt("%s\"%s\".",gettext("Press A to map a controller to "),text.c_str()).c_str()); + notConnectedLabel2.setMaxWidth(800,GuiText::SCROLL_HORIZONTAL); headLine.setText(text.c_str()); headLine.setFontSize(50); diff --git a/src/menu/drc/content/ContentController.h b/src/menu/drc/content/ContentController.h index 1931c9d..52de2e0 100644 --- a/src/menu/drc/content/ContentController.h +++ b/src/menu/drc/content/ContentController.h @@ -23,6 +23,7 @@ #include "menu/drc/MenuElementController.h" #include "menu/InputGetterMenu.h" #include "gui/GuiControllerInputDisplay.h" +#include "language/gettext.h" class ContentController : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentHelp.cpp b/src/menu/drc/content/ContentHelp.cpp index a0708f9..835a4f4 100644 --- a/src/menu/drc/content/ContentHelp.cpp +++ b/src/menu/drc/content/ContentHelp.cpp @@ -17,7 +17,7 @@ #include "ContentHelp.h" ContentHelp::ContentHelp(): ContentTemplate(){ - headLine.setText("Help"); + headLine.setText(gettext("Help")); headLine.setFontSize(60); headLine.setAlignment(ALIGN_TOP_CENTER); headLine.setPosition(0,-110); @@ -36,14 +36,14 @@ ContentHelp::ContentHelp(): ContentTemplate(){ s32 fontSize2 = 24; glm::vec4 textColor = glm::vec4(0.3f,0.3f,0.3f,1.0f); - text = new GuiText("My controller is not working!", fontSize, textColor); + text = new GuiText(gettext("My controller is not working!"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("Make sure you have a valid config in the folder \"sd:/wiiu/controller\"", fontSize2, textColor); + text = new GuiText(gettext("Make sure you have a valid config in the folder \"sd:/wiiu/controller\""), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); @@ -51,14 +51,14 @@ ContentHelp::ContentHelp(): ContentTemplate(){ positionY -= 50; - text = new GuiText("Where do I get the config files from?", fontSize, textColor); + text = new GuiText(gettext("Where do I get the config files from?"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("You can create them by yourself or download them from ", fontSize2, textColor); + text = new GuiText(gettext("You can create them by yourself or download them from "), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); @@ -66,21 +66,21 @@ ContentHelp::ContentHelp(): ContentTemplate(){ positionY -= 25; - text = new GuiText("https://github.com/Maschell/controller_patcher_configs", fontSize2, textColor); + text = new GuiText(gettext("https://github.com/Maschell/controller_patcher_configs"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 50; - text = new GuiText("I have no idea how create a own config!", fontSize, textColor); + text = new GuiText(gettext("I have no idea how create a own config!"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("You're lucky! There a whole wiki about creating them:", fontSize2, textColor); + text = new GuiText(gettext("You're lucky! There a whole wiki about creating them:"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); @@ -94,34 +94,34 @@ ContentHelp::ContentHelp(): ContentTemplate(){ append(text); positionY -= 50; - text = new GuiText("XYZ is not working!", fontSize, textColor); + text = new GuiText(gettext("XYZ is not working!"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("If you find a bug, please open an issue on github", fontSize2, textColor); + text = new GuiText(gettext("If you find a bug, please open an issue on github"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 50; - text = new GuiText("Could you add feature XYZ? Please!", fontSize, textColor); + text = new GuiText(gettext("Could you add feature XYZ? Please!"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("Maybe.It depends on the request, I can't promise anything.", fontSize2, textColor); + text = new GuiText(gettext("Maybe.It depends on the request, I can't promise anything."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 20; - text = new GuiText("Just open an issue and I'll try to do my best.", fontSize2, textColor); + text = new GuiText(gettext("Just open an issue and I'll try to do my best."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); diff --git a/src/menu/drc/content/ContentHelp.h b/src/menu/drc/content/ContentHelp.h index 17624f2..f1b9c0d 100644 --- a/src/menu/drc/content/ContentHelp.h +++ b/src/menu/drc/content/ContentHelp.h @@ -20,6 +20,7 @@ #include "gui/Gui.h" #include "ContentHome.h" #include "ContentTemplate.h" +#include "language/gettext.h" class ContentHelp : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentHome.cpp b/src/menu/drc/content/ContentHome.cpp index d3acbc0..81a21e8 100644 --- a/src/menu/drc/content/ContentHome.cpp +++ b/src/menu/drc/content/ContentHome.cpp @@ -19,10 +19,10 @@ ContentHome::ContentHome():ContentTemplate() , logoImageData(Resources::GetImageData("logo.png")) , logoImage(logoImageData) - , welcomeHeadLineLabel("Welcome to HID to VPAD!") - , welcomeTextLabel("HID to VPAD allows you to use your USB controller on your WiiU. Currently you can emulate the Gamepad or a Pro Controller.") - , welcomeTextLabel2("Before you use your controller, you may need to provide a valid config. More information and config files can be found in the help section or on gbatemp.net (gbatemp.net/threads/424127/).") - , welcomeTextLabel3("To map a device, select a controller from the list on the left hand side.") + , welcomeHeadLineLabel(gettext("Welcome to HID to VPAD!")) + , welcomeTextLabel(gettext("HID to VPAD allows you to use your USB controller on your WiiU. Currently you can emulate the Gamepad or a Pro Controller.")) + , welcomeTextLabel2(gettext("Before you use your controller, you may need to provide a valid config. More information and config files can be found in the help section or on gbatemp.net (gbatemp.net/threads/424127/).")) + , welcomeTextLabel3(gettext("To map a device, select a controller from the list on the left hand side.")) , twitterLogoImageData(Resources::GetImageData("TwitterIcon.png")) , twitterLogoImage(twitterLogoImageData) , githubLogoImageData(Resources::GetImageData("GithubIcon.png")) diff --git a/src/menu/drc/content/ContentHome.h b/src/menu/drc/content/ContentHome.h index 71524bf..8a7f487 100644 --- a/src/menu/drc/content/ContentHome.h +++ b/src/menu/drc/content/ContentHome.h @@ -20,6 +20,7 @@ #include "gui/Gui.h" #include "ContentHome.h" #include "ContentTemplate.h" +#include "language/gettext.h" class ContentHome : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentNetworkHelp.cpp b/src/menu/drc/content/ContentNetworkHelp.cpp index 04f3e80..1998448 100644 --- a/src/menu/drc/content/ContentNetworkHelp.cpp +++ b/src/menu/drc/content/ContentNetworkHelp.cpp @@ -17,7 +17,7 @@ #include "ContentNetworkHelp.h" ContentNetworkHelp::ContentNetworkHelp(): ContentTemplate(){ - headLine.setText("Network Client"); + headLine.setText(gettext("Network Client")); headLine.setFontSize(60); headLine.setAlignment(ALIGN_TOP_CENTER); headLine.setPosition(0,-110); @@ -36,14 +36,14 @@ ContentNetworkHelp::ContentNetworkHelp(): ContentTemplate(){ s32 fontSize2 = 24; glm::vec4 textColor = glm::vec4(0.3f,0.3f,0.3f,1.0f); - text = new GuiText("What is the Network Client?", fontSize, textColor); + text = new GuiText(gettext("What is the Network Client?"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("It allows you to use your controller connected to your Computer with", fontSize2, textColor); + text = new GuiText(gettext("It allows you to use your controller connected to your Computer with"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); @@ -51,49 +51,49 @@ ContentNetworkHelp::ContentNetworkHelp(): ContentTemplate(){ positionY -= 25; - text = new GuiText("HID to VPAD. This way for example XInput- and HID-Bluetooth-Devices", fontSize2, textColor); + text = new GuiText(gettext("HID to VPAD. This way for example XInput- and HID-Bluetooth-Devices"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("can be used. It connects to your console over your local network.", fontSize2, textColor); + text = new GuiText(gettext("can be used. It connects to your console over your local network."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("How do I use it?", fontSize, textColor); + text = new GuiText(gettext("How do I use it?"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("Enter the IP (upper right corner!) of your console and press connect.", fontSize2, textColor); + text = new GuiText(gettext("Enter the IP (upper right corner!) of your console and press connect."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("If everything worked correctly, use the controller just like one", fontSize2, textColor); + text = new GuiText(gettext("If everything worked correctly, use the controller just like one"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("connected via USB. You can find a detailed guide here:", fontSize2, textColor); + text = new GuiText(gettext("connected via USB. You can find a detailed guide here:"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("http://gbatemp.net/threads/hid-to-vpad.424127/", fontSize2, textColor); + text = new GuiText(gettext("http://gbatemp.net/threads/hid-to-vpad.424127/"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); @@ -102,49 +102,49 @@ ContentNetworkHelp::ContentNetworkHelp(): ContentTemplate(){ - text = new GuiText("Is there any input lag?", fontSize, textColor); + text = new GuiText(gettext("Is there any input lag?"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("With a connection via Ethernet, you shouldn't notice any lag.", fontSize2, textColor); + text = new GuiText(gettext("With a connection via Ethernet, you shouldn't notice any lag."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("Wi-Fi may lead to some issues or lag, but it heavily depends on the", fontSize2, textColor); + text = new GuiText(gettext("Wi-Fi may lead to some issues or lag, but it heavily depends on the"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("quality of your signal. If it's possible, connect everything via Ethernet.", fontSize2, textColor); + text = new GuiText(gettext("quality of your signal. If it's possible, connect everything via Ethernet."), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("Where can I get it?", fontSize, textColor); + text = new GuiText(gettext("Where can I get it?"), fontSize, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 35; - text = new GuiText("It's open source and you can find it here: ", fontSize2, textColor); + text = new GuiText(gettext("It's open source and you can find it here: "), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); append(text); positionY -= 25; - text = new GuiText("https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient", fontSize2, textColor); + text = new GuiText(gettext("https://github.com/QuarkTheAwesome/HIDtoVPADNetworkClient"), fontSize2, textColor); text->setPosition(positionX, positionY); text->setAlignment(ALIGN_LEFT | ALIGN_MIDDLE); helpText.push_back(text); diff --git a/src/menu/drc/content/ContentNetworkHelp.h b/src/menu/drc/content/ContentNetworkHelp.h index 588e571..b5e3109 100644 --- a/src/menu/drc/content/ContentNetworkHelp.h +++ b/src/menu/drc/content/ContentNetworkHelp.h @@ -19,6 +19,7 @@ #include "gui/Gui.h" #include "ContentTemplate.h" +#include "language/gettext.h" class ContentNetworkHelp : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentTemplate.h b/src/menu/drc/content/ContentTemplate.h index 3e83848..fa8b1b0 100644 --- a/src/menu/drc/content/ContentTemplate.h +++ b/src/menu/drc/content/ContentTemplate.h @@ -19,8 +19,6 @@ #include "gui/Gui.h" - - class ContentTemplate : public GuiFrame, public sigslot::has_slots<>{ public: diff --git a/src/menu/tv/TVButtonController.cpp b/src/menu/tv/TVButtonController.cpp index 53cd7af..18c380b 100644 --- a/src/menu/tv/TVButtonController.cpp +++ b/src/menu/tv/TVButtonController.cpp @@ -35,7 +35,7 @@ TVButtonController::TVButtonController(UController_Type controllertype) ,gamepad_imgdata(Resources::GetImageData("gamepadBig.png")) ,gamepad_img(gamepad_imgdata) ,controllerlabel("") - ,notAttachedLabel("No device") + ,notAttachedLabel(gettext("No device")) ,ledon_imgdata(Resources::GetImageData("ledon.png")) ,ledoff_imgdata(Resources::GetImageData("ledoff.png")) { @@ -169,7 +169,7 @@ void TVButtonController::draw(CVideo *v){ s32 foundSlot = ControllerPatcher::getActiveMappingSlot(getControllerType()); if(foundSlot == -1){ - name = "No device"; + name = gettext("No device"); }else{ controllerConnected = 1; @@ -178,9 +178,9 @@ void TVButtonController::draw(CVideo *v){ if(info->type == CM_Type_Controller){ drawControllerName(v,info->vidpid.vid,info->vidpid.pid); }else if(info->type == CM_Type_RealController){ - name = "Real Pro Controller"; + name = gettext("Real Pro Controller"); }else if(info->type == CM_Type_Mouse || info->type == CM_Type_Keyboard){ - name = "Mouse / Keyboard"; + name = gettext("Mouse / Keyboard"); } } } diff --git a/src/menu/tv/TVButtonController.h b/src/menu/tv/TVButtonController.h index 0f6786e..d85f467 100644 --- a/src/menu/tv/TVButtonController.h +++ b/src/menu/tv/TVButtonController.h @@ -21,6 +21,7 @@ #include "controller_patcher/utils/CPRetainVars.hpp" #include "utils/StringTools.h" #include "gui/Gui.h" +#include "language/gettext.h" class TVButtonController : public GuiButton{ public: diff --git a/src/menu/tv/TVControllerBanner.cpp b/src/menu/tv/TVControllerBanner.cpp index baeb2a1..3afe331 100644 --- a/src/menu/tv/TVControllerBanner.cpp +++ b/src/menu/tv/TVControllerBanner.cpp @@ -38,10 +38,10 @@ TVControllerBanner::TVControllerBanner(s32 w, s32 h) , gamepad(UController_Type_Gamepad) , homebutton_imgdata(Resources::GetImageData("HomeButtonIcon.png")) , homebutton_img(homebutton_imgdata) - , exitHome("Press to return to HBL") + , exitHome(gettext("Press to return to HBL")) , plusbutton_imgdata(Resources::GetImageData("PlusButtonIcon.png")) , plusbutton_img(plusbutton_imgdata) - , exitPlus("Press to apply patches") + , exitPlus(gettext("Press to apply patches")) , wpadTouchTrigger(GuiTrigger::CHANNEL_2 | GuiTrigger::CHANNEL_3 | GuiTrigger::CHANNEL_4 | GuiTrigger::CHANNEL_5, GuiTrigger::BUTTON_A) { append(&background_img); diff --git a/src/resources/filelist.h b/src/resources/filelist.h index 3d8e73f..faa9b0f 100644 --- a/src/resources/filelist.h +++ b/src/resources/filelist.h @@ -1,7 +1,7 @@ /**************************************************************************** * Loadiine resource files. * This file is generated automatically. - * Includes 98 files. + * Includes 95 files. * * NOTE: * Any manual modification of this file will be overwriten by the generation. @@ -293,21 +293,12 @@ extern const u32 selectorSmall_png_size; extern const u8 seperator_png[]; extern const u32 seperator_png_size; -extern const u8 settingButton_png[]; -extern const u32 settingButton_png_size; - -extern const u8 settingSelectedButton_png[]; -extern const u32 settingSelectedButton_png_size; - extern const u8 TVElementControllerBG_png[]; extern const u32 TVElementControllerBG_png_size; extern const u8 TVElementControllerBGSelected_png[]; extern const u32 TVElementControllerBGSelected_png_size; -extern const u8 twittergithub_png[]; -extern const u32 twittergithub_png_size; - extern const u8 TwitterIcon_png[]; extern const u32 TwitterIcon_png_size; @@ -407,11 +398,8 @@ static RecourceFile RecourceList[] = {"selectorBig.png", selectorBig_png, selectorBig_png_size, NULL, 0}, {"selectorSmall.png", selectorSmall_png, selectorSmall_png_size, NULL, 0}, {"seperator.png", seperator_png, seperator_png_size, NULL, 0}, - {"settingButton.png", settingButton_png, settingButton_png_size, NULL, 0}, - {"settingSelectedButton.png", settingSelectedButton_png, settingSelectedButton_png_size, NULL, 0}, {"TVElementControllerBG.png", TVElementControllerBG_png, TVElementControllerBG_png_size, NULL, 0}, {"TVElementControllerBGSelected.png", TVElementControllerBGSelected_png, TVElementControllerBGSelected_png_size, NULL, 0}, - {"twittergithub.png", twittergithub_png, twittergithub_png_size, NULL, 0}, {"TwitterIcon.png", TwitterIcon_png, TwitterIcon_png_size, NULL, 0}, {"windowSplitter.png", windowSplitter_png, windowSplitter_png_size, NULL, 0}, {NULL, NULL, 0, NULL, 0} diff --git a/updatelang.sh b/updatelang.sh new file mode 100644 index 0000000..4914433 --- /dev/null +++ b/updatelang.sh @@ -0,0 +1,9 @@ +#! /bin/bash +# +find . -iname "*.cpp" | xargs xgettext -o languages/english.lang -j +for fn in `find languages/*.lang`; do + if [ "$fn" != "languages/english.lang" ]; then + msgmerge --output-file=$fn $fn languages/english.lang + fi + +done \ No newline at end of file