Language correct date&time display in python plugins via setlocale() function
-
ThE MaStEr
2012-03-19
-
Hi,
I have made shell script which enables installing locale files which are needed for correct languge:
string comparison (LC_COLLATE)
lower & upper string conversion, isupper & islower testing (LC_CTYPE)
monetary formatting (LC_MONETARY)
decimal separator (LC_NUMERIC)
date & time formating (LC_TIME)
After installing locale files for your Language you can use all "language critical" functions in your python scripts (converters, renderers, plugins, etc.)
All you need is to run locale_files.sh script, then you have to set proper language locale argument in the setlocale() function in some python files as you can see below:
كود PHP:
def __init__(self, type):
try:
setlocale(LC_ALL, language.getLanguage())
except:
pass
For example, you can see my small modification of the ClockToText.py converter which enables to display date/time string according to user language localization.
DDD-dm8000-v2.5-OE1.6
Minicats Key Bundle 03-11-2011
تحميل ايميوهات صورة openATV , تحميل openATV Softcam Collection
Merlin-3-dm800se-Sunray-sr4-2011-12-31-ramiMAHER #ssl84b
OE-2.0 Merlin-3 DM800se 12/12/2012
Power of Dream HD OE 1.6 CrossEPG Edition for DM500HD 06-05-2011
ciefpsettings E1 & E2 16.06.2012
شيفرة جديد MNC tv palapa D 113°E بتاريخ اليوم 18-09-2011
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.