#!/usr/bin/env bash # author: Lilian BESSON # email: Lilian.BESSON[AT]ens-cachan[DOT]fr # date: 23-07-2014 # web: https://bitbucket.org/lbesson/bin/src/master/fr2en_tex.sh # # A small script to translate latex documents from French to English. # The goal is to translate only the text content, not the latex code parts. # # Requires: # # Licence: GPL v3 # version='0.1' LANG='fr' texfile="${1}" file="${texfile%.fr.tex}" potfile="${file}.pot" pofile_fr="${file}.fr.po" pofile_frTOen="${file}.frTOen.po" texfile_en="${file}.en.tex" # http://po4a.alioth.debian.org/man/man7/po4a.7.php ? # https://pypi.python.org/pypi/lingua.autotranslate/0.2.1 ? po4a-gettextize -f latex \ --package-version "0.1" --package-name "MA 101 at MEC" \ --copyright-holder "Lilian Besson" \ --msgid-bugs-address jarvis.spam@laposte.net \ -M utf-8 \ -m "$texfile" -p "$pofile_fr" po_translate.py "$pofile_fr" "$pofile_frTOen" # subl "$potfile" read po4a-translate -f latex \ -M utf-8 \ -m "$texfile" -p "$pofile_frTOen" \ -l "$texfile_en" # END