Jump to content


Photo

How to add a new language ?


  • Please log in to reply
10 replies to this topic

#1 Sdlord

Sdlord

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 05 December 2011 - 11:59 AM

Greetings community,

I'm new to Zurmo and find this CRM tool an awesome one

i have started to translate Messages files to my locale language " Persian " , but i have no clue how/where to introduce my language so it can be included in Languages list and can be chosen by user.

I'd really appreciate if you give me hand on this issue ,

Best regards,

Ashkan.

#2 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 05 December 2011 - 03:21 PM

Ashkan,
I am glad you are enjoying the Zurmo application.

First i would recommend you look at:
http://zurmo.org/wik...stomizing-zurmo

This article will help you understand how to customize Zurmo.
Then what you will need is a perInstanceConfig.php file in the config folder like outlined in the wiki above.

In that file you can put:

$instanceConfig['params']['supportedLanguages']['pe'] = 'Persian'

You will also need to make sure the root messages folder has a pe/ folder with a Default.php in it as well. Please let us know as you have more questions. Once you are complete with your language pack, it would be great to add it to our build process to ensure that we are not missing any labels as we develop more.

Jason Green
Zurmo Team
Need support? Upgrade now


#3 phpveteran

phpveteran

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationMashhad Iran

Posted 05 December 2011 - 07:05 PM

Greetings community,

I'm new to Zurmo and find this CRM tool an awesome one

i have started to translate Messages files to my locale language " Persian " , but i have no clue how/where to introduce my language so it can be included in Languages list and can be chosen by user.

I'd really appreciate if you give me hand on this issue ,

Best regards,

Ashkan.

Hi,
I like to help you to perform this task.
my name is ramin and if you like we can do it together

#4 Sdlord

Sdlord

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 05 December 2011 - 10:10 PM

Jason,
Thanks a lot for your guide,

I have done all the steps , Persian language has been added to the list and as soon as i choose it in my profile and hit Save , i'm facing the following error :

"""There was an error. Please click here to continue to the home page. If the error persists, please contact the administrator.
Unrecognized locale "pe" """

What i have done :

1-Created a " pe " folder including Defualt.php in root messages folder ( ...\app\protected\messages ) according to other languages , modified the php file and changed it to :

return MessageUtil::getMessages('pe');

2- Created a "pe" folder within all other messages folders including the translation ( for translating i have used the " es " folder containing Default.php as source )

3- i have created a perInstanceConfig.php in config folder , including :

$instanceConfig['params']['supportedLanguages']['pe'] = 'Persian'


and that is the error which appears , i can not login to my account anymore , until i change the language in MySQL database.

How to resolve this error ?

i appreciate your help and looking forward to send you the translated package as soon as i finish them off ,

Ashkan

#5 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 05 December 2011 - 11:40 PM

Interesting error. I did not realize but i guess the message files and names need to also match the Yii locale code. The Yii locale code for farsi appears to be fa_ir. So if you change everything from pe to fa_ir, i think it will be fine. You should at least try that and see if that error goes away.

Jason Green
Zurmo Team
Need support? Upgrade now


#6 phpveteran

phpveteran

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationMashhad Iran

Posted 06 December 2011 - 04:40 AM

yap this an exception in clocal component of yii and Jason was quite write Persian in yii and other standard project is known as fa_ir so yii framework could not understand your locale for error messages and etc.

#7 Sdlord

Sdlord

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 06 December 2011 - 06:52 PM

Jason and phpveteran , Cheers :)

after a few tries , i managed to make it happen , and found out some interesting " minor issues " which can make confusion for anyone with this issue :
  • Locale language code can not be more than 2 characters , so , in my case , i had to use " fa " , nothing more than 2 characters, like "fa_IR " etc will work
  • After making changes to perInstanceConfig.php and adding new language file / folders , two additional actions shall be done in order to take effect :
  • Removing saved cookies from your Browser ( in my case , localhost cookies )
  • Flushing cached data in Memcached.exe
to flush cached data , i found a simple way using Telnet :



telnet localhost 11211
flush_all

Note : 11211 is the default memcached port number , change it if you're using another port.

And we're good to go :)

Thanks again for the help , im working on this,

Best regards ,

Ashkan.

#8 Jason

Jason

    Administrator

  • Administrators
  • 716 posts
  • LocationChicago

Posted 06 December 2011 - 10:37 PM

Jason and phpveteran , Cheers :)

after a few tries , i managed to make it happen , and found out some interesting " minor issues " which can make confusion for anyone with this issue :

  • Locale language code can not be more than 2 characters , so , in my case , i had to use " fa " , nothing more than 2 characters, like "fa_IR " etc will work
  • After making changes to perInstanceConfig.php and adding new language file / folders , two additional actions shall be done in order to take effect :
  • Removing saved cookies from your Browser ( in my case , localhost cookies )
  • Flushing cached data in Memcached.exe
to flush cached data , i found a simple way using Telnet :




telnet localhost 11211
flush_all

Note : 11211 is the default memcached port number , change it if you're using another port.

And we're good to go :)

Thanks again for the help , im working on this,

Best regards ,

Ashkan.


Ashkan,

A nice way to clear the cache is to simply add &clearCache=1 to the url going to the next page you go to. This will clear the memcache. I use this method a lot during development. I don't know why you would have to remove cookies, i think the clearCache=1 should solve it.

Also - regarding your comment about only being able to use 'fa' instead of 'fa_ir'. Why is this? Are you seeing an error or something?

Also at some point once you are fully complete with the translation i would like to get your language pack as an extension that can be loaded into installation, so we can tackle that at a later stage.

Thanks so far for all your hard-work!

Jason Green
Zurmo Team
Need support? Upgrade now


#9 hammour

hammour

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 22 September 2012 - 05:19 PM

i am facing same problem i got msg An error has occurred. Please click here to continue to the homepage. If the error please contact your administrator. i did all the steps but i did'nt get what u did last step in to flush cached data?? i already add new language and everything fine but when i click home it gives this error ??plz help

#10 Ivica

Ivica

    Advanced Member

  • Moderators
  • 478 posts

Posted 23 September 2012 - 06:33 AM

Please turn on debug('$debugOn=true') in config/debug.php, and you will get more details about error. If this information is not enough to solve problem, post detailed information about error, and somebody will try to help you to fix the issue.

#11 heptasarim

heptasarim

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 07 May 2013 - 08:17 PM

 Did you have to make this app so complicated :) ? Erased and installed 8 times ! But I could not use anyway. Please analyze and inform me :) Either I completely leave even unwilingly or I will continue to deal with.

http://crm.heptasarim.com






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users