[Vtigercrm-developers] gettext in V5

Abos webmaster at vtigercrmfrance.org
Fri May 12 05:52:33 PDT 2006


This is the instructions sended by Mike himself, i paste the original 
message.


I've tried to boil this down simply.  Here's what you need.

1)  Extract these files in a directory named *locale/* inside your 
vtiger directory.
2)  You need a table in vtiger named *lang_keys*.  To create this, 
execute as follows (from the root vtiger directory):
     php locale/buildLangKeys.php
This will create:
     locale/vtiger.pot  (POT file for translating)
     locale/lang_keys.sql (initialization for the database table)
The lang_keys.sql in the distributed file is actually the correct file 
from the alpha.  However, you can rebuild if you like
3)  I haven't reviewed where this is in 5.0, but the functions in 
utils_lang.php need to replace the same functions in the new 5.0 
utils.php (or wherever it is).
4)  I've include a *4.2.3* version of the en_US and fr_FR translations. 
 These need to be updated for 5.0.  They are included for your reference.

Here's how the system works:
1)  The following functions *return* the identical strings they used to:
      function return_app_list_strings_language($language)
      function return_application_language($language)
      function return_module_language($language, $module)
They use the lang_keys database to build the contents of the strings, 
but instead of returning the English (which is in the database), they 
return _(English) making it translated.
2)  Otherwise, system functions as expected.  All new entries, however, 
can simply be _(*My New Strings*) rather than going to the complication 
of adding to mod_strings, etc.

Caveats:
1) There are several untranslated strings I had to find.  I'll compile a 
list and provide later.
2) Squirrelmail is way screwed up.  In it, it prints _($mod_strings[]), 
which causes lots of problems.  I have fixed in my version, and will 
supply by Friday.

Future:
1) I will have a tool shortly which builds a PO file from an existing 
translation.  This will be extremely useful in migrating from the old 
system to the new system.

Geek Alert:
1)  If you really want to see something cool, look at buildLangKeys.txt 
and see how I am importing each language file, then assigning it to a 
string in an array from the import.  Very cool.

This should be very clear, I hope.  I will be on road a lot tomorrow. 
You can try to IM me, and I'll respond if I am free.

Cheers!
Mike

P.S.  I will post this to forge



Sergio A. Kessler a écrit :
> yes, please, send it to this list...
> (I do not like private messages)
>
> but I need confirmation that the patch (ie. the work) will not end in
> the floor...
> (if the patch is simple to merge, that is)
>
> /sak
>
> On 5/11/06, Abos <webmaster at vtigercrmfrance.org> wrote:
>   
>> Sergio,
>> Mike Crowe has sended me latest version of his gettext patch, i can mail
>> you that if you want.
>>
>>
>> Sergio A. Kessler a écrit :
>>     
>>> I'm short on time, but I can give it a try this weekend,
>>> but the patch enabling gettext will be accepted or is too late ?
>>>
>>> 1) the patch should be short
>>> 2) the current translations can be mantained in the transition, I see
>>> no problem in enabling gettext strings each by one
>>>
>>> regards,
>>> /sak
>>>
>>> On 5/11/06, Abos <webmaster at vtigercrmfrance.org> wrote:
>>>
>>>       
>>>> Hi Sergio,
>>>> do not miss understand (i know my english is poor),
>>>> i'm not against gettext, if you have capabilitie to provide gettext
>>>> support for vtiger crm 5 in short time, i provide french pack in pot
>>>> format without any problem in same time.
>>>> But i think before gettext integration, we have to ask to the
>>>> translaters, to know their capabilities.
>>>> Regards,
>>>> Aïssa
>>>>
>>>> Sergio A. Kessler a écrit :
>>>>
>>>>         
>>>>> aisa, is a lot more probably that you *gain* translators instead of
>>>>> loosing them...
>>>>> (I don't know how you came to that conclusion)
>>>>>
>>>>> don't be afraid of gettext, the day you know it, you will wonder why
>>>>> this thing hasn't used before...
>>>>>
>>>>> gettext doesn't resolve the harcoded strings problems,
>>>>> BUT it makes the task of mark a string to be tranlated SO easy, that's
>>>>> is not even funny...
>>>>>
>>>>> all you have to do is to change something from:
>>>>>
>>>>> echo "harcoded string";
>>>>>
>>>>> to
>>>>>
>>>>> echo _("translatable string");
>>>>>
>>>>> then you run a script that does all the dirty work for you...
>>>>> and voilé, you have all the diccionaries updated and sinchronized...
>>>>>
>>>>>
>>>>>
>>>>> On 5/10/06, Abos <webmaster at vtigercrmfrance.org> wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> ok,
>>>>>> Translate on array is boring, but really easy, using tool like poedit...
>>>>>> is another thing (not really difficult i agree).
>>>>>> But i prefer translate on php files and have vtiger CRM 5 may be for
>>>>>> june than wait 2 more months and have gettext.
>>>>>> Gettext doesn't resolve all the harcode problems (please confim).
>>>>>> And before make the change, we have to train/inform the translators,
>>>>>> loose some translators (and lang so) during the change is not good.
>>>>>> Aïssa
>>>>>>
>>>>>> Sergio A. Kessler a écrit :
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> gettext is an order of magnitude easier to use for translators (than
>>>>>>> an array based aproach) if you use poedit.
>>>>>>>
>>>>>>> http://www.poedit.org/
>>>>>>>
>>>>>>> and I do not want to mention that gettext produces and keep
>>>>>>> sincronized the files to translate automagically...
>>>>>>>
>>>>>>> /sak
>>>>>>>
>>>>>>> On 5/10/06, Abos <webmaster at vtigercrmfrance.org> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Hi all,
>>>>>>>> this is a small report for today svn snapshot.
>>>>>>>>
>>>>>>>> Homepage : latest activities added layer appear (see screenshot), i
>>>>>>>> think you know already.
>>>>>>>>
>>>>>>>> Tab marketing, subtab account & contact, if i add an task/activitie, the
>>>>>>>> redirection goes to tab support, the good subtab. (very small problem)
>>>>>>>>
>>>>>>>> Tab "More information", when i translate close (for task/events) the
>>>>>>>> table is not correctly displyed, miss the cell for close (X).
>>>>>>>>
>>>>>>>> The compose email pop up, is just a little to small (need 50px weight more),
>>>>>>>>
>>>>>>>> Problem with ' in company field information (alway),
>>>>>>>>
>>>>>>>> When i send an email to a lead or contact, lead/contact description
>>>>>>>> added to mail body. Very very very bad ! Imagine my comment, "fucking
>>>>>>>> guy, dislike to work with him, bad debtor". Ouch !
>>>>>>>>
>>>>>>>> Can't change invoices status, quotes /SO/PO stage on picklist settings
>>>>>>>> (i think you just need time for quotes/SO/PO, but for the invoices, it's
>>>>>>>> miss since 4.x)
>>>>>>>>
>>>>>>>> Migration script alway break the install, i have make a test with a new
>>>>>>>> and clean vtiger crm 4.2.3 database (without adding any data), only 4
>>>>>>>> tables created : *actionmapping, announcement,  field_seq,
>>>>>>>> profile2globalpermissions.
>>>>>>>>
>>>>>>>> *Brand question (i think to saint ?) why design the tiger pound to left
>>>>>>>> on rss, calendar, email module ? The vtiger logo use a pount inclined to
>>>>>>>> right.
>>>>>>>>
>>>>>>>> Migration question :
>>>>>>>> Why not provide migration script during install ? With user choice
>>>>>>>> install/upgrade.
>>>>>>>>
>>>>>>>> Loggin question : The logs make vtiger CRM slow, why not put loggin to
>>>>>>>> WARN for stable version ?
>>>>>>>>
>>>>>>>> Adding 1 more field to calls/meetings for incoming/outgoing can be very
>>>>>>>> good.
>>>>>>>>
>>>>>>>> Now the good things :)
>>>>>>>> New really impressive design for the calendar, very very good !
>>>>>>>> The quick create function can be a killer feature on vtiger 5 (time
>>>>>>>> winning!!!)!
>>>>>>>> The search engine is very cool, now we can search on entire system.
>>>>>>>> The report module !!!! Ouch !!!! USABLE ! (Richie forgot what i have
>>>>>>>> said about report module ;) )
>>>>>>>> New real effort for translaters, thankkkksssssss, i am impatient to see
>>>>>>>> vtiger crm 5 full french (and all french users too) !
>>>>>>>> MSG to Richie, you say about i18n on forum: " Yes, we do need help.",
>>>>>>>> what kind of help ? Harcode string feedback ? Moving harcode to lang
>>>>>>>> file and give a patch ?... I'm ready.
>>>>>>>>
>>>>>>>> About gettext, the problem with gettext, is you can loose translaters,
>>>>>>>> gettext is more difficult to use, but more efficient. We need a full
>>>>>>>> translate of vtiger CRM 5 (not 6). So for now, it's the right decision.
>>>>>>>>
>>>>>>>> Conclusion : vtiger crm 5 is on the right way, look good, smell good.
>>>>>>>> And i'm really enthusiastic(not sure for this word)
>>>>>>>> I hope the plug-ins with same quality.
>>>>>>>> Aïssa,
>>>>>>>> gone to write a news on vtiger france
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>>                 
>
> _______________________________________________
> This vtiger.com email is sponsored by Zoho Planner. Still scribbling down your To-Do's on bits of paper & palms of your hands? Try the AJAX enabled, personal organizer online, Zoho Planner for FREE instead! http://zohoplanner.com/?vt 
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dev_gettext.zip
Type: application/x-zip-compressed
Size: 75796 bytes
Desc: not available
Url : http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20060512/93e5d316/attachment-0003.bin 


More information about the vtigercrm-developers mailing list