Files
GDevelop/scripts/ExtractTranslations.sh
T
2020-05-29 10:12:48 +02:00

26 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#Launch this script to generate the .POT file used
#to update the strings to be translated.
echo "️ Listing all GDCore, GDCpp, GDJS and Extensions sources files to translate..."
find ../GDJS/GDJS/ -name '*.cpp' | grep -v '/Dialogs/' > /tmp/listfile.txt
find ../GDJS/GDJS/ -name '*.h' -o -name "*.hpp" | grep -v '/Dialogs/' >> /tmp/listfile.txt
find ../Extensions/ -name '*.cpp' | grep -v '/Dialogs/' | grep -v '/AdvancedXML/' | grep -v '/Function/' | grep -v '/TimedEvent/' | grep -v '/PathBehavior/' | grep -v '/Light/' | grep -v '/TileMapObject/' | grep -v '/Box3DObject/' | grep -v '/AES/' | grep -v 'Editor.cpp' | grep -v 'Dialog.cpp' | grep -v 'EditorDlg.cpp' >> /tmp/listfile.txt
find ../Extensions/ -name '*.h' -o -name "*.hpp" | grep -v '/Dialogs/' | grep -v '/AdvancedXML/' | grep -v '/Function/' | grep -v '/TimedEvent/' | grep -v '/PathBehavior/' | grep -v '/Light/' | grep -v '/TileMapObject/' | grep -v '/Box3DObject/' | grep -v '/AES/' | grep -v 'Editor.cpp' | grep -v 'Dialog.cpp' | grep -v 'EditorDlg.cpp' >> /tmp/listfile.txt
find ../Extensions/ -name '*.js' | grep -v 'box2d.js' | grep -v '/bondage.js' >> /tmp/listfile.txt
find ../Core/GDCore -name '*.cpp' | grep -v '/Dialogs/' >> /tmp/listfile.txt
find ../Core/GDCore -name '*.h' -o -name "*.hpp" | grep -v '/Dialogs/' >> /tmp/listfile.txt
echo "️ Generating .POT file..."
if type xgettext 2>/dev/null; then
GETTEXT=xgettext
else
GETTEXT=$(find /usr -name "xgettext" -print -quit 2>/dev/null)
fi
if type $GETTEXT 2>/dev/null; then
$GETTEXT --from-code utf-8 -o gdcore-gdcpp-gdjs-extensions-messages.pot --keyword=GD_T --no-wrap -f /tmp/listfile.txt -k_
echo "️ Translation file 'gdcore-gdcpp-gdjs-extensions-messages.pot' generated and ready to be sent to Crowdin or used in a translation software like PoEdit."
else
echo "❌ Unable to find xgettext on your system."
fi