Changeset 1666 for pyromaths/trunk


Ignore:
Timestamp:
May 24, 2016, 12:50:01 PM (3 years ago)
Author:
jrpelegrina
Message:

Fix script to tooltip ex

Location:
pyromaths/trunk/fuentes/src/pyromaths/ex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pyromaths/trunk/fuentes/src/pyromaths/ex/__init__.py

    r423 r1666  
    77import types
    88import sys
     9import locale
    910
    1011class Exercise(object):
     
    2526    def thumb(cls):
    2627        from pyromaths.Values import data_dir
    27         return os.path.join(data_dir(), 'ex', cls.dirlevel, 'img', "%s.png" % cls.name())
     28        langue = locale.getdefaultlocale()[0][0:2]
     29
     30        pathimgs = os.path.join(data_dir(), 'ex', cls.dirlevel, 'img')
     31        if os.path.join(pathimgs,langue):
     32            folder = os.path.join(pathimgs,langue)
     33        else:
     34            folder = os.path.join(pathimgs,'default')
     35
     36        return os.path.join(folder, '%s.png' % (cls.name()))
    2837
    2938    @classmethod
  • pyromaths/trunk/fuentes/src/pyromaths/ex/sixiemes/decimaux.py

    r1653 r1666  
    2424import random
    2525import os
     26import locale
    2627from pyromaths.outils import Affichage, Arithmetique
    2728#===============================================================================
     
    417418def EcrireNombreLettre():
    418419
    419     langue = os.getenv('LANG')
    420 
     420    langue = locale.getdefaultlocale()[0][0:2]
    421421    if langue == "fr" or langue == "":
    422422        lang = ""
    423423    else:
    424         lang = "_" + langue[0:2]
     424        lang = "_" + langue
    425425        try:
    426426            eval('EcritNombreDecimal'+lang+'(1)')
Note: See TracChangeset for help on using the changeset viewer.