From f2f06aa958575d4c4f482e32564c4bfed4c61490 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 8 Jan 2022 16:39:51 +0600 Subject: [PATCH] Add runtime language switching --- src/qt/languages/en-US.po | 1170 +++++++++++++++++++++++++++++++++ src/qt/qt_main.cpp | 41 +- src/qt/qt_platform.cpp | 49 +- src/qt/qt_progsettings.cpp | 69 ++ src/qt/qt_progsettings.hpp | 32 + src/qt/qt_progsettings.ui | 41 ++ src/qt/qt_settingsmachine.cpp | 2 +- src/qt/qt_translations.qrc | 1 + 8 files changed, 1359 insertions(+), 46 deletions(-) create mode 100644 src/qt/languages/en-US.po diff --git a/src/qt/languages/en-US.po b/src/qt/languages/en-US.po new file mode 100644 index 000000000..3e3abdcbb --- /dev/null +++ b/src/qt/languages/en-US.po @@ -0,0 +1,1170 @@ +msgid "Translated by" +msgstr "Unknown" + +msgid "&Action" +msgstr "&Action" + +msgid "&Keyboard requires capture" +msgstr "&Keyboard requires capture" + +msgid "&Right CTRL is left ALT" +msgstr "&Right CTRL is left ALT" + +msgid "&Hard Reset..." +msgstr "&Hard Reset..." + +msgid "&Ctrl+Alt+Del\tCtrl+F12" +msgstr "&Ctrl+Alt+Del\tCtrl+F12" + +msgid "Ctrl+Alt+&Esc" +msgstr "Ctrl+Alt+&Esc" + +msgid "&Pause" +msgstr "&Pause" + +msgid "E&xit..." +msgstr "E&xit..." + +msgid "&View" +msgstr "&View" + +msgid "&Hide status bar" +msgstr "&Hide status bar" + +msgid "&Resizeable window" +msgstr "&Resizeable window" + +msgid "R&emember size && position" +msgstr "R&emember size && position" + +msgid "Re&nderer" +msgstr "Re&nderer" + +msgid "&SDL (Software)" +msgstr "&SDL (Software)" + +msgid "SDL (&Hardware)" +msgstr "SDL (&Hardware)" + +msgid "SDL (&OpenGL)" +msgstr "SDL (&OpenGL)" + +msgid "Open&GL (3.0 Core)" +msgstr "Open&GL (3.0 Core)" + +msgid "&VNC" +msgstr "&VNC" + +msgid "Specify dimensions..." +msgstr "Specify dimensions..." + +msgid "F&orce 4:3 display ratio" +msgstr "F&orce 4:3 display ratio" + +msgid "&Window scale factor" +msgstr "&Window scale factor" + +msgid "&0.5x" +msgstr "&0.5x" + +msgid "&1x" +msgstr "&1x" + +msgid "1.&5x" +msgstr "1.&5x" + +msgid "&2x" +msgstr "&2x" + +msgid "Filter method" +msgstr "Filter method" + +msgid "&Nearest" +msgstr "&Nearest" + +msgid "&Linear" +msgstr "&Linear" + +msgid "Hi&DPI scaling" +msgstr "Hi&DPI scaling" + +msgid "&Fullscreen\tCtrl+Alt+PageUP" +msgstr "&Fullscreen\tCtrl+Alt+PageUP" + +msgid "Fullscreen &stretch mode" +msgstr "Fullscreen &stretch mode" + +msgid "&Full screen stretch" +msgstr "&Full screen stretch" + +msgid "&4:3" +msgstr "&4:3" + +msgid "&Square pixels (Keep ratio)" +msgstr "&Square pixels (Keep ratio)" + +msgid "&Integer scale" +msgstr "&Integer scale" + +msgid "E&GA/(S)VGA settings" +msgstr "E&GA/(S)VGA settings" + +msgid "&Inverted VGA monitor" +msgstr "&Inverted VGA monitor" + +msgid "VGA screen &type" +msgstr "VGA screen &type" + +msgid "RGB &Color" +msgstr "RGB &Color" + +msgid "&RGB Grayscale" +msgstr "&RGB Grayscale" + +msgid "&Amber monitor" +msgstr "&Amber monitor" + +msgid "&Green monitor" +msgstr "&Green monitor" + +msgid "&White monitor" +msgstr "&White monitor" + +msgid "Grayscale &conversion type" +msgstr "Grayscale &conversion type" + +msgid "BT&601 (NTSC/PAL)" +msgstr "BT&601 (NTSC/PAL)" + +msgid "BT&709 (HDTV)" +msgstr "BT&709 (HDTV)" + +msgid "&Average" +msgstr "&Average" + +msgid "CGA/PCjr/Tandy/E&GA/(S)VGA overscan" +msgstr "CGA/PCjr/Tandy/E&GA/(S)VGA overscan" + +msgid "Change contrast for &monochrome display" +msgstr "Change contrast for &monochrome display" + +msgid "&Media" +msgstr "&Media" + +msgid "&Tools" +msgstr "&Tools" + +msgid "&Settings..." +msgstr "&Settings..." + +msgid "&Update status bar icons" +msgstr "&Update status bar icons" + +msgid "Take s&creenshot\tCtrl+F11" +msgstr "Take s&creenshot\tCtrl+F11" + +msgid "&Preferences..." +msgstr "&Preferences..." + +msgid "Enable &Discord integration" +msgstr "Enable &Discord integration" + +msgid "Sound &gain..." +msgstr "Sound &gain..." + +msgid "Begin trace\tCtrl+T" +msgstr "Begin trace\tCtrl+T" + +msgid "End trace\tCtrl+T" +msgstr "End trace\tCtrl+T" + +msgid "&Logging" +msgstr "&Logging" + +msgid "Enable BusLogic logs\tCtrl+F4" +msgstr "Enable BusLogic logs\tCtrl+F4" + +msgid "Enable CD-ROM logs\tCtrl+F5" +msgstr "Enable CD-ROM logs\tCtrl+F5" + +msgid "Enable floppy (86F) logs\tCtrl+F6" +msgstr "Enable floppy (86F) logs\tCtrl+F6" + +msgid "Enable floppy controller logs\tCtrl+F7" +msgstr "Enable floppy controller logs\tCtrl+F7" + +msgid "Enable IDE logs\tCtrl+F8" +msgstr "Enable IDE logs\tCtrl+F8" + +msgid "Enable Serial Port logs\tCtrl+F3" +msgstr "Enable Serial Port logs\tCtrl+F3" + +msgid "Enable Network logs\tCtrl+F9" +msgstr "Enable Network logs\tCtrl+F9" + +msgid "&Log breakpoint\tCtrl+F10" +msgstr "&Log breakpoint\tCtrl+F10" + +msgid "Dump &video RAM\tCtrl+F1" +msgstr "Dump &video RAM\tCtrl+F1" + +msgid "&Help" +msgstr "&Help" + +msgid "&Documentation..." +msgstr "&Documentation..." + +msgid "&About 86Box..." +msgstr "&About 86Box..." + +msgid "&New image..." +msgstr "&New image..." + +msgid "&Existing image..." +msgstr "&Existing image..." + +msgid "Existing image (&Write-protected)..." +msgstr "Existing image (&Write-protected)..." + +msgid "&Record" +msgstr "&Record" + +msgid "&Play" +msgstr "&Play" + +msgid "&Rewind to the beginning" +msgstr "&Rewind to the beginning" + +msgid "&Fast forward to the end" +msgstr "&Fast forward to the end" + +msgid "E&ject" +msgstr "E&ject" + +msgid "&Image..." +msgstr "&Image..." + +msgid "E&xport to 86F..." +msgstr "E&xport to 86F..." + +msgid "&Mute" +msgstr "&Mute" + +msgid "E&mpty" +msgstr "E&mpty" + +msgid "&Reload previous image" +msgstr "&Reload previous image" + +msgid "&Image" +msgstr "&Image" + +msgid "Target &framerate" +msgstr "Target &framerate" + +msgid "&Sync with video" +msgstr "&Sync with video" + +msgid "&25 fps" +msgstr "&25 fps" + +msgid "&30 fps" +msgstr "&30 fps" + +msgid "&50 fps" +msgstr "&50 fps" + +msgid "&60 fps" +msgstr "&60 fps" + +msgid "&75 fps" +msgstr "&75 fps" + +msgid "&VSync" +msgstr "&VSync" + +msgid "&Select shader..." +msgstr "&Select shader..." + +msgid "&Remove shader" +msgstr "&Remove shader" + +msgid "Preferences" +msgstr "Preferences" + +msgid "Sound Gain" +msgstr "Sound Gain" + +msgid "New Image" +msgstr "New Image" + +msgid "Settings" +msgstr "Settings" + +msgid "Specify Main Window Dimensions" +msgstr "Specify Main Window Dimensions" + +msgid "OK" +msgstr "OK" + +msgid "Cancel" +msgstr "Cancel" + +msgid "Save these settings as &global defaults" +msgstr "Save these settings as &global defaults" + +msgid "&Default" +msgstr "&Default" + +msgid "Language:" +msgstr "Language:" + +msgid "Icon set:" +msgstr "Icon set:" + +msgid "Gain" +msgstr "Gain" + +msgid "File name:" +msgstr "File name:" + +msgid "Disk size:" +msgstr "Disk size:" + +msgid "RPM mode:" +msgstr "RPM mode:" + +msgid "Progress:" +msgstr "Progress:" + +msgid "Width:" +msgstr "Width:" + +msgid "Height:" +msgstr "Height:" + +msgid "Lock to this size" +msgstr "Lock to this size" + +msgid "Machine type:" +msgstr "Machine type:" + +msgid "Machine:" +msgstr "Machine:" + +msgid "Configure" +msgstr "Configure" + +msgid "CPU type:" +msgstr "CPU type:" + +msgid "Speed:" +msgstr "Speed:" + +msgid "FPU:" +msgstr "FPU:" + +msgid "Wait states:" +msgstr "Wait states:" + +msgid "MB" +msgstr "MB" + +msgid "Memory:" +msgstr "Memory:" + +msgid "Time synchronization" +msgstr "Time synchronization" + +msgid "Disabled" +msgstr "Disabled" + +msgid "Enabled (local time)" +msgstr "Enabled (local time)" + +msgid "Enabled (UTC)" +msgstr "Enabled (UTC)" + +msgid "Dynamic Recompiler" +msgstr "Dynamic Recompiler" + +msgid "Video:" +msgstr "Video:" + +msgid "Voodoo Graphics" +msgstr "Voodoo Graphics" + +msgid "Mouse:" +msgstr "Mouse:" + +msgid "Joystick:" +msgstr "Joystick:" + +msgid "Joystick 1..." +msgstr "Joystick 1..." + +msgid "Joystick 2..." +msgstr "Joystick 2..." + +msgid "Joystick 3..." +msgstr "Joystick 3..." + +msgid "Joystick 4..." +msgstr "Joystick 4..." + +msgid "Sound card:" +msgstr "Sound card:" + +msgid "MIDI Out Device:" +msgstr "MIDI Out Device:" + +msgid "MIDI In Device:" +msgstr "MIDI In Device:" + +msgid "Standalone MPU-401" +msgstr "Standalone MPU-401" + +msgid "Innovation SSI-2001" +msgstr "Innovation SSI-2001" + +msgid "CMS / Game Blaster" +msgstr "CMS / Game Blaster" + +msgid "Gravis Ultrasound" +msgstr "Gravis Ultrasound" + +msgid "Use FLOAT32 sound" +msgstr "Use FLOAT32 sound" + +msgid "Network type:" +msgstr "Network type:" + +msgid "PCap device:" +msgstr "PCap device:" + +msgid "Network adapter:" +msgstr "Network adapter:" + +msgid "LPT1 Device:" +msgstr "LPT1 Device:" + +msgid "LPT2 Device:" +msgstr "LPT2 Device:" + +msgid "LPT3 Device:" +msgstr "LPT3 Device:" + +msgid "Serial port 1" +msgstr "Serial port 1" + +msgid "Serial port 2" +msgstr "Serial port 2" + +msgid "Serial port 3" +msgstr "Serial port 3" + +msgid "Serial port 4" +msgstr "Serial port 4" + +msgid "Parallel port 1" +msgstr "Parallel port 1" + +msgid "Parallel port 2" +msgstr "Parallel port 2" + +msgid "Parallel port 3" +msgstr "Parallel port 3" + +msgid "HD Controller:" +msgstr "HD Controller:" + +msgid "FD Controller:" +msgstr "FD Controller:" + +msgid "Tertiary IDE Controller" +msgstr "Tertiary IDE Controller" + +msgid "Quaternary IDE Controller" +msgstr "Quaternary IDE Controller" + +msgid "SCSI" +msgstr "SCSI" + +msgid "Controller 1:" +msgstr "Controller 1:" + +msgid "Controller 2:" +msgstr "Controller 2:" + +msgid "Controller 3:" +msgstr "Controller 3:" + +msgid "Controller 4:" +msgstr "Controller 4:" + +msgid "Cassette" +msgstr "Cassette" + +msgid "Hard disks:" +msgstr "Hard disks:" + +msgid "&New..." +msgstr "&New..." + +msgid "&Existing..." +msgstr "&Existing..." + +msgid "&Remove" +msgstr "&Remove" + +msgid "Bus:" +msgstr "Bus:" + +msgid "Channel:" +msgstr "Channel:" + +msgid "ID:" +msgstr "ID:" + +msgid "&Specify..." +msgstr "&Specify..." + +msgid "Sectors:" +msgstr "Sectors:" + +msgid "Heads:" +msgstr "Heads:" + +msgid "Cylinders:" +msgstr "Cylinders:" + +msgid "Size (MB):" +msgstr "Size (MB):" + +msgid "Type:" +msgstr "Type:" + +msgid "Image Format:" +msgstr "Image Format:" + +msgid "Block Size:" +msgstr "Block Size:" + +msgid "Floppy drives:" +msgstr "Floppy drives:" + +msgid "Turbo timings" +msgstr "Turbo timings" + +msgid "Check BPB" +msgstr "Check BPB" + +msgid "CD-ROM drives:" +msgstr "CD-ROM drives:" + +msgid "MO drives:" +msgstr "MO drives:" + +msgid "ZIP drives:" +msgstr "ZIP drives:" + +msgid "ZIP 250" +msgstr "ZIP 250" + +msgid "ISA RTC:" +msgstr "ISA RTC:" + +msgid "ISA Memory Expansion" +msgstr "ISA Memory Expansion" + +msgid "Card 1:" +msgstr "Card 1:" + +msgid "Card 2:" +msgstr "Card 2:" + +msgid "Card 3:" +msgstr "Card 3:" + +msgid "Card 4:" +msgstr "Card 4:" + +msgid "ISABugger device" +msgstr "ISABugger device" + +msgid "POST card" +msgstr "POST card" + +msgid "Segoe UI" +msgstr "Segoe UI" + +msgid "86Box" +msgstr "86Box" + +msgid "Error" +msgstr "Error" + +msgid "Fatal error" +msgstr "Fatal error" + +msgid "" +msgstr "" + +msgid "Press CTRL+ALT+PAGE DOWN to return to windowed mode." +msgstr "Press CTRL+ALT+PAGE DOWN to return to windowed mode." + +msgid "Speed" +msgstr "Speed" + +msgid "ZIP %03i %i (%s): %ls" +msgstr "ZIP %03i %i (%s): %ls" + +msgid "ZIP images (*.IM? *.im? *.ZDI *.zdi)" +msgstr "ZIP images (*.IM? *.im? *.ZDI *.zdi)" + +msgid "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." +msgstr "86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory." + +msgid "(empty)" +msgstr "(empty)" + +msgid "ZIP images (*.IM? *.im? *.ZDI *.zdi);;All files (*)" +msgstr "ZIP images (*.IM? *.im? *.ZDI *.zdi);;All files (*)" + +msgid "Turbo" +msgstr "Turbo" + +msgid "On" +msgstr "On" + +msgid "Off" +msgstr "Off" + +msgid "All images (*.86F *.86f *.DSK *.dsk *.FLP *.flp *.IM? *.im? *.*FD? *.*fd?);;Basic sector images (*.DSK *.dsk *.FLP *.flp *.IM? *.im? *.IMG *.img *.*FD? *.*fd?);;Surface images (*.86F *.86f)" +msgstr "All images (*.86F *.86f *.DSK *.dsk *.FLP *.flp *.IM? *.im? *.*FD? *.*fd?);;Basic sector images (*.DSK *.dsk *.FLP *.flp *.IM? *.im? *.IMG *.img *.*FD? *.*fd?);;Surface images (*.86F *.86f)" + +msgid "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine." +msgstr "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine." + +msgid "Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card." +msgstr "Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card." + +msgid "Machine" +msgstr "Machine" + +msgid "Display" +msgstr "Display" + +msgid "Input devices" +msgstr "Input devices" + +msgid "Sound" +msgstr "Sound" + +msgid "Network" +msgstr "Network" + +msgid "Ports (COM & LPT)" +msgstr "Ports (COM & LPT)" + +msgid "Storage controllers" +msgstr "Storage controllers" + +msgid "Hard disks" +msgstr "Hard disks" + +msgid "Floppy & CD-ROM drives" +msgstr "Floppy & CD-ROM drives" + +msgid "Other removable devices" +msgstr "Other removable devices" + +msgid "Other peripherals" +msgstr "Other peripherals" + +msgid "Surface images (*.86F *.86f)" +msgstr "Surface images (*.86F *.86f)" + +msgid "Click to capture mouse" +msgstr "Click to capture mouse" + +msgid "Press F8+F12 to release mouse" +msgstr "Press F8+F12 to release mouse" + +msgid "Press F8+F12 or middle button to release mouse" +msgstr "Press F8+F12 or middle button to release mouse" + +msgid "Unable to initialize FluidSynth" +msgstr "Unable to initialize FluidSynth" + +msgid "Bus" +msgstr "Bus" + +msgid "File" +msgstr "File" + +msgid "C" +msgstr "C" + +msgid "H" +msgstr "H" + +msgid "S" +msgstr "S" + +msgid "KB" +msgstr "KB" + +msgid "Could not initialize the video renderer." +msgstr "Could not initialize the video renderer." + +msgid "Default" +msgstr "Default" + +msgid "%i Wait state(s)" +msgstr "%i Wait state(s)" + +msgid "Type" +msgstr "Type" + +msgid "Failed to set up PCap" +msgstr "Failed to set up PCap" + +msgid "No PCap devices found" +msgstr "No PCap devices found" + +msgid "Invalid PCap device" +msgstr "Invalid PCap device" + +msgid "Standard 2-button joystick(s)" +msgstr "Standard 2-button joystick(s)" + +msgid "Standard 4-button joystick" +msgstr "Standard 4-button joystick" + +msgid "Standard 6-button joystick" +msgstr "Standard 6-button joystick" + +msgid "Standard 8-button joystick" +msgstr "Standard 8-button joystick" + +msgid "CH Flightstick Pro" +msgstr "CH Flightstick Pro" + +msgid "Microsoft SideWinder Pad" +msgstr "Microsoft SideWinder Pad" + +msgid "Thrustmaster Flight Control System" +msgstr "Thrustmaster Flight Control System" + +msgid "None" +msgstr "None" + +msgid "Unable to load keyboard accelerators." +msgstr "Unable to load keyboard accelerators." + +msgid "Unable to register raw input." +msgstr "Unable to register raw input." + +msgid "%u" +msgstr "%u" + +msgid "%u MB (CHS: %i, %i, %i)" +msgstr "%u MB (CHS: %i, %i, %i)" + +msgid "Floppy %i (%s): %ls" +msgstr "Floppy %i (%s): %ls" + +msgid "All images (*.0?? *.1?? *.??0 *.86F *.86f *.BIN *.bin *.CQ? *.cq? *.D?? *.d?? *.FLP *.flp *.HDM *.hdm *.IM? *.im? *.JSON *.json *.TD0 *.td0 *.*FD? *.*fd? *.MFM *.mfm *.XDF *.xdf);;Advanced sector images (*.IMD *.imd *.JSON *.json *.TD0 *.td0);;Basic sector images (*.0?? *.1?? *.??0 *.BIN *.bin *.CQ? *.cq? *.D?? *.d?? *.FLP *.flp *.HDM *.hdm *.IM? *.im? *.XDF *.xdf *.*FD? *.*fd?);;Flux images (*.FDI *.fdi);;Surface images (*.86F *.86f *.MFM *.mfm);;All files (*)" +msgstr "All images (*.0?? *.1?? *.??0 *.86F *.86f *.BIN *.bin *.CQ? *.cq? *.D?? *.d?? *.FLP *.flp *.HDM *.hdm *.IM? *.im? *.JSON *.json *.TD0 *.td0 *.*FD? *.*fd? *.MFM *.mfm *.XDF *.xdf);;Advanced sector images (*.IMD *.imd *.JSON *.json *.TD0 *.td0);;Basic sector images (*.0?? *.1?? *.??0 *.BIN *.bin *.CQ? *.cq? *.D?? *.d?? *.FLP *.flp *.HDM *.hdm *.IM? *.im? *.XDF *.xdf *.*FD? *.*fd?);;Flux images (*.FDI *.fdi);;Surface images (*.86F *.86f *.MFM *.mfm);;All files (*)" + +msgid "Unable to initialize FreeType" +msgstr "Unable to initialize FreeType" + +msgid "Unable to initialize SDL, SDL2.dll is required" +msgstr "Unable to initialize SDL, SDL2.dll is required" + +msgid "Are you sure you want to hard reset the emulated machine?" +msgstr "Are you sure you want to hard reset the emulated machine?" + +msgid "Are you sure you want to exit 86Box?" +msgstr "Are you sure you want to exit 86Box?" + +msgid "Unable to initialize Ghostscript" +msgstr "Unable to initialize Ghostscript" + +msgid "MO %i (%ls): %ls" +msgstr "MO %i (%ls): %ls" + +msgid "MO images (*.IM? *.im? *.MDI *.mdi);;All files (*)" +msgstr "MO images (*.IM? *.im? *.MDI *.mdi);;All files (*)" + +msgid "Welcome to 86Box!" +msgstr "Welcome to 86Box!" + +msgid "Internal controller" +msgstr "Internal controller" + +msgid "Exit" +msgstr "Exit" + +msgid "No ROMs found" +msgstr "No ROMs found" + +msgid "Do you want to save the settings?" +msgstr "Do you want to save the settings?" + +msgid "This will hard reset the emulated machine." +msgstr "This will hard reset the emulated machine." + +msgid "Save" +msgstr "Save" + +msgid "About 86Box" +msgstr "About 86Box" + +msgid "86Box v" +msgstr "86Box v" + +msgid "An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, Tiseno100, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information." +msgstr "An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, Tiseno100, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information." + +msgid "Hardware not available" +msgstr "Hardware not available" + +msgid "WinPcap" +msgstr "WinPcap" + +msgid "libpcap" +msgstr "libpcap" + +msgid "Make sure libpcap is installed and that you are on a libpcap-compatible network connection." +msgstr "Make sure libpcap is installed and that you are on a libpcap-compatible network connection." + +msgid "Invalid configuration" +msgstr "Invalid configuration" + +msgid "freetype.dll" +msgstr "freetype.dll" + +msgid "libfreetype" +msgstr "libfreetype" + +msgid " is required for ESC/P printer emulation." +msgstr " is required for ESC/P printer emulation." + +msgid "gsdll32.dll" +msgstr "gsdll32.dll" + +msgid "libgs" +msgstr "libgs" + +msgid " is required for automatic conversion of PostScript files to PDF.\n\nAny documents sent to the generic PostScript printer will be saved as PostScript (.ps) files." +msgstr " is required for automatic conversion of PostScript files to PDF.\n\nAny documents sent to the generic PostScript printer will be saved as PostScript (.ps) files." + +msgid "libfluidsynth.dll" +msgstr "libfluidsynth.dll" + +msgid "libfluidsynth" +msgstr "libfluidsynth" + +msgid " is required for FluidSynth MIDI output." +msgstr " is required for FluidSynth MIDI output." + +msgid "Entering fullscreen mode" +msgstr "Entering fullscreen mode" + +msgid "Don't show this message again" +msgstr "Don't show this message again" + +msgid "Don't exit" +msgstr "Don't exit" + +msgid "Reset" +msgstr "Reset" + +msgid "Don't reset" +msgstr "Don't reset" + +msgid "CD-ROM images (*.ISO *.iso *.CUE *.cue);;All files (*)" +msgstr "CD-ROM images (*.ISO *.iso *.CUE *.cue);;All files (*)" + +msgid "%hs Device Configuration" +msgstr "%hs Device Configuration" + +msgid "Monitor in sleep mode" +msgstr "Monitor in sleep mode" + +msgid "OpenGL Shaders (*.GLSL *.glsl);;All files (*)" +msgstr "OpenGL Shaders (*.GLSL *.glsl);;All files (*)" + +msgid "OpenGL options" +msgstr "OpenGL options" + +msgid "You are loading an unsupported configuration" +msgstr "You are loading an unsupported configuration" + +msgid "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." +msgstr "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." + +msgid "Continue" +msgstr "Continue" + +msgid "Cassette: %s" +msgstr "Cassette: %s" + +msgid "Cassette images (*.PCM *.pcm *.RAW *.raw *.WAV *.wav *.CAS *.cas);;All files (*)" +msgstr "Cassette images (*.PCM *.pcm *.RAW *.raw *.WAV *.wav *.CAS *.cas);;All files (*)" + +msgid "Cartridge %i: %ls" +msgstr "Cartridge %i: %ls" + +msgid "Cartridge images (*.A *.a *.B *.b *.JRC *.jrc);;All files (*)" +msgstr "Cartridge images (*.A *.a *.B *.b *.JRC *.jrc);;All files (*)" + +msgid "Error initializing renderer" +msgstr "Error initializing renderer" + +msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." +msgstr "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer." + +msgid "Hard disk (%s)" +msgstr "Hard disk (%s)" + +msgid "%01i:%01i" +msgstr "%01i:%01i" + +msgid "%01i" +msgstr "%01i" + +msgid "MFM/RLL or ESDI CD-ROM drives never existed" +msgstr "MFM/RLL or ESDI CD-ROM drives never existed" + +msgid "Custom..." +msgstr "Custom..." + +msgid "Custom (large)..." +msgstr "Custom (large)..." + +msgid "Add New Hard Disk" +msgstr "Add New Hard Disk" + +msgid "Add Existing Hard Disk" +msgstr "Add Existing Hard Disk" + +msgid "HDI disk images cannot be larger than 4 GB." +msgstr "HDI disk images cannot be larger than 4 GB." + +msgid "Disk images cannot be larger than 127 GB." +msgstr "Disk images cannot be larger than 127 GB." + +msgid "Hard disk images (*.HD? *.hd? *.IM? *.im? *.VHD *.vhd);;All files (*)" +msgstr "Hard disk images (*.HD? *.hd? *.IM? *.im? *.VHD *.vhd);;All files (*)" + +msgid "Unable to read file" +msgstr "Unable to read file" + +msgid "Unable to write file" +msgstr "Unable to write file" + +msgid "HDI or HDX images with a sector size other than 512 are not supported." +msgstr "HDI or HDX images with a sector size other than 512 are not supported." + +msgid "USB is not yet supported" +msgstr "USB is not yet supported" + +msgid "Disk image file already exists" +msgstr "Disk image file already exists" + +msgid "Please specify a valid file name." +msgstr "Please specify a valid file name." + +msgid "Disk image created" +msgstr "Disk image created" + +msgid "Make sure the file exists and is readable." +msgstr "Make sure the file exists and is readable." + +msgid "Make sure the file is being saved to a writable directory." +msgstr "Make sure the file is being saved to a writable directory." + +msgid "Disk image too large" +msgstr "Disk image too large" + +msgid "Remember to partition and format the newly-created drive." +msgstr "Remember to partition and format the newly-created drive." + +msgid "The selected file will be overwritten. Are you sure you want to use it?" +msgstr "The selected file will be overwritten. Are you sure you want to use it?" + +msgid "Unsupported disk image" +msgstr "Unsupported disk image" + +msgid "Overwrite" +msgstr "Overwrite" + +msgid "Don't overwrite" +msgstr "Don't overwrite" + +msgid "Raw image (.img)" +msgstr "Raw image (.img)" + +msgid "HDI image (.hdi)" +msgstr "HDI image (.hdi)" + +msgid "HDX image (.hdx)" +msgstr "HDX image (.hdx)" + +msgid "Fixed-size VHD (.vhd)" +msgstr "Fixed-size VHD (.vhd)" + +msgid "Dynamic-size VHD (.vhd)" +msgstr "Dynamic-size VHD (.vhd)" + +msgid "Differencing VHD (.vhd)" +msgstr "Differencing VHD (.vhd)" + +msgid "Large blocks (2 MB)" +msgstr "Large blocks (2 MB)" + +msgid "Small blocks (512 KB)" +msgstr "Small blocks (512 KB)" + +msgid "VHD files (*.VHD *.vhd);;All files (*)" +msgstr "VHD files (*.VHD *.vhd);;All files (*)" + +msgid "Select the parent VHD" +msgstr "Select the parent VHD" + +msgid "This could mean that the parent image was modified after the differencing image was created.\n\nIt can also happen if the image files were moved or copied, or by a bug in the program that created this disk.\n\nDo you want to fix the timestamps?" +msgstr "This could mean that the parent image was modified after the differencing image was created.\n\nIt can also happen if the image files were moved or copied, or by a bug in the program that created this disk.\n\nDo you want to fix the timestamps?" + +msgid "Parent and child disk timestamps do not match" +msgstr "Parent and child disk timestamps do not match" + +msgid "Could not fix VHD timestamp." +msgstr "Could not fix VHD timestamp." + +msgid "%01i:%02i" +msgstr "%01i:%02i" + +msgid "MFM/RLL" +msgstr "MFM/RLL" + +msgid "XTA" +msgstr "XTA" + +msgid "ESDI" +msgstr "ESDI" + +msgid "IDE" +msgstr "IDE" + +msgid "ATAPI" +msgstr "ATAPI" + +msgid "MFM/RLL (%01i:%01i)" +msgstr "MFM/RLL (%01i:%01i)" + +msgid "XTA (%01i:%01i)" +msgstr "XTA (%01i:%01i)" + +msgid "ESDI (%01i:%01i)" +msgstr "ESDI (%01i:%01i)" + +msgid "IDE (%01i:%01i)" +msgstr "IDE (%01i:%01i)" + +msgid "ATAPI (%01i:%01i)" +msgstr "ATAPI (%01i:%01i)" + +msgid "SCSI (%01i:%02i)" +msgstr "SCSI (%01i:%02i)" + +msgid "CD-ROM %i (%s): %s" +msgstr "CD-ROM %i (%s): %s" + +msgid "160 kB" +msgstr "160 kB" + +msgid "180 kB" +msgstr "180 kB" + +msgid "320 kB" +msgstr "320 kB" + +msgid "360 kB" +msgstr "360 kB" + +msgid "640 kB" +msgstr "640 kB" + +msgid "720 kB" +msgstr "720 kB" + +msgid "1.2 MB" +msgstr "1.2 MB" + +msgid "1.25 MB" +msgstr "1.25 MB" + +msgid "1.44 MB" +msgstr "1.44 MB" + +msgid "DMF (cluster 1024)" +msgstr "DMF (cluster 1024)" + +msgid "DMF (cluster 2048)" +msgstr "DMF (cluster 2048)" + +msgid "2.88 MB" +msgstr "2.88 MB" + +msgid "ZIP 100" +msgstr "ZIP 100" + +msgid "3.5\" 128Mb M.O. (ISO 10090)" +msgstr "3.5\" 128Mb M.O. (ISO 10090)" + +msgid "3.5\" 230Mb M.O. (ISO 13963)" +msgstr "3.5\" 230Mb M.O. (ISO 13963)" + +msgid "3.5\" 540Mb M.O. (ISO 15498)" +msgstr "3.5\" 540Mb M.O. (ISO 15498)" + +msgid "3.5\" 640Mb M.O. (ISO 15498)" +msgstr "3.5\" 640Mb M.O. (ISO 15498)" + +msgid "3.5\" 1.3Gb M.O. (GigaMO)" +msgstr "3.5\" 1.3Gb M.O. (GigaMO)" + +msgid "3.5\" 2.3Gb M.O. (GigaMO 2)" +msgstr "3.5\" 2.3Gb M.O. (GigaMO 2)" + +msgid "5.25\" 600Mb M.O." +msgstr "5.25\" 600Mb M.O." + +msgid "5.25\" 650Mb M.O." +msgstr "5.25\" 650Mb M.O." + +msgid "5.25\" 1Gb M.O." +msgstr "5.25\" 1Gb M.O." + +msgid "5.25\" 1.3Gb M.O." +msgstr "5.25\" 1.3Gb M.O." + +msgid "Perfect RPM" +msgstr "Perfect RPM" + +msgid "1%% below perfect RPM" +msgstr "1%% below perfect RPM" + +msgid "1.5%% below perfect RPM" +msgstr "1.5%% below perfect RPM" + +msgid "2%% below perfect RPM" +msgstr "2%% below perfect RPM" + +msgid "(System Default)" +msgstr "(System Default)" + diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 2cb2437bb..464d5115f 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -31,6 +31,7 @@ Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin) #include #include "qt_mainwindow.hpp" +#include "qt_progsettings.hpp" #include "cocoa_mouse.hpp" #include "qt_styleoverride.hpp" @@ -97,30 +98,6 @@ main_thread_fn() is_quit = 1; } -class CustomTranslator : public QTranslator -{ -protected: - QString translate(const char *context, const char *sourceText, - const char *disambiguation = nullptr, int n = -1) const override - { - if (strcmp(sourceText, "&Fullscreen") == 0) sourceText = "&Fullscreen\tCtrl+Alt+PageUP"; - if (strcmp(sourceText, "&Ctrl+Alt+Del") == 0) sourceText = "&Ctrl+Alt+Del\tCtrl+F12"; - if (strcmp(sourceText, "Take s&creenshot") == 0) sourceText = "Take s&creenshot\tCtrl+F11"; - if (strcmp(sourceText, "&Qt (Software)") == 0) - { - QString finalstr = QTranslator::translate("", "&SDL (Software)", disambiguation, n); - finalstr.replace("SDL", "Qt"); - finalstr.replace("(&S)", "(&Q)"); - return finalstr; - } - QString finalstr = QTranslator::translate("", sourceText, disambiguation, n); -#ifdef Q_OS_MACOS - if (finalstr.contains('\t')) finalstr.truncate(finalstr.indexOf('\t')); -#endif - return finalstr; - } -}; - int main(int argc, char* argv[]) { QApplication app(argc, argv); Q_INIT_RESOURCE(qt_resources); @@ -133,20 +110,7 @@ int main(int argc, char* argv[]) { while (it.hasNext()) { qDebug() << it.next() << "\n"; } - QTranslator qtTranslator; - qtTranslator.load(QLocale::system(), QStringLiteral("qt_"), QString(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - if (app.installTranslator(&qtTranslator)) - { - qDebug() << "Qt translations loaded." << "\n"; - } - CustomTranslator translator; - qDebug() << QLocale::system().name() << "\n"; - auto localetofilename = QLocale::system().name().replace('_', '-'); - if (translator.load(QLatin1String("86box_"), QLatin1String(":/"), QString(), localetofilename + ".qm")) - { - qDebug() << "Translations loaded.\n"; - QCoreApplication::installTranslator(&translator); - } + #ifdef __APPLE__ CocoaEventFilter cocoafilter; app.installNativeEventFilter(&cocoafilter); @@ -157,6 +121,7 @@ int main(int argc, char* argv[]) { { return 0; } + ProgSettings::loadTranslators(&app); if (! pc_init_modules()) { ui_msgbox_header(MBX_FATAL, (void*)IDS_2120, (void*)IDS_2056); return 6; diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index d053098c1..807b64a52 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -18,6 +18,7 @@ #include #include "qt_mainwindow.hpp" +#include "qt_progsettings.hpp" #ifdef Q_OS_UNIX #include @@ -373,15 +374,49 @@ void set_language(uint32_t id) { lang_id = id; } +QMap> ProgSettings::lcid_langcode = +{ + {0x0405, {"cs-CZ", "Czech (Czech Republic)"} }, + {0x0407, {"de-DE", "German (Germany)"} }, + {0x0408, {"en-US", "English (United States)"} }, + {0x0809, {"en-GB", "English (United Kingdom)"} }, + {0x0C0A, {"es-ES", "Spanish (Spain)"} }, + {0x040B, {"fi-FI", "Finnish (Finland)"} }, + {0x040C, {"fr-FR", "French (France)"} }, + {0x041A, {"hr-HR", "Croatian (Croatia)"} }, + {0x040E, {"hu-HU", "Hungarian (Hungary)"} }, + {0x0410, {"it-IT", "Italian (Italy)"} }, + {0x0411, {"ja-JP", "Japanese (Japan)"} }, + {0x0412, {"ko-KR", "Korean (Korea)"} }, + {0x0416, {"pt-BR", "Portuguese (Brazil)"} }, + {0x0816, {"pt-PT", "Portuguese (Portugal)"} }, + {0x0419, {"ru-RU", "Russian (Russia)"} }, + {0x0424, {"sl-SI", "Slovenian (Slovenia)"} }, + {0x041F, {"tr-TR", "Turkish (Turkey)"} }, + {0x0804, {"zh-CN", "Chinese (China)"} }, + {0xFFFF, {"system", "(System Default)"} }, +}; + /* Sets up the program language before initialization. */ uint32_t plat_language_code(char* langcode) { - /* or maybe not */ - return 0; + for (auto& curKey : ProgSettings::lcid_langcode.keys()) + { + if (ProgSettings::lcid_langcode[curKey].first == langcode) + { + return curKey; + } + } + return 0xFFFF; } /* Converts back the language code to LCID */ void plat_language_code_r(uint32_t lcid, char* outbuf, int len) { - /* or maybe not */ + if (!ProgSettings::lcid_langcode.contains(lcid)) + { + qstrncpy(outbuf, "system", len); + return; + } + qstrncpy(outbuf, ProgSettings::lcid_langcode[lcid].first.toUtf8().constData(), len); return; } @@ -489,9 +524,9 @@ size_t c16stombs(char dst[], const uint16_t src[], int len) #endif -static std::map translatedstrings; +QMap ProgSettings::translatedstrings; -static void reload_strings() +void ProgSettings::reloadStrings() { translatedstrings.clear(); translatedstrings[IDS_2077] = QCoreApplication::translate("", "Click to capture mouse").toStdWString(); @@ -536,8 +571,8 @@ static void reload_strings() wchar_t* plat_get_string(int i) { - if (translatedstrings.empty()) reload_strings(); - return translatedstrings[i].data(); + if (ProgSettings::translatedstrings.empty()) ProgSettings::reloadStrings(); + return ProgSettings::translatedstrings[i].data(); } int diff --git a/src/qt/qt_progsettings.cpp b/src/qt/qt_progsettings.cpp index a228b55c1..c0e4623a4 100644 --- a/src/qt/qt_progsettings.cpp +++ b/src/qt/qt_progsettings.cpp @@ -1,3 +1,5 @@ +#include + #include "qt_progsettings.hpp" #include "ui_qt_progsettings.h" #include "qt_mainwindow.hpp" @@ -7,6 +9,7 @@ #include #include #include +#include extern "C" { @@ -19,6 +22,8 @@ extern "C" static QMap iconset_to_qt; extern MainWindow* main_window; +ProgSettings::CustomTranslator* ProgSettings::translator = nullptr; +QTranslator* ProgSettings::qtTranslator = nullptr; QString ProgSettings::getIconSetPath() { QString roms_root; @@ -69,12 +74,29 @@ ProgSettings::ProgSettings(QWidget *parent) : ui->comboBox->setCurrentIndex(ui->comboBox->findData(i.key())); } } + ui->comboBox->setItemData(0, '(' + tr("Default") + ')', Qt::DisplayRole); + + ui->comboBoxLanguage->setItemData(0, 0xFFFF); + for (auto i = lcid_langcode.begin() + 1; i != lcid_langcode.end(); i++) + { + if (i.key() == 0xFFFF) continue; + ui->comboBoxLanguage->addItem(lcid_langcode[i.key()].second, i.key()); + if (i.key() == lang_id) + { + ui->comboBoxLanguage->setCurrentIndex(ui->comboBoxLanguage->findData(i.key())); + } + } } void ProgSettings::accept() { strcpy(icon_set, ui->comboBox->currentData().toString().toUtf8().data()); + lang_id = ui->comboBoxLanguage->currentData().toUInt(); + loadTranslators(QCoreApplication::instance()); + reloadStrings(); + update_mouse_msg(); + main_window->ui->retranslateUi(main_window); QString msg = main_window->status->getMessage(); main_window->status.reset(new MachineStatus(main_window)); main_window->refreshMediaMenu(); @@ -96,3 +118,50 @@ void ProgSettings::on_pushButton_released() ui->comboBox->setCurrentIndex(0); } +void ProgSettings::loadTranslators(QObject *parent) +{ + if (qtTranslator) + { + QApplication::removeTranslator(qtTranslator); + qtTranslator = nullptr; + } + if (translator) + { + QApplication::removeTranslator(translator); + translator = nullptr; + } + qtTranslator = new QTranslator(parent); + translator = new CustomTranslator(parent); + QString localetofilename = ""; + if (lang_id == 0xFFFF || lcid_langcode.contains(lang_id) == false) + { + for (int i = 0; i < QLocale::system().uiLanguages().size(); i++) + { + localetofilename = QLocale::system().uiLanguages()[i]; + if (translator->load(QLatin1String("86box_") + localetofilename, QLatin1String(":/"))) + { + qDebug() << "Translations loaded.\n"; + QCoreApplication::installTranslator(translator); + qtTranslator->load(QLatin1String("qtbase_") + localetofilename.replace('-', '_'), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + if (QApplication::installTranslator(qtTranslator)) + { + qDebug() << "Qt translations loaded." << "\n"; + } + break; + } + } + } + else + { + translator->load(QLatin1String("86box_") + lcid_langcode[lang_id].first, QLatin1String(":/")); + QCoreApplication::installTranslator(translator); + qtTranslator->load(QLatin1String("qtbase_") + QString(lcid_langcode[lang_id].first).replace('-', '_'), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + QCoreApplication::installTranslator(qtTranslator); + } +} + +void ProgSettings::on_pushButtonLanguage_released() +{ + ui->comboBoxLanguage->setCurrentIndex(0); +} + diff --git a/src/qt/qt_progsettings.hpp b/src/qt/qt_progsettings.hpp index cef6ba192..f4ad58bbb 100644 --- a/src/qt/qt_progsettings.hpp +++ b/src/qt/qt_progsettings.hpp @@ -16,11 +16,43 @@ public: explicit ProgSettings(QWidget *parent = nullptr); ~ProgSettings(); static QString getIconSetPath(); + static void loadTranslators(QObject* parent = nullptr); + static void reloadStrings(); + class CustomTranslator : public QTranslator + { + public: + CustomTranslator(QObject* parent = nullptr) : QTranslator(parent) {}; + protected: + QString translate(const char *context, const char *sourceText, + const char *disambiguation = nullptr, int n = -1) const override + { + if (strcmp(sourceText, "&Fullscreen") == 0) sourceText = "&Fullscreen\tCtrl+Alt+PageUP"; + if (strcmp(sourceText, "&Ctrl+Alt+Del") == 0) sourceText = "&Ctrl+Alt+Del\tCtrl+F12"; + if (strcmp(sourceText, "Take s&creenshot") == 0) sourceText = "Take s&creenshot\tCtrl+F11"; + if (strcmp(sourceText, "&Qt (Software)") == 0) + { + QString finalstr = QTranslator::translate("", "&SDL (Software)", disambiguation, n); + finalstr.replace("SDL", "Qt"); + finalstr.replace("(&S)", "(&Q)"); + return finalstr; + } + QString finalstr = QTranslator::translate("", sourceText, disambiguation, n); +#ifdef Q_OS_MACOS + if (finalstr.contains('\t')) finalstr.truncate(finalstr.indexOf('\t')); +#endif + return finalstr; + } + }; + static CustomTranslator* translator; + static QTranslator* qtTranslator; + static QMap> lcid_langcode; + static QMap translatedstrings; protected slots: void accept() override; private slots: void on_pushButton_released(); + void on_pushButtonLanguage_released(); private: Ui::ProgSettings *ui; diff --git a/src/qt/qt_progsettings.ui b/src/qt/qt_progsettings.ui index 6adb8bcfc..2551bdc0b 100644 --- a/src/qt/qt_progsettings.ui +++ b/src/qt/qt_progsettings.ui @@ -73,6 +73,47 @@ Default + + + + 20 + 140 + 91 + 16 + + + + Language: + + + + + + 290 + 190 + 80 + 23 + + + + Default + + + + + + 20 + 160 + 351 + 23 + + + + + (System Default) + + + diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index 5260da837..8a1f12be2 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -52,7 +52,7 @@ SettingsMachine::SettingsMachine(QWidget *parent) : waitStatesModel->setData(idx, 0, Qt::UserRole); for (int i = 0; i < 8; ++i) { idx = waitStatesModel->index(i+1, 0); - waitStatesModel->setData(idx, QString("%1 Wait State(s)").arg(i), Qt::DisplayRole); + waitStatesModel->setData(idx, QString::asprintf(tr("%i Wait state(s)").toUtf8().constData(), i), Qt::DisplayRole); waitStatesModel->setData(idx, i+1, Qt::UserRole); } diff --git a/src/qt/qt_translations.qrc b/src/qt/qt_translations.qrc index f8e9ced0b..a5c91336d 100644 --- a/src/qt/qt_translations.qrc +++ b/src/qt/qt_translations.qrc @@ -2,6 +2,7 @@ 86box_cs-CZ.qm 86box_de-DE.qm + 86box_en-US.qm 86box_en-GB.qm 86box_es-ES.qm 86box_fi-FI.qm