I have problems to get translations with MO files.
Config:
...
'sourceLanguage'=>'en_gb',
'language'=>'es_es',
...
'messages'=>array(
'class'=>'CGettextMessageSource',
'catalog'=>'messages',
'cachingDuration'=>'3600',
),
...I have this MO file in /protected/messages/es_es/messages.mo
Trying to solve the problem I fond that CGettextMoFile reads the file but fail in this if (Line 116):
if(($pos=strpos($id,chr(4)))!==false && substr($id,0,$pos)===$context)
$pos = empty - $context = empty
To solve the problem i change this line to this:
$pos=strpos($id,chr(4)); if(substr($id,0,$pos)===$context)
The problem persist because the first letter of id as deleted.
To solve this problem i changed the line 119:
$id=substr($id,$pos+1);
To this:
$id=substr($id,$pos);
Ok... Now everything is working correctly with MO files.
This MO file was created with Poedit (www.poedit.net) and my operative system is Mac OS X 10.6.6.
It's a bug? Or my MO file are in a non standard mode?
Best Regards, Ricardo.
Attached File(s)
-
messages.zip (1.14K)
Number of downloads: 11

Help












