Skip to content

Commit

Permalink
script to update the translations
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Jul 11, 2021
1 parent dd6581c commit 3cd81e4
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 14 deletions.
2 changes: 2 additions & 0 deletions POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
move-osd-windows@maestroschan.fr/prefs.js

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-13 12:23+0200\n"
"POT-Creation-Date: 2021-07-11 18:35+0200\n"
"PO-Revision-Date: 2017-06-03 23:39+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 1.8.11\n"

#: prefs.js:35
msgid "Horizontal position (percentage) :"
msgstr "Position horizontale (pourcentage) :"
#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Horizontal position (percentage)"
msgstr "Position horizontale (pourcentage)"

#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Vertical position (percentage)"
msgstr "Position verticale (pourcentage)"

#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Hide totally OSD windows"
msgstr "Masquer complètement ces fenêtres"

#: prefs.js:56
msgid "Vertical position (percentage) :"
msgstr "Position verticale (pourcentage) :"
14 changes: 9 additions & 5 deletions move-osd-windows@maestroschan.fr/locale/move-osd-windows.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-13 12:23+0200\n"
"POT-Creation-Date: 2021-07-11 18:36+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -17,10 +17,14 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: prefs.js:35
msgid "Horizontal position (percentage) :"
#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Horizontal position (percentage)"
msgstr ""

#: prefs.js:56
msgid "Vertical position (percentage) :"
#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Vertical position (percentage)"
msgstr ""

#: move-osd-windows@maestroschan.fr/prefs.js
msgid "Hide totally OSD windows"
msgstr ""
30 changes: 30 additions & 0 deletions translations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

################################################################################

TRANSLATION_ID="move-osd-windows"

echo "Generating .pot file..."
xgettext --files-from=POTFILES --from-code=UTF-8 --add-location=file --output=$TRANSLATION_ID@maestroschan.fr/locale/$TRANSLATION_ID.pot

################################################################################

IFS='
'
dir_list=`ls ./$TRANSLATION_ID@maestroschan.fr/locale/`
prefix="./$TRANSLATION_ID@maestroschan.fr/locale"

for dir in $dir_list; do
if [ "$dir" != "$TRANSLATION_ID.pot" ]; then
echo "Updating translation for: $dir"
msgmerge --update --previous $prefix/$dir/LC_MESSAGES/$TRANSLATION_ID.po $prefix/$TRANSLATION_ID.pot
echo "Compiling translation for: $dir"
msgfmt $prefix/$dir/LC_MESSAGES/$TRANSLATION_ID.po -o $prefix/$dir/LC_MESSAGES/$TRANSLATION_ID.mo
rm -f "$prefix/$dir/LC_MESSAGES/$TRANSLATION_ID.po~"
fi
done

################################################################################

exit 0

0 comments on commit 3cd81e4

Please sign in to comment.