How to download translations from SuiteCRM Transifex project

This is not a full tutorial, its just a first draft so people can start using translations.
It will require some more edits!

Repeat after me: creating a language package its a hard task and it will take lots of time!

[size=6]PART A - Download all SUITECRM files from Transifex site at once:[/size]

  • Use Transifex “TX” client to download your files.
    (the non translated lines will be filled with English ones)

To install and setup the TX client tool (Its a command line tool), see:

Note: For step 1 you should use my config file for the TX client: https://dl.dropboxusercontent.com/u/441710/Transifex/SuiteCRM.ini

[size=6]PART B - Edit some files:[/size]
After downloading you need to edit these 3 files (pt_PT is for portuguse, your language code will be different)

  • \include\language\pt_PT.lang.php
  • \modules\ModuleBuilder\language\pt_PT.lang.php
  • \install\language\pt_PT.lang.php

WHY and WHAT?
Because there are strings with duplicated names on the same SUITECRM language file and transifex would have cleared them.
I had to change the original string names so they are not ignored.
On those 3 files you need to remove some extra text I added to the key part on some string names.
The text to be removed goes from “_tx1” to “_tx18” (you can do a search and reply… I use PSPad Editor on Windows for a full replace at once)!

So:
‘Home_tx1’

Will ended as:
‘Home’

[size=6]PART C - [/size]
Duplicate (and rename) some additional files not available to translation from Transifex.
(Later I will make a list of them, they are few!)

[size=6]PART D - Manifest to install[/size]
You need to create a manifest for the language pack.
Its a long file to post here. Please take a look into some other language packs already created!
(We need a wiki!!)

[size=6]PART E - External files:[/size]
For a full language pack you also need to include extra files for external applications[/size]

  • Those translations will be included in the INCLUDE and JSCALENDAR folders

Languages are available to download at:

1- \include\phpmailer\language
PHPMailer/language at master - https://github.com/PHPMailer/PHPMailer/tree/master/language

2- \include\HTMLPurifier\standalone\HTMLPurifier\Language\messages
HTML Purifier - Translations: www.transifex.com/projects/p/htmlpurifier/

3- \include\javascript\tiny_mce
TinyMCE localization - www.transifex.com/projects/p/tinymce/
Download translations: www.tinymce.com/i18n/index.php

4- \include\javascript\yui3\build\datatype\lang
YUI Library - http://yuilibrary.com

  • IMPORTANT: The YUI library is no longer actively maintained

5- \jscalendar\lang
Download: Languages are already included in the zip to download: http://sourceforge.net/projects/jscalendar/files/jscalendar/

6- \modules\AOS_PDF_Templates\PDF_Lib
Hyphenator - https://code.google.com/p/hyphenator/
(its the download for the patterns files)

[size=6]PART F - ZIP[/size]
Zip your files and install language!

Note: please test with a test user, not the main admin!

1 Like

On the PART B - Additional info.
Applies to folder: \custom\Extension\application\Ext\Language\

Some translations files in this folder requires edits after transifex download.
They use Multidimensional arrays not allowed by Transifex.
Until someone can change those to unimodal arrays I have to make an ugly edit to be able to translate them in transifex.
So download them and perform a serarch and replace for

// after transifex download replace _#999#_   with '][' 
this way, all lines with 
app_list_strings['relationship_type_list_#999#_SS'] = 'Start to Start';
will become:
app_list_strings['relationship_type_list']['SS'] = 'Start to Start';

Files to edit (I make those edits with PSPad for Windows that can search and replace in all folders/files at once)
en_us.Reschedule.php
en_us.Google_Maps_20131011.php
en_us.GanttChartPro.php
en_us.AdvancedOpenWorkflow.php
en_us.AdvancedOpenSales.php
en_us.AdvancedOpenReports.php
en_us.AdvancedOpenPortal.php
en_us.AdvancedOpenDiscovery.php
en_us.Advanced OpenEvents.php

First of all hello and thank you for your efforts.

I’m trying to download and install the greek language translation but I’ve not been very successful.
I’ve done the following (as per your instructions above):
A) Downloaded the files using the tx.exe and the config file you’ve given (I’ve edited the config and left el_GR only and replaced en_us with el_GR for the source_file
B) Removed “_tx1” to “_tx18” from the files and replaced #999# with ‘][’
C) you haven’t given any info on this one
D) I’ve tried to make this using info from all around but the best I’ve managed is to be able to upload the zip file (F) but after I click on install I get a blank page
E) Did that
F) Did that too

As I said the language pack doesn’t install.
So I thought I might as well manually copy the files and then edit config.php to add the language. I did that but when I select the language at the login screen I get a blank page. I’ve enabled debug mode on the log but I’m not getting any usefull info.

Any thoughts?

I’ve managed to install the language manually.
At least 2 files have errors in them (misplaced brackets mostly) when they are downloaded from transifex via the tx.exe
include/language/el_GR.lang.php
modules/home/language/el_GR.lang.php

Introduction to the Manifest

Use this template as example:

<?PHP
/******************************************
 * @author MyName<MyName@Mymail.com>
 ******************************************/
$manifest = array( 
	'name' => 'Example Language Package',
	'description' => 'Example Package Description',
	'type' => 'langpack',
	'is_uninstallable' => 'Yes',
	'author' => 'MyName',
    'version' => '7.2.1',
	'published_date' => '2015/03/19',
      );
$installdefs = array(
	'id'=> 'ru_ru',
	'copy' => array(
	array('from'=> '<basepath>/include','to'=>'include',),
	array('from'=> '<basepath>/modules','to'=>'modules'),
	array('from'=> '<basepath>/install','to'=>'install'),
	array('from'=> '<basepath>/custom','to'=>'custom'),
                        )
 );
?> 

And now… you can download languages here:
https://sourceforge.net/projects/suitecrmtranslations/files/

I am able to install the packages that are on the link horus68 posted:

sourceforge.net/projects/suitecrmtranslations/files/

But when I try to create my own (I need Japanese) I fail. Similar to how auberwn failed. When I install, I get a blank page. I can get back, but nothing is installed and it definitely doesn’t get as far as it does when I install an official package that I downloaded from the sourceforge link.

I followed the steps and even found the missing files for part C. I think.

[lang].AdvancedOpenReports.php
[lang].notify_template.html
Modules\MySettings\language[lang].lang.php
Modules\Version\language[lang].lang.php (file is empty)

I used the ch_ZN package as a template and copied the manifest PHP file. Changed the name to ‘Japanese (Japan)’ and id from ‘zh_CN’ to ‘ja_JP’

The number and names of the files match exactly (besides the language identifiers), so something inside one or more of the files must be broken.

I don’t mind manually installing the language pack, but can someone walk me through that. I am very much a Windows person and ours is hosted virtually in Ubuntu. If it is as simple as a copy and paste and a couple file updates, please let me know.

There is a file with issues on translation that causes blank screen for some languages:
Modules / Administration
The strings has an <a href= with quotes wrongly translated
Revise here (string 84 to 86): https://www.transifex.com/projects/p/suitecrm/resource/modules-administration-language-langcode_lang_php/

In the next days i will create new language packs for all languages (there are many new lines translated on several languages, japan included!)

Thanks!

That being said, I think I am an idiot as I thought I fixed the quotation problem, but I didn’t. Do I need to go through and escape all of the single quotes? or is it just strings 84 and 86 in Transifex that you linked?

Here is the line in zh_CN (for one instance):
‘ERROR_LICENSE_EXPIRED2’ => “日(s)前。 请到’“授权管理” 在管理员界面输入您的新授权钥匙。 7天实效内如不输入授权钥匙,您将无法登陆本程序。”,

Here is the line before I fixed it in ja_JP:

‘ERROR_LICENSE_EXPIRED2’ => “日前に期限が切れました。管理画面のライセンス管理 から新しいライセンスキーを入力してください。ライセンスキーの失効期限から7日以内に新しいライセンスキーを入力しないと、このアプリケーションにログインできなくなります。”,

After I fixed it:
‘ERROR_LICENSE_EXPIRED2’ => “日前に期限が切れました。管理画面の[color=#ff0000]’”[/color]ライセンス管理[color=#ff0000]"[/color] から新しいライセンスキーを入力してください。ライセンスキーの失効期限から7日以内に新しいライセンスキーを入力しないと、このアプリケーションにログインできなくなります。",

It is probably staring me right in the face. I can probably wait for you to upload the rebuilt packages, but I have a feeling I am very close…

I’m trying to do a language pack but seems that the config file for the TX client is old and does not work correctly. There is any place where download an updated version?

Thanks!

Hi: you can download language packs here:
https://sourceforge.net/projects/suitecrmtranslations/files/SuiteCRM_74/
(created today from Transifex)

If you really, really want to create a language pack, forget all the above posts by me and go to my tutorials:
Creating a language pack - TranslatingSuiteCRM - https://sites.google.com/site/translatingsuitecrm/faq/creatinglanguagepack
Note: Transifex TX config file was also refreshed.

1 Like

Thanks for the info. It has been very useful.

I created a language pack and I think there is an error in the file /include/language/.lang.php specifically in the 2503 line. There is a ‘);’ that does not close any array and that gives problems. I have removed and everything works properly.

Here is the error:

$app_list_strings[‘library_type’] = array(‘Books’=>‘B’, ‘Music’=>‘Música’, ‘DVD’=>‘DVD’, ‘Magazines’=>‘Revistes’,);

[color=#ff0000]);[/color]

$app_list_strings[‘kbdocument_status_dom’] = array (
‘Draft’ => ‘Borrador’,
‘Expired’ => ‘Caducat’,
‘In Review’ => ‘En Revisió’,
‘Published’ => ‘Publicat’,
);

Thanks for your work. How/What software did you use to find this error?
It worked for me but this is really an error!

I’m already creating new language packs.

Basically what I did was look at the differences between the last version that was working fine for me few days ago and the last version (which did not work). To see the differences I used the diff command available at any version of linux.

Watching the differences I see that an array() was removed but the ‘);’ that closes the array was not removed.

Obviously you can use tools to check if the syntax of a php file is correct. For example: php -l file

If you want to check all php files you can execute (at the root of translation files): find . -name *.php -exec php -l “{}” ;

Thanks for this walkthrough of downloading and installing language packs from Transifex! I recently translated a lot of strings for Norwegian, and I wanted to test it out right away and I finally got it working.

However, I had some troubles getting everything just right, I have spent an hour of this morning removing “removetx” from the language files, and commenting in out-commented ending parentheses and semi-colons. I hope Transifex allows for multidimensional arrays soon, so we don’t have to rely on the ugly #999# hack.

The only addition to your walkthrough I’d recommend adding is that people start searching and replacing _tx18, moving downwards, as most basic search and replace-functions in text-editors will replace _tx1 in _tx10 - _tx18, leaving people stuck with numbers on weird places in their language files, and doing a search and replace for single numbers can be a scary thing to do, haha. I did this myself, and had to redownload files from Transifex after realizing what I had done. The best would probably be to use an advanced search and replace that will let you use regular expressions to search for strings to replace, but if that’s not a possibility, starting with _tx18 and moving down would be the smartest way to go about removing _tx1 - _tx18.

All you said is true!

See new tutorial at:
https://sites.google.com/site/translatingsuitecrm/faq/creatinglanguagepack

(I can’t edit old messages in this topic!)

I was not aware of this tutorial and that you couldn’t edit old messages in the topic, and neither about the new and updated tutorial! Had I known about this, I would have had a lot less problems but you learn as long as you live! :slight_smile: Thank you for the reply, I will follow the guidelines in the new tutorial if I ever want to get new translations from Transifex. Have a nice weekend!