Merge pull request #9159 from JosJuice/qt-predefined-translate

Fix predefined Qt strings not getting translated
This commit is contained in:
Léo Lam 2020-10-20 00:52:52 +02:00 committed by GitHub
commit 55b4924899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 87 additions and 6 deletions

View File

@ -0,0 +1,76 @@
# This file contains strings which are defined in Qt's source code
# and may be shown in applications which use Qt. Extracted from Qt 5.15.1.
msgid ""
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:708
msgid "OK"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:710
msgid "Save"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:712
msgid "Save All"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:714
msgid "Open"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:716
msgid "&Yes"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:718
msgid "Yes to &All"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:720
msgid "&No"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:722
msgid "N&o to All"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:724
msgid "Abort"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:726
msgid "Retry"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:728
msgid "Ignore"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:730
msgid "Close"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:732
msgid "Cancel"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:734
msgid "Discard"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:736
msgid "Help"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:738
msgid "Apply"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:740
msgid "Reset"
msgstr ""
#: qtbase/src/gui/kernel/qplatformtheme.cpp:742
msgid "Restore Defaults"
msgstr ""

View File

@ -4,14 +4,19 @@
# the source code. # the source code.
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
# Scan the source code for strings and put them in dolphin-emu.pot
SRCDIR=Source SRCDIR=Source
find $SRCDIR -name '*.cpp' -o -name '*.h' -o -name '*.c' | \ find $SRCDIR -name '*.cpp' -o -name '*.h' -o -name '*.c' | \
xgettext -d dolphin-emu -s --keyword=_ --keyword=wxTRANSLATE --keyword=SuccessAlertT \ xgettext -s -p ./Languages/po -o dolphin-emu.pot --package-name="Dolphin Emulator" \
--keyword=PanicAlertT --keyword=PanicYesNoT --keyword=AskYesNoT --keyword=CriticalAlertT \ --keyword=_ --keyword=wxTRANSLATE --keyword=SuccessAlertT --keyword=PanicAlertT \
--keyword=GetStringT --keyword=_trans --keyword=tr:1,1t --keyword=tr:1,2c --keyword=QT_TR_NOOP \ --keyword=PanicYesNoT --keyword=AskYesNoT --keyword=CriticalAlertT --keyword=GetStringT \
--keyword=FmtFormatT \ --keyword=_trans --keyword=tr:1,1t --keyword=tr:1,2c --keyword=QT_TR_NOOP --keyword=FmtFormatT \
--add-comments=i18n -p ./Languages/po -o dolphin-emu.pot -f - --package-name="Dolphin Emulator" \ --add-comments=i18n --from-code=utf-8 -f -
--from-code=utf-8
# Copy strings from qt-strings.pot to dolphin-emu.pot
xgettext -s -p ./Languages/po -o dolphin-emu.pot --package-name="Dolphin Emulator" \
-j ./Languages/po/qt-strings.pot
sed -i "s/SOME DESCRIPTIVE TITLE\./Translation of dolphin-emu.pot to LANGUAGE/" Languages/po/dolphin-emu.pot sed -i "s/SOME DESCRIPTIVE TITLE\./Translation of dolphin-emu.pot to LANGUAGE/" Languages/po/dolphin-emu.pot
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2003-2013/" Languages/po/dolphin-emu.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2003-2013/" Languages/po/dolphin-emu.pot