Subversion Repositories svn LFS-FR

Compare Revisions

Ignore whitespace Rev 7136 → Rev 7137

/branches/BLFS_po_dev/tools/Makefile
70,6 → 70,11
sed -i -e 's|<book>|<book lang="fr">|g' \
-e 's|encoding="ISO-8859-1"|encoding="UTF-8"|g' -i $@
 
$(GENDIR)/general/progs/perl-modules.xml: $(ORIGDIR)/general/progs/perl-modules.xml $(PODIR)/general/progs/perl-modules.po $(GENDIR)
po4a-translate -k 0 -f docbook -m $< -l $@ -p $(word 2,$^) -M ascii -L UTF-8
sed -e 's|build and installation instructions|instructions de configuration et d\'installaton|g' \
-i $@
 
$(GENDIR)/images: images $(GENDIR)
rm -rf $@
cp -r $< $(GENDIR)
/branches/BLFS_po_dev/tools/changelogtranslator.py
0,0 → 1,59
#!/usr/bin/python3
# -*- coding: utf-8 -*-
 
# Template Translator v0.1
# Traduit automatiquement certaines chaine de caractères des paquets
 
# Publié par roptat <julien@lepiller.eu> le 8 août 2016
# sous la licence gnu General Public License version 3 pubilée par la Free Software Foundation.
# Visitez <http://www.gnu.org/licenses/> pour obtenir la licence.
 
 
import sys
import re
import polib
 
files = sys.argv
files.pop(0)
 
def convert(entry, regexp, template):
m = regexp.match(entry.msgid)
# do not modify anything if the translation is already correct
if m and ("fuzzy" in entry.flags or not entry.msgstr):
msgstr = template
try:
msgstr = msgstr.replace("#1", m.group(1))
msgstr = msgstr.replace('#2', m.group(2))
msgstr = msgstr.replace('#3', m.group(3))
msgstr = msgstr.replace('#4', m.group(4))
except:
x=1
entry.msgstr = msgstr
# not too sure yet if we can trust this script enough to mark a translation done.
#entry.flags.remove("fuzzy")
 
 
 
# regexps
regexps = []
 
regexps.append([re.compile('\[([^\]]+)\] - Update to ([^ ]+). Fixes (<ulink [^>]+>#[0-9]+</ulink>).$', re.MULTILINE|re.DOTALL), '[#1] - Mise à jour vers #2. Corrige #3'])
 
 
 
#regexps.append([re.compile('$'), ''])
 
number = len(files)
current = 1
 
for filename in files:
print('Traitement du fichier ', current, '/', number, ' \r',
end="", flush=True),
current = current + 1
po = polib.pofile(filename)
for entry in po:
for reg in regexps:
convert(entry, reg[0], reg[1])
po.save()
print('')
 
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property