| 1 | #!/bin/bash |
| 2 | |
| 3 | # This script updates the dolphin-emu.pot file to match the strings in |
| 4 | # the source code. |
| 5 | |
| 6 | cd "$(dirname "$0")/.." |
| 7 | |
| 8 | # Scan the source code for strings and put them in dolphin-emu.pot |
| 9 | SRCDIR=Source |
| 10 | find $SRCDIR -name '*.cpp' -o -name '*.h' -o -name '*.c' | sort -fd | \ |
| 11 | xgettext -p ./Languages/po -o dolphin-emu.pot --package-name="Dolphin Emulator" \ |
| 12 | --keyword=_ \ |
| 13 | --keyword=AskYesNoFmtT \ |
| 14 | --keyword=CriticalAlertFmtT \ |
| 15 | --keyword=PanicAlertFmtT \ |
| 16 | --keyword=PanicYesNoFmtT \ |
| 17 | --keyword=SuccessAlertFmtT \ |
| 18 | --keyword=GetStringT \ |
| 19 | --keyword=_trans \ |
| 20 | --keyword=tr:1,1t \ |
| 21 | --keyword=tr:1,2c \ |
| 22 | --keyword=QT_TR_NOOP \ |
| 23 | --keyword=FmtFormatT \ |
| 24 | --add-comments=i18n --from-code=utf-8 -f - |
| 25 | |
| 26 | # Copy strings from qt-strings.pot to dolphin-emu.pot |
| 27 | xgettext -p ./Languages/po -o dolphin-emu.pot --package-name="Dolphin Emulator" \ |
| 28 | -j ./Languages/po/qt-strings.pot |
| 29 | |
| 30 | sed -i "s/SOME DESCRIPTIVE TITLE\./Translation of dolphin-emu.pot to LANGUAGE/" Languages/po/dolphin-emu.pot |
| 31 | sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2003-2013/" Languages/po/dolphin-emu.pot |
| 32 | sed -i "s/license as the PACKAGE package/license as the dolphin-emu package/" Languages/po/dolphin-emu.pot |