Commit 8bdbe948 authored by Kuato's avatar Kuato
Browse files

traduction et correcion de bugs

parent 4de3945e
# Spanish translations for PACKAGE package.
# Copyright (C) 2013 ORGANIZATION
# Administrador <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: Pyromaths 13.03\n"
"POT-Creation-Date: 2013-06-06 19:12+Hora de verano romance\n"
"PO-Revision-Date: 2013-06-08 20:00+0100\n"
"Last-Translator: Jose Antonio Martinez Chico <jkuato@hotmail.com>\n"
"Language-Team: Jérôme Ortais <jerome.ortais@pyromaths.org>\n"
"Language: spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: Arithmetique.py:98
msgid " \\times "
msgstr " \\cdot "
#: Arithmetique.py:104
msgid " est un nombre premier.\\par "
msgstr " es un número primo.\\par "
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-06-08 19:59+Hora de verano romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: Arithmetique.py:98
msgid " \\times "
msgstr ""
#: Arithmetique.py:104
msgid " est un nombre premier.\\par "
msgstr ""
......@@ -95,13 +95,13 @@ def factoriseTex(n):
text = ' & = '
for j in range(len(etapes[i])):
if j != len(etapes[i]) - 1:
text += etapes[i][j] + ' \\times '
text += etapes[i][j] + _(' \\times ')
else:
text += etapes[i][j]
corrige.append(text + '\\\\')
corrige.append("\\end{align*}")
else:
corrige = [str(n) + " est un nombre premier.\\par "]
corrige = [str(n) + _(" est un nombre premier.\\par ")]
return (primes, corrige)
......
# Spanish translations for PACKAGE package.
# Copyright (C) 2013 ORGANIZATION
# Administrador <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: Pyromaths 13.03\n"
"POT-Creation-Date: 2013-06-06 19:12+Hora de verano romance\n"
"PO-Revision-Date: 2013-06-08 20:05+0100\n"
"Last-Translator: Jose Antonio Martinez Chico <jkuato@hotmail.com>\n"
"Language-Team: Jérôme Ortais <jerome.ortais@pyromaths.org>\n"
"Language: spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: Fractions.py:49 Fractions.py:51 Fractions.py:67
msgid "%s%s \\times %s%s"
msgstr "%s%s\\, \\cdot \\, %s%s"
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-06-08 20:04+Hora de verano romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: Fractions.py:49 Fractions.py:51 Fractions.py:67
msgid "%s%s \\times %s%s"
msgstr ""
......@@ -46,9 +46,9 @@ def EffectueProduitFractions(fr1, fr2, pre, post):
cor = []
if fr1.n and fr2.n:
if abs(fr1s.d) < abs(fr1.d) or abs(fr2s.d) < abs(fr2.d):
cor.append("%s%s \\times %s%s" % (pre, Fractions.TeXSimplifie(fr1),
cor.append(_("%s%s \\times %s%s") % (pre, Fractions.TeXSimplifie(fr1),
Fractions.TeXSimplifie(fr2), post))
cor.append("%s%s \\times %s%s" % (pre, Fractions.TeX(fr1s,
cor.append(_("%s%s \\times %s%s") % (pre, Fractions.TeX(fr1s,
True), Fractions.TeX(fr2s, True), post))
fr = fr1s * fr2s
frs = Fractions.simplifie(fr)
......@@ -64,7 +64,7 @@ def EffectueProduitFractions(fr1, fr2, pre, post):
def EffectueQuotientFractions(fr1, fr2, pre, post):
fr2 = Fractions(1, 1) / fr2
cor = ["%s%s \\times %s%s" % (pre, Fractions.TeX(fr1, True),
cor = [_("%s%s \\times %s%s") % (pre, Fractions.TeX(fr1, True),
Fractions.TeX(fr2, True), post)]
cor.extend(EffectueProduitFractions(fr1, fr2, pre, post))
return cor
......
# Spanish translations for PACKAGE package.
# Copyright (C) 2013 ORGANIZATION
# Administrador <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: Pyromaths 13.03\n"
"POT-Creation-Date: 2013-06-06 19:12+Hora de verano romance\n"
"PO-Revision-Date: 2013-06-08 20:16+0100\n"
"Last-Translator: Jose Antonio Martinez Chico <jkuato@hotmail.com>\n"
"Language-Team: Jérôme Ortais <jerome.ortais@pyromaths.org>\n"
"Language: spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: Polynomes.py:55
msgid ""
"\n"
" On a $$"
msgstr ""
"\n"
" Entonces $$"
#: Polynomes.py:55
msgid "\\right) \\times \\left("
msgstr "\\right) \\cdot \\left("
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-06-08 20:15+Hora de verano romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: Polynomes.py:55
msgid ""
"\n"
" On a $$"
msgstr ""
#: Polynomes.py:55
msgid "\\right) \\times \\left("
msgstr ""
......@@ -52,7 +52,7 @@ def TeX_division(dividende,diviseur):
string+= "\\\\ \n"
string+= "\\end{array}\n$$"
string+="\n On a $$"+dividende.TeX()+" = \\left(" + texquotient.TeX()+"\\right) \\times \\left("+diviseur.TeX()+"\\right)"
string+=_("\n On a $$")+dividende.TeX()+" = \\left(" + texquotient.TeX()+_("\\right) \\times \\left(")+diviseur.TeX()+"\\right)"
if restera!=Polynome(0):
if len(restera.puiss)==1 and restera[restera.deg]>0:#monome
string +="+"+restera.TeX()
......@@ -60,6 +60,7 @@ def TeX_division(dividende,diviseur):
string+="+\\left("+restera.TeX()+"\\right)"
string+="$$"
return string
def tab_print(polynome,longueur=0,parenthese=False,debut=0):
'''utilisé par TeX_division pour décaler le reste dans la partie gauche'''
degre=polynome.degre_max+debut
......@@ -117,7 +118,10 @@ def poly_racines_fractionnaires(rac_min,rac_max,denom1,X):
pol2=pol2.simplifie()
simplifie=abs(pgcd(pgcd(int(pol2[0]),int(pol2[1])),int(pol2[2])))
pol2= pol2/simplifie
return pol2.simplifie()
pol2=pol2.simplifie()
pol2.var = X.var
return pol2
def poly_racines_entieres(rac_min,rac_max,X,a1=1):
while 1:
......
......@@ -137,10 +137,10 @@ def priorites_operations(calcul, pre = "", post = "", solution = []):
for element in priorites("(2-5)**2+(5-2)**3+((3*4+5)*2+3*(32-5*7)**2)*5+17*(12-3*5)"):
print element
print priorites("(((-1)+(-2))+(+3))")
print priorites("4-((-1+-2)+3)")
print priorites('8-(-5*(2-4))')
print priorites("1+2+3+4")
print priorites("(-3)**(+2)")
print priorites("9+8*7")
print priorites("8+1.3e+2")
#print priorites("((-(-1)+-2)++3)")
#print priorites("4-((-1+-2)+3)")
#print priorites('8-(-5*(2-4))')
#print priorites("1+2+3+4")
#print priorites("-3**+2")
#print priorites("9+8*7")
#print priorites("8+1.3e+2")
# Spanish translations for PACKAGE package.
# Copyright (C) 2013 ORGANIZATION
# Administrador <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: Pyromaths 13.03\n"
"POT-Creation-Date: 2013-06-06 19:12+Hora de verano romance\n"
"PO-Revision-Date: 2013-06-08 20:23+0100\n"
"Last-Translator: Jose Antonio Martinez Chico <jkuato@hotmail.com>\n"
"Language-Team: Jérôme Ortais <jerome.ortais@pyromaths.org>\n"
"Language: spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: Priorites3.py:428
msgid "\\times "
msgstr "\\, \\cdot \\, "
#: Priorites3.py:429
msgid "\\div "
msgstr "\\, : \\, "
#: Priorites3.py:503
msgid " en %s étapes"
msgstr " en la %s etapa"
#: Priorites3.py:503
msgid "%s ème calcul"
msgstr "%s º cálculo "
#: Priorites3.py:511
msgid " : %s ème calcul en %s étapes"
msgstr " : %s º cálculo en la %s etapa"
#: Priorites3.py:525
msgid "Devrait être : "
msgstr "Debería ser : "
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-06-08 20:21+Hora de verano romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: Priorites3.py:428
msgid "\\times "
msgstr ""
#: Priorites3.py:429
msgid "\\div "
msgstr ""
#: Priorites3.py:503
msgid " en %s \303\251tapes"
msgstr ""
#: Priorites3.py:503
msgid "%s \303\250me calcul"
msgstr ""
#: Priorites3.py:511
msgid " : %s \303\250me calcul en %s \303\251tapes"
msgstr ""
#: Priorites3.py:525
msgid "Devrait \303\252tre : "
msgstr ""
......@@ -425,8 +425,8 @@ def texify(liste_calculs):
s = s.replace("**{", "^{")
s = s.replace("(", "\\left( ")
s = s.replace(")", "\\right) ")
s = s.replace("*", "\\times ")
s = s.replace("/", "\\div ")
s = s.replace("*", _("\\times "))
s = s.replace("/", _("\\div "))
if not ls or s != ls[-1]:
ls.append(s)
return ls
......@@ -500,7 +500,7 @@ def test_entiers(nbval, polynomes, entiers):
break
else:
if not polynomes:
print u"%s ème calcul" % (c+1), a, " = ", eval(a), u" en %s étapes"%(len(r))
print _(u"%s ème calcul") % (c+1), a, " = ", eval(a), _(u" en %s étapes")%(len(r))
if eval(a) != eval("".join(r[-1])):
print a, " = ", eval(a)
print r
......@@ -508,7 +508,7 @@ def test_entiers(nbval, polynomes, entiers):
if polynomes:
from sympy import Symbol, expand
x = Symbol('x')
print u" : %s ème calcul en %s étapes" % (c+1, len(r))
print _(u" : %s ème calcul en %s étapes") % (c+1, len(r))
if not len(r):
print a
break
......@@ -522,7 +522,7 @@ def test_entiers(nbval, polynomes, entiers):
print a, "=", t1
print "\n".join(sympyfy(r))
print u"Devrait être : ", eval(t0).expand()
print _(u"Devrait être : "), eval(t0).expand()
break
def sympyfy(liste_calculs):
......@@ -575,8 +575,8 @@ def sympyfy(liste_calculs):
# s = s.replace("(", "\\left( ")
# s = s.replace(")", "\\right) ")
# s = s.replace("**{", "^{")
# s = s.replace("*", "\\times ")
# s = s.replace("/", "\\div ")
# s = s.replace("*", _("\\times "))
# s = s.replace("/", _("\\div "))
if not ls or s != ls[-1]:
ls.append(s)
return ls
......
# Spanish translations for PACKAGE package.
# Copyright (C) 2013 ORGANIZATION
# Administrador <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: Pyromaths 13.03\n"
"POT-Creation-Date: 2013-06-22 14:10+Hora de verano romance\n"
"PO-Revision-Date: 2013-06-22 14:11+0100\n"
"Last-Translator: Jose Antonio Martinez Chico <jkuato@hotmail.com>\n"
"Language-Team: Jérôme Ortais <jerome.ortais@pyromaths.org>\n"
"Language: spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: System.py:66
msgid "exercices"
msgstr "ejercicios"
#: System.py:68
msgid "Fiche de révisions"
msgstr "Ficha de Ejercicios"
#: System.py:80
msgid ""
"Pyromaths est un programme qui permet de générer des fiches d’exercices de "
"mathématiques de collège ainsi que leur corrigé. Il crée des fichiers au "
"format pdf qui peuvent ensuite être imprimés ou lus sur écran."
msgstr ""
"Pyromaths es un programa que permite crear hojas de ejercicios del tipo "
"matemático de nivel escolar con su correción. Crear los ficheros en formato "
"pdf que pueden ser luego impresos o leídos en pantalla."
#: System.py:197
msgid "\\currentpdfbookmark{Le corrigé des exercices}{Corrigé}"
msgstr "\\currentpdfbookmark{Correciones de los ejercicios}{Correción}"
#: System.py:198
msgid ""
"\\lhead{\\textsl{\\footnotesize{Page \\thepage/ \\pageref{LastCorPage}}}}\n"
msgstr ""
"\\lhead{\\textsl{\\footnotesize{Página \\thepage/ \\pageref{LastCorPage}}}}\n"
#: System.py:274
msgid "%s-corrige.tex"
msgstr "%s-solucion.tex"
#: System.py:304
msgid "Le fichier modèle n'a pas été trouvé dans %s"
msgstr "El modelo de página no ha sido encontrado en %s"
#: System.py:311
msgid "\\currentpdfbookmark{Les énoncés des exercices}{Énoncés}"
msgstr "\\currentpdfbookmark{Enunciados de los ejercicios}{Enunciados}"
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-06-22 14:10+Hora de verano romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"
#: System.py:66
msgid "exercices"
msgstr ""
#: System.py:68
msgid "Fiche de r\303\251visions"
msgstr ""
#: System.py:80
msgid "Pyromaths est un programme qui permet de g\303\251n\303\251rer des fiches d\342\200\231exercices de math\303\251matiques de coll\303\250ge ainsi que leur corrig\303\251. Il cr\303\251e des fichiers au format pdf qui peuvent ensuite \303\252tre imprim\303\251s ou lus sur \303\251cran."
msgstr ""
#: System.py:197
msgid "\\currentpdfbookmark{Le corrig\303\251 des exercices}{Corrig\303\251}"
msgstr ""
#: System.py:198
msgid ""
"\\lhead{\\textsl{\\footnotesize{Page \\thepage/ \\pageref{LastCorPage}}}}\n"
msgstr ""
#: System.py:274
msgid "%s-corrige.tex"
msgstr ""
#: System.py:304
msgid "Le fichier mod\303\250le n'a pas \303\251t\303\251 trouv\303\251 dans %s"
msgstr ""
#: System.py:311
msgid "\\currentpdfbookmark{Les \303\251nonc\303\251s des exercices}{\303\211nonc\303\251s}"
msgstr ""
......@@ -26,6 +26,7 @@ from lxml import etree
from lxml import _elementpath as DONTUSE # Astuce pour inclure lxml dans Py2exe
from re import findall
from .TexFiles import mise_en_forme
import gettext
#==============================================================
......@@ -48,29 +49,41 @@ def ajoute_extension(filename, ext):
#==============================================================
# Gestion du fichier de configuration de Pyromaths
#==============================================================
def create_config_file():
def create_config_file(HOME, DIR_LANG, LANG_NOM, LANG):
"""Crée le fichier de configuration au format xml"""
from ..Values import HOME
if LANG != "0":
gettext_lang = gettext.translation("pyromaths", DIR_LANG, languages=[LANG_NOM[int(LANG)][0]])
gettext_lang.install(unicode=True)
else:
gettext_lang = gettext.NullTranslations()
gettext_lang.install()
from ..Values import VERSION, WEBSITE
root = etree.Element("pyromaths")
child = etree.SubElement(root, "options")
etree.SubElement(child, "nom_fichier").text="exercices"
etree.SubElement(child, "nom_fichier").text=_("exercices")
etree.SubElement(child, "chemin_fichier").text="%s" % HOME
etree.SubElement(child, "titre_fiche").text=u"Fiche de révisions"
etree.SubElement(child, "titre_fiche").text=_(u"Fiche de révisions")
etree.SubElement(child, "corrige").text="True"
etree.SubElement(child, "pdf").text="True"
etree.SubElement(child, "unpdf").text="False"
etree.SubElement(child, "modele").text="pyromaths.tex"
if LANG != "0":
etree.SubElement(child, "modele").text="pyromaths_%s.tex" %LANG_NOM[int(LANG)][0]
else:
etree.SubElement(child, "modele").text="pyromaths.tex"
etree.SubElement(child, "langue").text=str(LANG)
child = etree.SubElement(root, "informations")
etree.SubElement(child, "version").text="10.10"
etree.SubElement(child, "description").text=u"Pyromaths est un programme qui permet de générer des fiches d’exercices de mathématiques de collège ainsi que leur corrigé. Il crée des fichiers au format pdf qui peuvent ensuite être imprimés ou lus sur écran."
etree.SubElement(child, "version").text=str(VERSION)
etree.SubElement(child, "description").text=_(u"Pyromaths est un programme qui permet de générer des fiches d’exercices de mathématiques de collège ainsi que leur corrigé. Il crée des fichiers au format pdf qui peuvent ensuite être imprimés ou lus sur écran.")
etree.SubElement(child, "icone").text="pyromaths.ico"
subchild= etree.SubElement(child, "auteur")
etree.SubElement(subchild, "nom").text=u"Jérôme Ortais"
etree.SubElement(subchild, "email").text=u"jerome.ortais@pyromaths.org"
etree.SubElement(subchild, "site").text="http://www.pyromaths.org"
etree.SubElement(subchild, "site").text=unicode(WEBSITE)
return etree.tostring(root, pretty_print=True, encoding=unicode)
......@@ -93,13 +106,13 @@ def indent(elem, level=0):
elem.tail = i
return elem
def modify_config_file(file):
def modify_config_file(file, HOME, CONFIGDIR, DIR_LANG, LANG_NOM):
"""Modifie le fichier de configuration si besoin, excepté les options utilisateur déjà configurées"""
from ..Values import CONFIGDIR
modifie = False
oldtree = etree.parse(file)
oldroot = oldtree.getroot()
newroot = etree.XML(create_config_file())
LANG = oldroot.find('options').find('langue').text
newroot = etree.XML(create_config_file(HOME, DIR_LANG, LANG_NOM, LANG))
for element in newroot.iter(tag=etree.Element):
if not len(element):
parents = [element]
......@@ -131,6 +144,13 @@ def modify_config_file(file):
f.write(etree.tostring(indent(oldroot), pretty_print=True, encoding=unicode))
f.close()
if LANG != "0":
gettext_lang = gettext.translation("pyromaths", DIR_LANG, languages=[LANG_NOM[int(LANG)][0]])
gettext_lang.install(unicode=True)
else:
gettext_lang = gettext.NullTranslations()
gettext_lang.install()
#==============================================================
# Créer et lance la compilation des fichiers TeX
#==============================================================
......@@ -143,6 +163,7 @@ def creation(parametres):
'creer_unpdf': self.checkBox_unpdf.isChecked() and self.checkBox_unpdf.isEnabled(),
'titre': unicode(self.lineEdit_titre.text()),
'niveau': unicode(self.comboBox_niveau.currentText()),
'langue': self.LANG_NOM[int(self.LANG)][0]
}"""
exo = unicode(parametres['fiche_exo'])
cor = unicode(parametres['fiche_cor'])
......@@ -164,14 +185,17 @@ def creation(parametres):
from ..lycee import lycee
fonction = {0: sixiemes, 1: cinquiemes, 2: quatriemes, 3: troisiemes,
4: lycee}
fonction[exercice[0]].main(exercice[1], f0, f1)
if exercice == (0, 1):
fonction[exercice[0]].main(exercice[1], f0, f1, parametres['langue'])
else:
fonction[exercice[0]].main(exercice[1], f0, f1)
if parametres['creer_pdf']:
if parametres['creer_unpdf']:
f0.write("\\label{LastPage}\n")
f0.write("\\newpage\n")
f0.write(u"\\currentpdfbookmark{Le corrigé des exercices}{Corrigé}")
f0.write("\\lhead{\\textsl{\\footnotesize{Page \\thepage/ \\pageref{LastCorPage}}}}\n")
f0.write(_(u"\\currentpdfbookmark{Le corrigé des exercices}{Corrigé}"))
f0.write(_(u"\\lhead{\\textsl{\\footnotesize{Page \\thepage/ \\pageref{LastCorPage}}}}\n"))
f0.write("\\setcounter{page}{1} ")
f0.write("\\setcounter{exo}{0}\n")
f1.write("\\label{LastCorPage}\n")
......@@ -247,7 +271,7 @@ def creation(parametres):
else:
os.system('xdg-open %s.pdf' % f1noext)
else:
os.remove('%s-corrige.tex' % f0noext)
os.remove(_('%s-corrige.tex') % f0noext)
def nettoyage(basefilename):
"""Supprime les fichiers temporaires créés par LaTeX"""
......@@ -277,14 +301,14 @@ def copie_tronq_modele(dest, parametres, master):
source = os.path.join(parametres['datadir'], 'templates', source)
else:
#TODO: Message d'erreur, le modèle demandé n'existe pas
print(u"Le fichier modèle n'a pas été trouvé dans %s" %
print(_(u"Le fichier modèle n'a pas été trouvé dans %s") %
os.path.join(parametres['datadir'], 'templates'))
## Les variables à remplacer :
titre = parametres['titre']