diff --git a/src/Messages.sh b/src/Messages.sh --- a/src/Messages.sh +++ b/src/Messages.sh @@ -8,3 +8,17 @@ # create a pot for the voices text to keep them up-to-date with the audio files grep -R "intro: " --include="ActivityInfo.qml" | awk -F'[:/]' '{print "//i18n: intro voices, see GCompris-voices/README.md - activity: \""$2"\"\ni18n("$7");"}' | $XGETTEXT - -o $podir/gcompris_voices.pot +# create a pot for the lang dataset to keep them up-to-date with inner json files +# it parses the activities/lang/resource/words.json file and for each triplet: +# "description": "alphabet", +# "image": "words/alphabet.png", +# "voice": "voices-$CA/$LOCALE/words/alphabet.$CA" +# write a translator comment containing the description and the corresponding image +# and let the translation to be the voice (just the word, not the full path). +# For above: +# #. i18n: lang dataset - description:"alphabet", corresponding image: https://www.gcompris.net/incoming/lang/lang/words/alphabet.png +#: standard input:2 +# msgid "alphabet" +# msgstr "" +lang_dataset=$(find . -type f -iname "words.json"); +awk '/"description"/{ desc = $2; } /"image"/ { gsub(/"/, "", $2);gsub(/,/, "", $2);img = $2 } /"voice"/ { gsub ("voices.\\$CA/\\$LOCALE/[a-z]*/", "", $2);gsub (".\\$CA", "", $2);print "//i18n: lang dataset - description:"desc, "corresponding image:", "https://www.gcompris.net/incoming/lang/lang/"img "\ni18n(", $2,")" }' $lang_dataset | $XGETTEXT - -o $podir/gcompris_lang.pot