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

Fix script to tooltip ex

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.