aboutsummaryrefslogblamecommitdiff
path: root/scripts/extract-translations.sh
blob: 61663b8ddaf0ff1751b5e31f02b1e1b63009db05 (plain) (tree)
1
2
3
4
5
6
7
8
9

         
 
                       
 
                                                                                     
                                                          

                                  
                                         
                                  
                                                                         


        
#!/bin/sh
set -eu

TRANSLATIONS='pt fr eo'

for f in $(git ls-files | grep -E '.(md|slides)$' | grep -v '^vendor/reveal.js$'); do
  file_lang="$(grep '^lang: ..$' "$f" | awk '{print $2}')"
  if [ "$file_lang" = 'en' ]; then
    for l in $TRANSLATIONS; do
      OUT="po/$l/LC_MESSAGES/${f%.md}.po"
      mkdir -p "$(dirname "$OUT")"
      md2po "$f" --include-codeblocks --quiet --save --po-filepath "$OUT"
    done
  fi
done