diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 3e6106f0a..b0f7b5c9d 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -80,8 +80,21 @@ set(UIS hotkeys.ui main.ui ) +set(LANGS + translation/language_en.ts +) +find_package(Qt5 REQUIRED COMPONENTS LinguistTools ${QT_PREFIX_HINT}) -create_directory_groups(${SRCS} ${HEADERS} ${UIS}) +# Some packages might be in the system include path, qt5_create_translation is poorly written +# and will explicitly list all INCLUDE_DIRECTORIES for translation search which would take hours. +# To avoid this we first clear the list, and then restore it afterwards.. +get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "") +qt5_create_translation(translations ${SRCS} ${HEADERS} ${UIS} ${LANGS}) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${_inc_DIRS}") + +qt5_add_translation(TRANSLATIONS ${LANGS}) +create_directory_groups(${SRCS} ${HEADERS} ${UIS} ${LANGS}) if (Qt5_FOUND) qt5_wrap_ui(UI_HDRS ${UIS}) @@ -90,12 +103,13 @@ else() endif() if (APPLE) + SET_SOURCE_FILES_PROPERTIES("${TRANSLATIONS}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/languages) set(MACOSX_ICON "../../dist/citra.icns") set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - add_executable(citra-qt MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON}) + add_executable(citra-qt MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${TRANSLATIONS} ${MACOSX_ICON}) set_target_properties(citra-qt PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) else() - add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) + add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS} ${TRANSLATIONS}) endif() target_link_libraries(citra-qt core video_core audio_core common input_common) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index a21176c34..007aa9f49 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include +#include #include "citra_qt/configuration/configure_general.h" #include "citra_qt/ui_settings.h" #include "core/core.h" @@ -15,6 +17,21 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); ui->toggle_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); + + // locale stuff + QString m_langPath = QApplication::applicationDirPath(); + m_langPath.append("/languages"); + QDir dir(m_langPath); + QStringList fileNames = dir.entryList(QStringList("*.qm")); + + for (int i = 0; i < fileNames.size(); ++i) { + // get locale extracted by filename + QString locale; + locale = fileNames[i]; // "de.qm" + locale.truncate(locale.lastIndexOf('.')); // "de" + QString lang = locale.right(2); + ui->language_combobox->addItem(lang, locale); + } } ConfigureGeneral::~ConfigureGeneral() {} @@ -29,6 +46,10 @@ void ConfigureGeneral::setConfiguration() { } void ConfigureGeneral::applyConfiguration() { + QString m_langPath = QApplication::applicationDirPath() + "/languages/" + + ui->language_combobox->currentData().toString() + ".qm"; + translator.load(m_langPath); + UISettings::values.gamedir_deepscan = ui->toggle_deepscan->isChecked(); UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); Settings::values.region_value = ui->region_combobox->currentIndex() - 1; diff --git a/src/citra_qt/configuration/configure_general.h b/src/citra_qt/configuration/configure_general.h index 447552d8c..d040c76f7 100644 --- a/src/citra_qt/configuration/configure_general.h +++ b/src/citra_qt/configuration/configure_general.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include namespace Ui { @@ -25,4 +26,5 @@ private: private: std::unique_ptr ui; + QTranslator translator; }; diff --git a/src/citra_qt/configuration/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index c739605a4..fae3fe1cb 100644 --- a/src/citra_qt/configuration/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui @@ -24,6 +24,21 @@ + + + + + + Language: + + + + + + + + + diff --git a/src/citra_qt/translation/language_en.ts b/src/citra_qt/translation/language_en.ts new file mode 100644 index 000000000..197f8a7c0 --- /dev/null +++ b/src/citra_qt/translation/language_en.ts @@ -0,0 +1,1660 @@ + + + + + ARMRegisters + + + ARM Registers + + + + + Register + + + + + Value + + + + + BreakPointModel + + + Pica command loaded + + + + + Pica command processed + + + + + Incoming primitive batch + + + + + Finished primitive batch + + + + + Vertex shader invocation + + + + + Incoming display transfer + + + + + GSP command processed + + + + + Buffers swapped + + + + + CallStack + + + Call Stack + + + + + ConfigureAudio + + + Audio + + + + + Output Engine: + + + + + Enable audio stretching + + + + + This post-processing effect adjusts audio speed to match emulation speed and helps prevent audio stutter. This however increases audio latency. + + + + + Audio Device: + + + + + ConfigureDebug + + + Form + + + + + GDB + + + + + Enable GDB Stub + + + + + Port: + + + + + ConfigureDialog + + + Citra Configuration + + + + + General + + + + + System + + + + + Input + + + + + Graphics + + + + + Audio + + + + + Debug + + + + + ConfigureGeneral + + + Form + + + + + General + + + + + Language: + + + + + Search sub-directories for games + + + + + Confirm exit while emulation is running + + + + + Performance + + + + + Enable CPU JIT + + + + + Emulation + + + + + Region: + + + + + Auto-select + + + + + Hotkeys + + + + + ConfigureGraphics + + + Form + + + + + Graphics + + + + + Enable hardware renderer + + + + + Enable shader JIT + + + + + Enable V-Sync + + + + + Limit framerate + + + + + Internal Resolution: + + + + + Layout + + + + + Screen Layout: + + + + + Swap Screens + + + + + ConfigureInput + + + ConfigureInput + + + + + Face Buttons + + + + + A: + + + + + B: + + + + + X: + + + + + Y: + + + + + Directional Pad + + + + + + + Up: + + + + + + + Down: + + + + + + + Left: + + + + + + + Right: + + + + + Shoulder Buttons + + + + + L: + + + + + R: + + + + + ZL: + + + + + ZR: + + + + + Circle Pad + + + + + C-Stick + + + + + Misc. + + + + + Start: + + + + + Select: + + + + + Home: + + + + + Circle Mod: + + + + + Restore Defaults + + + + + [non-keyboard] + + + + + [press key] + + + + + ConfigureSystem + + + Form + + + + + System Settings + + + + + Username + + + + + Birthday + + + + + January + + + + + February + + + + + March + + + + + April + + + + + May + + + + + June + + + + + July + + + + + August + + + + + September + + + + + October + + + + + November + + + + + December + + + + + Language + + + + + Note: this can be overridden when region setting is auto-select + + + + + Japanese (日本語) + + + + + English + + + + + French (français) + + + + + German (Deutsch) + + + + + Italian (italiano) + + + + + Spanish (español) + + + + + Simplified Chinese (简体中文) + + + + + Korean (한국어) + + + + + Dutch (Nederlands) + + + + + Portuguese (português) + + + + + Russian (Русский) + + + + + Traditional Chinese (正體中文) + + + + + Sound output mode + + + + + Mono + + + + + Stereo + + + + + Surround + + + + + System settings are available only when game is not running. + + + + + Failed to load system settings data. + + + + + DockWidget + + + Disassembly + + + + + Step + + + + + Pause + + + + + Continue + + + + + Step Into + + + + + Set Breakpoint + + + + + GMainWindow + + + Current emulation speed. Values higher or lower than 100% indicate emulation is running faster or slower than a 3DS. + + + + + How many frames per second the game is currently displaying. This will vary from game to game and scene to scene. + + + + + Time taken to emulate a 3DS frame, not counting framelimiting or v-sync. For full-speed emulation this should be at most 16.67 ms. + + + + + Error while starting Citra! + + + + + Failed to initialize the video core! + +Please ensure that your GPU supports OpenGL 3.3 and that you have the latest graphics driver. + + + + + + + + + Error while loading ROM! + + + + + + The ROM format is not supported. + + + + + Could not determine the system mode. + + + + + The game that you are trying to load must be decrypted before being used with Citra.<br/><br/>For more information on dumping and decrypting games, please see: <a href='https://citra-emu.org/wiki/Dumping-Game-Cartridges'>https://citra-emu.org/wiki/Dumping-Game-Cartridges</a> + + + + + Unknown error! + + + + + Start + + + + + Error Opening Save Folder + + + + + Folder does not exist! + + + + + 3DS Executable + + + + + All Files (*.*) + + + + + Load File + + + + + Load Symbol Map + + + + + Symbol Map (*.*) + + + + + Select Directory + + + + + File not found + + + + + File "%1" not found + + + + + Continue + + + + + Speed: %1% + + + + + Game: %1 FPS + + + + + Frame: %1 ms + + + + + + Citra + + + + + Are you sure you want to close Citra? + + + + + Are you sure you want to stop the emulation? Any unsaved progress will be lost. + + + + + GPUCommandListModel + + + Command Name + + + + + Register + + + + + Mask + + + + + New Value + + + + + GPUCommandListWidget + + + Pica Command List + + + + + + Start Tracing + + + + + Copy All + + + + + Finish Tracing + + + + + GPUCommandStreamWidget + + + Graphics Debugger + + + + + GameList + + + Open Save Data Location + + + + + GraphicsBreakPointsWidget + + + Pica Breakpoints + + + + + + Emulation running + + + + + Resume + + + + + Emulation halted at breakpoint + + + + + GraphicsSurfaceWidget + + + Pica Surface Viewer + + + + + Color Buffer + + + + + Depth Buffer + + + + + Stencil Buffer + + + + + Texture 0 + + + + + Texture 1 + + + + + Texture 2 + + + + + Custom + + + + + RGBA8 + + + + + RGB8 + + + + + RGB5A1 + + + + + RGB565 + + + + + RGBA4 + + + + + IA8 + + + + + RG8 + + + + + I8 + + + + + A8 + + + + + IA4 + + + + + I4 + + + + + A4 + + + + + ETC1 + + + + + ETC1A4 + + + + + D16 + + + + + D24 + + + + + D24X8 + + + + + X24S8 + + + + + Unknown + + + + + Save + + + + + Source: + + + + + Physical Address: + + + + + Width: + + + + + Height: + + + + + Format: + + + + + X: + + + + + Y: + + + + + Pixel out of bounds + + + + + (unable to access pixel data) + + + + + (invalid surface address) + + + + + (unknown surface format) + + + + + Portable Network Graphic (*.png) + + + + + Binary data (*.bin) + + + + + Save Surface + + + + + GraphicsTracingWidget + + + CiTrace Recorder + + + + + Start Recording + + + + + Stop and Save + + + + + Abort Recording + + + + + Save CiTrace + + + + + CiTrace File (*.ctf) + + + + + CiTracing still active + + + + + A CiTrace is still being recorded. Do you want to save it? If not, all recorded data will be discarded. + + + + + GraphicsVertexShaderModel + + + Offset + + + + + Raw + + + + + Disassembly + + + + + GraphicsVertexShaderWidget + + + Save Shader Dump + + + + + Shader Binary (*.shbin) + + + + + (data only available at vertex shader invocation breakpoints) + + + + + Dump + + + + + Input Data + + + + + Attribute %1 + + + + + Cycle Index: + + + + + SRC1: %1, %2, %3, %4 + + + + + + SRC2: %1, %2, %3, %4 + + + + + + SRC3: %1, %2, %3, %4 + + + + + + DEST_IN: %1, %2, %3, %4 + + + + + + DEST_OUT: %1, %2, %3, %4 + + + + + + Address Registers: %1, %2 + + + + + + Compare Result: %1, %2 + + + + + + Static Condition: %1 + + + + + + Dynamic Conditions: %1, %2 + + + + + + Loop Parameters: %1 (repeats), %2 (initializer), %3 (increment), %4 + + + + + + Instruction offset: 0x%1 + + + + + -> 0x%2 + + + + + (last instruction) + + + + + MainWindow + + + Citra + + + + + &File + + + + + Recent Files + + + + + &Emulation + + + + + &View + + + + + Debugging + + + + + &Help + + + + + Load File... + + + + + Load Symbol Map... + + + + + E&xit + + + + + &Start + + + + + &Pause + + + + + &Stop + + + + + About Citra + + + + + Single Window Mode + + + + + Configure... + + + + + Display Dock Widget Headers + + + + + Show Status Bar + + + + + Select Game Directory... + + + + + Selects a folder to display in the game list + + + + + Create Pica Surface Viewer + + + + + MicroProfileDialog + + + MicroProfile + + + + + QObject + + + Shift + + + + + Ctrl + + + + + Alt + + + + + RegistersWidget + + + Registers + + + + + VFP Registers + + + + + VFP System Registers + + + + + Vector Length + + + + + Vector Stride + + + + + Rounding Mode + + + + + Vector Iteration Count + + + + + WaitTreeEvent + + + reset type = %1 + + + + + WaitTreeMutex + + + locked %1 times by thread: + + + + + free + + + + + WaitTreeMutexList + + + holding mutexes + + + + + WaitTreeObjectList + + + waiting for all objects + + + + + waiting for one of the following objects + + + + + WaitTreeSemaphore + + + available count = %1 + + + + + max count = %1 + + + + + WaitTreeThread + + + running + + + + + ready + + + + + waiting for address 0x%1 + + + + + sleeping + + + + + waiting for objects + + + + + dormant + + + + + dead + + + + + PC = 0x%1 LR = 0x%2 + + + + + default + + + + + all + + + + + AppCore + + + + + SysCore + + + + + Unknown processor %1 + + + + + processor = %1 + + + + + thread id = %1 + + + + + priority = %1(current) / %2(normal) + + + + + last running ticks = %1 + + + + + not holding mutex + + + + + WaitTreeThreadList + + + waited by thread + + + + + WaitTreeTimer + + + reset type = %1 + + + + + initial delay = %1 + + + + + interval delay = %1 + + + + + WaitTreeWaitObject + + + [%1]%2 %3 + + + + + waited by no thread + + + + + one shot + + + + + sticky + + + + + pulse + + + + + WaitTreeWidget + + + Wait Tree + + + + + hotkeys + + + Hotkey Settings + + + + + Action + + + + + Hotkey + + + + + Context + + + +