mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
1) Keep manual translations in lib/layouttranslations
2) Fix ia translations (for some reason it was a copy of it) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38031 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
276596105f
commit
b6262f5865
@ -1,6 +1,6 @@
|
|||||||
# This file has been automatically generated by po/lyx_pot.py.
|
# This file has been automatically generated by po/lyx_pot.py.
|
||||||
# PLEASE DO NOT MODIFY ANYTHING HERE! If you want to regenerate this file
|
# PLEASE MODIFY ONLY THE LAGUAGES HAVING NO .po FILE! If you want to regenerate
|
||||||
# from the translations, run `make ../lib/layouttranslations' in po.
|
# this file from the translations, run `make ../lib/layouttranslations' in po.
|
||||||
|
|
||||||
Translation ar
|
Translation ar
|
||||||
"Algorithm" "الخوارزم"
|
"Algorithm" "الخوارزم"
|
||||||
@ -474,45 +474,38 @@ Translation hu
|
|||||||
End
|
End
|
||||||
|
|
||||||
Translation ia
|
Translation ia
|
||||||
"Acknowledgement" "Riconoscimento"
|
"Acknowledgement" "Recognoscentia"
|
||||||
"Algorithm" "Algoritmo"
|
"Algorithm" "Algorithmo"
|
||||||
"Assumption" "Assunzione"
|
"Axiom" "Axioma"
|
||||||
"Axiom" "Assioma"
|
|
||||||
"Case" "Caso"
|
"Case" "Caso"
|
||||||
"Chart" "Diagramma"
|
"Chart" "Diagramma"
|
||||||
"Claim" "Asserzione"
|
"Claim" "Assertion"
|
||||||
"Conclusion" "Conclusione"
|
"Conjecture" "Conjectura"
|
||||||
"Condition" "Condizione"
|
|
||||||
"Conjecture" "Congettura"
|
|
||||||
"Corollary" "Corollario"
|
"Corollary" "Corollario"
|
||||||
"Criterion" "Criterio"
|
"Criterion" "Criterio"
|
||||||
"Definition" "Definizione"
|
"Example" "Exemplo"
|
||||||
"Example" "Esempio"
|
"Exercise" "Exercitio"
|
||||||
"Exercise" "Esercizio"
|
"Fact" "Facto"
|
||||||
"Fact" "Fatto"
|
|
||||||
"Figure" "Figura"
|
"Figure" "Figura"
|
||||||
"Graph" "Grafico"
|
"Graph" "Graphico"
|
||||||
"List of Algorithms" "Elenco degli algoritmi|a"
|
"List of Algorithms" "Lista del algorithmos"
|
||||||
"List of Charts" "Elenco dei diagrammi"
|
"List of Charts" "Lista de diagrammas"
|
||||||
"List of Figures" "Elenco delle figure"
|
"List of Figures" "Lista de figuras"
|
||||||
"List of Graphs" "Elenco dei grafici"
|
"List of Graphs" "Lista de graphicos"
|
||||||
"List of Schemes" "Elenco degli schemi"
|
"List of Schemes" "Lista de schemas"
|
||||||
"List of Tableaux" "Elenco dei tableau"
|
"List of Tableaux" "Lista de tableau"
|
||||||
"List of Tables" "Elenco delle tabelle"
|
"List of Tables" "Lista de tabellas"
|
||||||
"MarginFigure" "Figura a margine"
|
"MarginFigure" "Figura a margine"
|
||||||
"MarginTable" "Tabella a margine"
|
"MarginTable" "Tabella a margine"
|
||||||
"Notation" "Notazione"
|
|
||||||
"Note" "Nota"
|
"Note" "Nota"
|
||||||
"Plate" "Foglio"
|
"Plate" "Folio"
|
||||||
"Problem" "Problema"
|
"Problem" "Problema"
|
||||||
"Proof" "Dimostrazione"
|
"Proof" "Demonstration"
|
||||||
"Proposition" "Proposizione"
|
"Remark" "Observation"
|
||||||
"Question" "Questione"
|
|
||||||
"Remark" "Osservazione"
|
|
||||||
"Scheme" "Schema"
|
"Scheme" "Schema"
|
||||||
"Summary" "Sommario"
|
"Summary" "Summario"
|
||||||
"Table" "Tabella"
|
"Table" "Tabella"
|
||||||
"Theorem" "Teorema"
|
"Theorem" "Theorema"
|
||||||
End
|
End
|
||||||
|
|
||||||
Translation id
|
Translation id
|
||||||
|
@ -78,7 +78,6 @@ def ui_l10n(input_files, output, base):
|
|||||||
|
|
||||||
def layouts_l10n(input_files, output, base, layouttranslations):
|
def layouts_l10n(input_files, output, base, layouttranslations):
|
||||||
'''Generate pot file from lib/layouts/*.{layout,inc,module}'''
|
'''Generate pot file from lib/layouts/*.{layout,inc,module}'''
|
||||||
out = open(output, 'w')
|
|
||||||
Style = re.compile(r'^Style\s+(.*)', re.IGNORECASE)
|
Style = re.compile(r'^Style\s+(.*)', re.IGNORECASE)
|
||||||
# include ???LabelString???, but exclude comment lines
|
# include ???LabelString???, but exclude comment lines
|
||||||
LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*)')
|
LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*)')
|
||||||
@ -100,19 +99,61 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
Float = re.compile(r'\s*Float')
|
Float = re.compile(r'\s*Float')
|
||||||
End = re.compile(r'\s*End')
|
End = re.compile(r'\s*End')
|
||||||
Comment = re.compile(r'\s*#')
|
Comment = re.compile(r'\s*#')
|
||||||
|
Translation = re.compile(r'\s*Translation\s+(.*)\s*$')
|
||||||
|
KeyValPair = re.compile(r'\s*"(.*)"\s+"(.*)"')
|
||||||
|
|
||||||
|
oldlanguages = []
|
||||||
languages = []
|
languages = []
|
||||||
keyset = set()
|
keyset = set()
|
||||||
|
oldtrans = dict()
|
||||||
if layouttranslations:
|
if layouttranslations:
|
||||||
linguas_file = os.path.join(base, 'po/LINGUAS')
|
linguas_file = os.path.join(base, 'po/LINGUAS')
|
||||||
for line in open(linguas_file).readlines():
|
for line in open(linguas_file).readlines():
|
||||||
if Comment.search(line) == None:
|
if Comment.search(line) == None:
|
||||||
languages.extend(line.split())
|
languages.extend(line.split())
|
||||||
# walon is not a known document language
|
|
||||||
# FIXME: Do not hardcode, read from lib/languages!
|
|
||||||
if 'wa' in languages:
|
|
||||||
languages.remove('wa')
|
|
||||||
|
|
||||||
|
# read old translations if available
|
||||||
|
try:
|
||||||
|
input = open(output)
|
||||||
|
lang = ''
|
||||||
|
for line in input.readlines():
|
||||||
|
res = Comment.search(line)
|
||||||
|
if res:
|
||||||
|
continue
|
||||||
|
if line.strip() == '':
|
||||||
|
continue
|
||||||
|
res = Translation.search(line)
|
||||||
|
if res:
|
||||||
|
lang = res.group(1)
|
||||||
|
if lang not in languages:
|
||||||
|
oldlanguages.append(lang)
|
||||||
|
languages.append(lang)
|
||||||
|
oldtrans[lang] = dict()
|
||||||
|
continue
|
||||||
|
res = End.search(line)
|
||||||
|
if res:
|
||||||
|
lang = ''
|
||||||
|
continue
|
||||||
|
res = KeyValPair.search(line)
|
||||||
|
if res and lang != '':
|
||||||
|
key = res.group(1).decode('utf-8')
|
||||||
|
val = res.group(2).decode('utf-8')
|
||||||
|
key = key.replace('\\"', '"').replace('\\\\', '\\')
|
||||||
|
val = val.replace('\\"', '"').replace('\\\\', '\\')
|
||||||
|
oldtrans[lang][key] = val
|
||||||
|
keyset.add(key)
|
||||||
|
continue
|
||||||
|
print "Error: Unable to handle line:"
|
||||||
|
print line
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# walon is not a known document language
|
||||||
|
# FIXME: Do not hardcode, read from lib/languages!
|
||||||
|
if 'wa' in languages:
|
||||||
|
languages.remove('wa')
|
||||||
|
|
||||||
|
out = open(output, 'w')
|
||||||
for src in input_files:
|
for src in input_files:
|
||||||
readingDescription = False
|
readingDescription = False
|
||||||
readingI18nPreamble = False
|
readingI18nPreamble = False
|
||||||
@ -253,29 +294,39 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
keys.sort()
|
keys.sort()
|
||||||
|
|
||||||
print >> out, '''# This file has been automatically generated by po/lyx_pot.py.
|
print >> out, '''# This file has been automatically generated by po/lyx_pot.py.
|
||||||
# PLEASE DO NOT MODIFY ANYTHING HERE! If you want to regenerate this file
|
# PLEASE MODIFY ONLY THE LAGUAGES HAVING NO .po FILE! If you want to regenerate
|
||||||
# from the translations, run `make ../lib/layouttranslations' in po.'''
|
# this file from the translations, run `make ../lib/layouttranslations' in po.'''
|
||||||
for lang in languages:
|
for lang in languages:
|
||||||
print >> out, '\nTranslation %s' % lang
|
print >> out, '\nTranslation %s' % lang
|
||||||
poname = os.path.join(base, 'po/' + lang + '.po')
|
if lang in oldtrans.keys():
|
||||||
po = polib.pofile(poname)
|
trans = oldtrans[lang]
|
||||||
# Iterate through po entries and not keys for speed reasons.
|
else:
|
||||||
# FIXME: The code is still too slow
|
trans = dict()
|
||||||
trans = dict()
|
if not lang in oldlanguages:
|
||||||
for entry in po:
|
poname = os.path.join(base, 'po/' + lang + '.po')
|
||||||
if not entry.translated():
|
po = polib.pofile(poname)
|
||||||
continue
|
# Iterate through po entries and not keys for speed reasons.
|
||||||
if entry.msgid in keys:
|
# FIXME: The code is still too slow
|
||||||
key = entry.msgid.replace('\\', '\\\\').replace('"', '\\"')
|
for entry in po:
|
||||||
val = entry.msgstr.replace('\\', '\\\\').replace('"', '\\"')
|
if not entry.translated():
|
||||||
# some translators keep untranslated entries
|
continue
|
||||||
if val != key:
|
if entry.msgid in keys:
|
||||||
trans[key] = val
|
key = entry.msgid
|
||||||
|
val = entry.msgstr
|
||||||
|
# some translators keep untranslated entries
|
||||||
|
if val != key:
|
||||||
|
trans[key] = val
|
||||||
for key in keys:
|
for key in keys:
|
||||||
if key in trans.keys():
|
if key in trans.keys():
|
||||||
val = trans[key]
|
val = trans[key].replace('\\', '\\\\').replace('"', '\\"')
|
||||||
|
key = key.replace('\\', '\\\\').replace('"', '\\"')
|
||||||
print >> out, '\t"%s" "%s"' % \
|
print >> out, '\t"%s" "%s"' % \
|
||||||
(key.encode('utf-8'), val.encode('utf-8'))
|
(key.encode('utf-8'), val.encode('utf-8'))
|
||||||
|
# to print untranslated entries, uncomment the following lines
|
||||||
|
#else:
|
||||||
|
# key = key.replace('\\', '\\\\').replace('"', '\\"')
|
||||||
|
# print >> out, '\t"%s" "%s"' % \
|
||||||
|
# (key.encode('utf-8'), key.encode('utf-8'))
|
||||||
print >> out, 'End'
|
print >> out, 'End'
|
||||||
|
|
||||||
out.close()
|
out.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user