Author Topic: Use a different language in CalemEAM  (Read 7893 times)

it_global

  • Newbie
  • *
  • Posts: 2
Use a different language in CalemEAM
« on: August 21, 2007, 02:18:34 am »
Hello,

I have installed satisfactorily CaleamEAM, but my native language is Spanish, and I believe that there is a way to make the translation to Spanish, but I do not know. can somebody help me?

Thanks and best regards,
Carmelo Santana.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Use a different language in CalemEAM
« Reply #1 on: August 21, 2007, 08:19:14 am »
Hi Carmelo,

You're right that you can add translation to Spanish for CalemEAM. The files that need to be translated are located in CalemMain\client\lang

AjxMsg.properties -> AjxMsg_es.properties
CalemMsg.properties -> CalemMsg_es.properties

These files are typical 'name = value' properties, for instance:

username = User name

where the value 'User name' needs to be translated.
Calem Community Forum Admin

it_global

  • Newbie
  • *
  • Posts: 2
Use a different language in CalemEAM
« Reply #2 on: August 22, 2007, 02:47:20 am »
Thanks,

I translate these files to Spanish. But I do not know how to put Spanish like default language.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Use a different language in CalemEAM
« Reply #3 on: August 22, 2007, 10:16:29 am »
To start with, place both AjxMsg_es.properties and CalemMsg_es.properties under CalemEAM\client\lang.

Next is to edit configuration to a) instruct CalemEAM to build Spanish resources and b) set default language to Spanish. This is done by editing CalemEAM\server\conf\calem.custom.php

Add the following lines to calem.custom.php:
Code: [Select]

/**
 * Add spanish
 */
$_CALEM_dist['client_lang_list']['CalemMsg_es.js']=
array('AjxMsg'=>array('AjxMsg_es'),
         'I18nMsg'=>array('I18nMsg', 'I18nMsg_es', 'I18nMsg_es_ES'),
         'CalemMsg'=>array('CalemMsg_es', 'CalemMsgCustom_es'));

$_CALEM_dist['client_language']='es';

Note you may need to set I18nMsg_es_XX to your location (I used Spain in the sample above). Make sure the XX you used has a corresponding file in CalemEAM\client\lang.

Next step is to build the language resource for Spanish. Go to CalemEAM\bin, issue the following command:

deploy.bat build

(or deploy.sh for Linux). After the command is executed go to CalemEAM\client\launchpad\resource, verify that CalemMsg_es.js, CalemMsg_es.js.min, CalemMsg_es.js.gz and CalemMsg_es.phpo are generated.

The last step is to change a script file:
- open CalemEAM\client\launchpad\CalemIncludeJsPkg.php
- Find the following line (line 51)
$lang=isset($_REQUEST['lang'])?$_REQUEST['lang']:$_CALEM_conf['client_language'];

- Replace it with:
$lang=isset($_REQUEST['lang'])?$_REQUEST['lang']:null;

That's all to get Spanish to display in CalemEAM.
Calem Community Forum Admin

srivo

  • Jr. Member
  • **
  • Posts: 15
Use a different language in CalemEAM
« Reply #4 on: September 25, 2007, 06:39:01 pm »
I try the same thing for the french no error show up after the deploy.bat build command but no CalemMsg_fr.js, CalemMsg_fr.js.min, CalemMsg_fr.js.gz and CalemMsg_fr.phpo where generated.

here is the code of my calem.custom.php
<?php
/**
* DB configuration
*/
$_CALEM_dist['calem_db_name'] = 'calemeam';
$_CALEM_dist['calem_db_host'] = 'localhost';
$_CALEM_dist['calem_db_user'] = 'calemeam';
$_CALEM_dist['calem_db_password'] = 'calemeam';

//Application host
$_CALEM_dist['calem_application_host'] = 'localhost';
$_CALEM_dist['calem_application_port'] = '';

//Admin user name and password to create Calem DB
$_CALEM_dist['db_admin_user'] = 'root';
$_CALEM_dist['db_admin_password'] = '';

/**
* URI configuration
*/
$_CALEM_dist['calem_root_uri']='/CalemEAM';
$_CALEM_dist['calem_request_uri']='/CalemEAM/index.php';
$_CALEM_dist['calem_soap_uri']='/CalemEAM/CalemSoapService.php';
$_CALEM_dist['jsminClass']=array('path'=>'build', 'class'=>'CalemJsMinExe');
$_CALEM_dist['jsmin_exe']='build/jsmin/jsmin.exe';

/**
* Add Canadien French
/*
$_CALEM_dist['client_lang_list']['CalemMsg_fr_CA.js']=
array('AjxMsg'=>array('AjxMsg_fr_CA'),
'I18nMsg'=>array('I18nMsg', 'I18nMsg_fr', 'I18nMsg_fr_CA'),
'CalemMsg'=>array('CalemMsg_fr_CA', 'CalemMsgCustom_fr_CA'));

$_CALEM_dist['client_language']='fr';

?>

I generated the AjxMsg_fr_CA and CalemMsg_fr_CA properties files.

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Use a different language in CalemEAM
« Reply #5 on: September 25, 2007, 07:50:24 pm »
Take a look at CalemEAM/logs/calem.log. It shows which .js files were generated and/or errors if any. For instance, some of the logs are in the following after executing 'deploy build'

2007-09-25 20:45:56,232 DEBUG CalemZipBaseJs - Generating JS file: CalemMsg.js
2007-09-25 20:45:56,232 DEBUG CalemZipBaseJs - Saved off file in c:\wamp\www\CalemOpenSource\trunk\client/launchpad/resource/CalemMsg.js
2007-09-25 20:45:56,232 DEBUG CalemZipBaseJs - gz file saved at c:\wamp\www\CalemOpenSource\trunk\client/launchpad/resource/CalemMsg.js.gz
20
Calem Community Forum Admin

nicolafi

  • Newbie
  • *
  • Posts: 5
same problem for Italian
« Reply #6 on: January 04, 2008, 08:07:05 am »
I tried to do the same...all seems OK, but no file are generated in "resource" folder, e no error from deploy.bat into calem.log. The only two rows written by deploy are:

2008-01-04 15:05:39,666 INFO  MysqlHandler - calem db connection: user=calemeam, password=***, , connection=mysql:host=localhost;dbname=calemeam, persistent connection=Array
2008-01-04 15:05:39,666 DEBUG CalemPDOStatement - Query time:0.0005, the query=select * from acl_group, params=NULL

Where is the prblem?

Thanks a lot for your replie.

Nicola

nicolafi

  • Newbie
  • *
  • Posts: 5
success!!
« Reply #7 on: January 04, 2008, 09:06:26 am »
I found some problems here and there  :?

First: for deploy.bat -> it calls a php file for packing that reads the env variable CALEM_BUILD and proceed to build only if it is =1. Even if i ran deploy build, this variable was not set (I'm on XP Pro Sp2), and then the deploy didn't work. I have forced a $build=1; in the php file launched and then I have succeded in creating my resource file.

Second: I wanted to show at login time the new language added, but nothing new appeared...So I've investigated some php files and I discovered that in calem.php (inside server/conf), there's the definition for the array listed in the language select in login page. I've added my language (italian), and, here we are. I can make a login with Italian as default and i can see my labels translated. (I must say that I've translated only some label as a test!! ;) )

Hope this Helps

calemadmin

  • Administrator
  • Calem Hero
  • *****
  • Posts: 300
    • http://www.calemeam.com
Use a different language in CalemEAM
« Reply #8 on: January 04, 2008, 07:18:39 pm »
Thanks for the info about the problem with env not be set from PHP scripts. It is not clear why it is not working. We have entered an issue to track this issue.

http://www.calemeam.com/apps/mantis/view.php?id=88
Calem Community Forum Admin

Janus

  • Newbie
  • *
  • Posts: 2
Re: Use a different language in CalemEAM
« Reply #9 on: April 25, 2009, 09:31:56 am »
can I modify the language file  CalemMsg.js directly for saving much time, I need Traditional Chinese language, when I modify the  CalemMsg.js directly ,it is not effect for display in chinese ? why or should I modify which file ?