Begin .po work
This commit is contained in:
1332
src/qt/86box_de.ts
1332
src/qt/86box_de.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_en.ts
1332
src/qt/86box_en.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_es.ts
1332
src/qt/86box_es.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_fi.ts
1332
src/qt/86box_fi.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_fr.ts
1332
src/qt/86box_fr.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_hr.ts
1332
src/qt/86box_hr.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_hu.ts
1332
src/qt/86box_hu.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_it.ts
1332
src/qt/86box_it.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_ja.ts
1332
src/qt/86box_ja.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_ko.ts
1332
src/qt/86box_ko.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_ru.ts
1332
src/qt/86box_ru.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_sl.ts
1332
src/qt/86box_sl.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_tr.ts
1332
src/qt/86box_tr.ts
File diff suppressed because it is too large
Load Diff
1332
src/qt/86box_zh.ts
1332
src/qt/86box_zh.ts
File diff suppressed because it is too large
Load Diff
@@ -173,6 +173,16 @@ if (UNIX AND NOT APPLE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
qt_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} 86box_en.ts 86box_en-GB.ts 86box_de.ts 86box_es.ts 86box_fi.ts 86box_fr.ts 86box_hr.ts 86box_hu.ts 86box_it.ts 86box_ja.ts 86box_ko.ts 86box_pt-BR.ts 86box_pt-PT.ts 86box_ru.ts 86box_sl.ts 86box_tr.ts 86box_zh.ts)
|
set(QM_FILES)
|
||||||
|
file(GLOB po_files "${CMAKE_CURRENT_SOURCE_DIR}/languages/*.po")
|
||||||
|
foreach(po_file ${po_files})
|
||||||
|
get_target_property(LCONVERT_EXECUTABLE Qt${QT_MAJOR}::lconvert IMPORTED_LOCATION)
|
||||||
|
|
||||||
|
get_filename_component(PO_FILE_NAME ${po_file} NAME_WE)
|
||||||
|
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/86box_${PO_FILE_NAME}.qm"
|
||||||
|
COMMAND ${LCONVERT_EXECUTABLE} -i ${po_file} -o ${CMAKE_CURRENT_BINARY_DIR}/86box_${PO_FILE_NAME}.qm
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
list(APPEND QM_FILES "${CMAKE_CURRENT_BINARY_DIR}/86box_${PO_FILE_NAME}.qm")
|
||||||
|
endforeach()
|
||||||
configure_file(qt_translations.qrc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
|
configure_file(qt_translations.qrc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
|
||||||
target_sources(ui PRIVATE ${QM_FILES} ${CMAKE_CURRENT_BINARY_DIR}/qt_translations.qrc)
|
target_sources(ui PRIVATE ${QM_FILES} ${CMAKE_CURRENT_BINARY_DIR}/qt_translations.qrc)
|
||||||
|
1603
src/qt/languages/.ts
Normal file
1603
src/qt/languages/.ts
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/cs_CZ.po
Normal file
1173
src/qt/languages/cs_CZ.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/de_DE.po
Normal file
1173
src/qt/languages/de_DE.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/en_GB.po
Normal file
1173
src/qt/languages/en_GB.po
Normal file
File diff suppressed because it is too large
Load Diff
1599
src/qt/languages/en_GB.ts
Normal file
1599
src/qt/languages/en_GB.ts
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/es_ES.po
Normal file
1173
src/qt/languages/es_ES.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/fi_FI.po
Normal file
1173
src/qt/languages/fi_FI.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/fr_FR.po
Normal file
1173
src/qt/languages/fr_FR.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/hr_HR.po
Normal file
1173
src/qt/languages/hr_HR.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/hu_HU.po
Normal file
1173
src/qt/languages/hu_HU.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/it_IT.po
Normal file
1173
src/qt/languages/it_IT.po
Normal file
File diff suppressed because it is too large
Load Diff
1176
src/qt/languages/ja_JP.po
Normal file
1176
src/qt/languages/ja_JP.po
Normal file
File diff suppressed because it is too large
Load Diff
1176
src/qt/languages/ko_KR.po
Normal file
1176
src/qt/languages/ko_KR.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/pt_BR.po
Normal file
1173
src/qt/languages/pt_BR.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/pt_PT.po
Normal file
1173
src/qt/languages/pt_PT.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/ru_RU.po
Normal file
1173
src/qt/languages/ru_RU.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/sl_SI.po
Normal file
1173
src/qt/languages/sl_SI.po
Normal file
File diff suppressed because it is too large
Load Diff
1173
src/qt/languages/tr_TR.po
Normal file
1173
src/qt/languages/tr_TR.po
Normal file
File diff suppressed because it is too large
Load Diff
1176
src/qt/languages/zh_CN.po
Normal file
1176
src/qt/languages/zh_CN.po
Normal file
File diff suppressed because it is too large
Load Diff
@@ -97,6 +97,16 @@ main_thread_fn()
|
|||||||
is_quit = 1;
|
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
|
||||||
|
{
|
||||||
|
return QTranslator::translate("", sourceText, disambiguation, n);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
Q_INIT_RESOURCE(qt_resources);
|
Q_INIT_RESOURCE(qt_resources);
|
||||||
@@ -105,13 +115,16 @@ int main(int argc, char* argv[]) {
|
|||||||
fmt.setSwapInterval(0);
|
fmt.setSwapInterval(0);
|
||||||
QSurfaceFormat::setDefaultFormat(fmt);
|
QSurfaceFormat::setDefaultFormat(fmt);
|
||||||
app.setStyle(new StyleOverride());
|
app.setStyle(new StyleOverride());
|
||||||
|
QDirIterator it(":", QDirIterator::Subdirectories);
|
||||||
|
while (it.hasNext()) {
|
||||||
|
qDebug() << it.next() << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
QTranslator translator;
|
CustomTranslator translator;
|
||||||
if (translator.load(QLocale(), QLatin1String("86box"), QLatin1String("_"), QLatin1String(":/")))
|
qDebug() << QLocale::system().name() << "\n";
|
||||||
|
if (translator.load(QLatin1String("86box_"), QLatin1String(":/"), QString(), "de_DE.qm"))
|
||||||
{
|
{
|
||||||
translator.load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
qDebug() << "Translations loaded.\n";
|
||||||
translator.load(QLocale(), QLatin1String("qt_help"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
||||||
translator.load(QLocale(), QLatin1String("qtbase"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
||||||
QCoreApplication::installTranslator(&translator);
|
QCoreApplication::installTranslator(&translator);
|
||||||
}
|
}
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>724</width>
|
<width>724</width>
|
||||||
<height>22</height>
|
<height>23</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuAction">
|
<widget class="QMenu" name="menuAction">
|
||||||
@@ -488,7 +488,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionAbout_86Box">
|
<action name="actionAbout_86Box">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>About 86Box...</string>
|
<string>&About 86Box...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::AboutRole</enum>
|
<enum>QAction::AboutRole</enum>
|
||||||
|
@@ -473,9 +473,13 @@ size_t c16stombs(char dst[], const uint16_t src[], int len)
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define LIB_NAME_FLUIDSYNTH "libfluidsynth.dll"
|
#define LIB_NAME_FLUIDSYNTH "libfluidsynth.dll"
|
||||||
|
#define LIB_NAME_GS "gsdll32.dll"
|
||||||
|
#define LIB_NAME_FREETYPE "freetype.dll"
|
||||||
#define MOUSE_CAPTURE_KEYSEQ "F8+F12"
|
#define MOUSE_CAPTURE_KEYSEQ "F8+F12"
|
||||||
#else
|
#else
|
||||||
#define LIB_NAME_FLUIDSYNTH "libfluidsynth"
|
#define LIB_NAME_FLUIDSYNTH "libfluidsynth"
|
||||||
|
#define LIB_NAME_GS "libgs"
|
||||||
|
#define LIB_NAME_FREETYPE "libfreetype"
|
||||||
#define MOUSE_CAPTURE_KEYSEQ "CTRL-END"
|
#define MOUSE_CAPTURE_KEYSEQ "CTRL-END"
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
@@ -490,25 +494,44 @@ static std::map<int, std::wstring> translatedstrings;
|
|||||||
static void reload_strings()
|
static void reload_strings()
|
||||||
{
|
{
|
||||||
translatedstrings.clear();
|
translatedstrings.clear();
|
||||||
translatedstrings[IDS_2077] = QObject::tr("Click to capture mouse.").toStdWString();
|
translatedstrings[IDS_2077] = QCoreApplication::translate("", "Click to capture mouse").toStdWString();
|
||||||
translatedstrings[IDS_2078] = QObject::tr("Press %1 to release mouse").arg(MOUSE_CAPTURE_KEYSEQ).toStdWString();
|
translatedstrings[IDS_2078] = QCoreApplication::translate("", "Press F8+F12 to release mouse").replace("F8+F12", MOUSE_CAPTURE_KEYSEQ).toStdWString();
|
||||||
translatedstrings[IDS_2079] = QObject::tr("Press %1 or middle button to release mouse").arg(MOUSE_CAPTURE_KEYSEQ).toStdWString();
|
translatedstrings[IDS_2079] = QCoreApplication::translate("", "Press F8+F12 or middle button to release mouse").replace("F8+F12", MOUSE_CAPTURE_KEYSEQ).toStdWString();
|
||||||
translatedstrings[IDS_2080] = QObject::tr("Failed to initialize FluidSynth").toStdWString();
|
translatedstrings[IDS_2080] = QCoreApplication::translate("", "Failed to initialize FluidSynth").toStdWString();
|
||||||
translatedstrings[IDS_4099] = QObject::tr("MFM/RLL or ESDI CD-ROM drives never existed").toStdWString();
|
translatedstrings[IDS_4099] = QCoreApplication::translate("", "MFM/RLL or ESDI CD-ROM drives never existed").toStdWString();
|
||||||
translatedstrings[IDS_2093] = QObject::tr("Failed to set up PCap").toStdWString();
|
translatedstrings[IDS_2093] = QCoreApplication::translate("", "Failed to set up PCap").toStdWString();
|
||||||
translatedstrings[IDS_2094] = QObject::tr("No PCap devices found").toStdWString();
|
translatedstrings[IDS_2094] = QCoreApplication::translate("", "No PCap devices found").toStdWString();
|
||||||
translatedstrings[IDS_2110] = QObject::tr("Unable to initialize FreeType").toStdWString();
|
translatedstrings[IDS_2110] = QCoreApplication::translate("", "Unable to initialize FreeType").toStdWString();
|
||||||
translatedstrings[IDS_2111] = QObject::tr("Unable to initialize SDL, libsdl2 is required").toStdWString();
|
translatedstrings[IDS_2111] = QCoreApplication::translate("", "Unable to initialize SDL, libsdl2 is required").toStdWString();
|
||||||
translatedstrings[IDS_2131] = QObject::tr("libfreetype is required for ESC/P printer emulation.").toStdWString();
|
translatedstrings[IDS_2129] = QCoreApplication::translate("", "Make sure libpcap is installed and that you are on a libpcap-compatible network connection.").toStdWString();
|
||||||
translatedstrings[IDS_2132] = QObject::tr("libgs 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.").toStdWString();
|
translatedstrings[IDS_2114] = QCoreApplication::translate("", "Unable to initialize Ghostscript").toStdWString();
|
||||||
translatedstrings[IDS_2133] = QObject::tr("%1 is required for FluidSynth MIDI output.").arg(LIB_NAME_FLUIDSYNTH).toStdWString();
|
translatedstrings[IDS_2063] = QCoreApplication::translate("", "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine.").toStdWString();
|
||||||
translatedstrings[IDS_2129] = QObject::tr("Make sure libpcap is installed and that you are on a libpcap-compatible network connection.").toStdWString();
|
translatedstrings[IDS_2064] = QCoreApplication::translate("", "Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card.").toStdWString();
|
||||||
translatedstrings[IDS_2114] = QObject::tr("Unable to initialize Ghostscript").toStdWString();
|
translatedstrings[IDS_2128] = QCoreApplication::translate("", "Hardware not available").toStdWString();
|
||||||
translatedstrings[IDS_2063] = QObject::tr("Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine.").toStdWString();
|
translatedstrings[IDS_2120] = QCoreApplication::translate("", "No ROMs found").toStdWString();
|
||||||
translatedstrings[IDS_2064] = QObject::tr("Video card \"%hs\" is not available due to missing ROMs in the roms/video directory. Switching to an available video card.").toStdWString();
|
translatedstrings[IDS_2056] = QCoreApplication::translate("", "86Box could not find any usable ROM images.\n\nPlease <a href='https://github.com/86Box/roms/releases/latest'>download</a> a ROM set and extract it into the roms directory.").replace("roms", "\"" ROMDIR "\"").toStdWString();
|
||||||
translatedstrings[IDS_2128] = QObject::tr("Hardware not available").toStdWString();
|
|
||||||
translatedstrings[IDS_2120] = QObject::tr("No ROMs found.").toStdWString();
|
auto flsynthstr = QCoreApplication::translate("", " is required for FluidSynth MIDI output.");
|
||||||
translatedstrings[IDS_2056] = QObject::tr("86Box could not find any usable ROM images.\n\nPlease <a href='https://github.com/86Box/roms/releases/latest'>download</a> a ROM set and extract it into the \"%1\" directory.").arg(ROMDIR).toStdWString();
|
if (flsynthstr.contains("libfluidsynth"))
|
||||||
|
{
|
||||||
|
flsynthstr.replace("libfluidsynth", LIB_NAME_FLUIDSYNTH);
|
||||||
|
}
|
||||||
|
else flsynthstr.prepend(LIB_NAME_FLUIDSYNTH);
|
||||||
|
translatedstrings[IDS_2133] = flsynthstr.toStdWString();
|
||||||
|
auto gssynthstr = QCoreApplication::translate("", " 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.");
|
||||||
|
if (gssynthstr.contains("libgs"))
|
||||||
|
{
|
||||||
|
gssynthstr.replace("libgs", LIB_NAME_GS);
|
||||||
|
}
|
||||||
|
else gssynthstr.prepend(LIB_NAME_GS);
|
||||||
|
translatedstrings[IDS_2132] = flsynthstr.toStdWString();
|
||||||
|
auto ftsynthstr = QCoreApplication::translate("", " is required for ESC/P printer emulation.");
|
||||||
|
if (ftsynthstr.contains("libfreetype"))
|
||||||
|
{
|
||||||
|
ftsynthstr.replace("libfreetype", LIB_NAME_FREETYPE);
|
||||||
|
}
|
||||||
|
else ftsynthstr.prepend(LIB_NAME_FREETYPE);
|
||||||
|
translatedstrings[IDS_2131] = ftsynthstr.toStdWString();
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t* plat_get_string(int i)
|
wchar_t* plat_get_string(int i)
|
||||||
|
@@ -1,21 +1,20 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>86box_de.qm</file>
|
<file>86box_de_DE.qm</file>
|
||||||
<file>86box_en-GB.qm</file>
|
<file>86box_en_GB.qm</file>
|
||||||
<file>86box_en.qm</file>
|
<file>86box_es_ES.qm</file>
|
||||||
<file>86box_es.qm</file>
|
<file>86box_fi_FI.qm</file>
|
||||||
<file>86box_fi.qm</file>
|
<file>86box_fr_FR.qm</file>
|
||||||
<file>86box_fr.qm</file>
|
<file>86box_hr_HR.qm</file>
|
||||||
<file>86box_hr.qm</file>
|
<file>86box_hu_HU.qm</file>
|
||||||
<file>86box_hu.qm</file>
|
<file>86box_it_IT.qm</file>
|
||||||
<file>86box_it.qm</file>
|
<file>86box_ja_JP.qm</file>
|
||||||
<file>86box_ja.qm</file>
|
<file>86box_ko_KR.qm</file>
|
||||||
<file>86box_ko.qm</file>
|
<file>86box_pt_BR.qm</file>
|
||||||
<file>86box_pt-BR.qm</file>
|
<file>86box_pt_PT.qm</file>
|
||||||
<file>86box_pt-PT.qm</file>
|
<file>86box_ru_RU.qm</file>
|
||||||
<file>86box_ru.qm</file>
|
<file>86box_sl_SI.qm</file>
|
||||||
<file>86box_sl.qm</file>
|
<file>86box_tr_TR.qm</file>
|
||||||
<file>86box_tr.qm</file>
|
<file>86box_zh_CN.qm</file>
|
||||||
<file>86box_zh.qm</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Reference in New Issue
Block a user