Downloading translations from transifex - parsing errors

I have a working version for fr_FR and files from transiflex i have taken have a lot of errors malformed array, bad array key name… i didn’t think transfix is the right tool for this kind of files (it was 8 april 2015)

Now i have downloaded fr_FR_SuiteCRM_v7211 and tested for php error, and auto correct _tx trouble (i didn’t think there is _tx troubles in you files) :
to=fr_FR_SuiteCRM_v7211
find “${to}” -type f -name *.php.error -delete
for files in $(find “${to}” -type f -name *.php ) ; do
php -r “define(‘sugarEntry’,true); include(’$files’);” &> “${files}”.error
if [ $? -eq 0 ] ; then
sed ‘s/_tx[0-9]//g’ “${files}” > “${files}”.sed
if [ $? -eq 0 ] ; then
mv -f “${files}”.sed “${files}”
else
echo “Traitement de $files : ERREUR SED”
(( _erreur_sed++ ))
fi
else
bbedit “${files}” “${files}”.error
echo “Traitement de $files : ERREUR PHP”
(( _erreur_php++ ))
fi
(( _files_count++ ))
done

On your package i have detected :
il y a eu 0 erreur(s) SED
il y a eu 2 erreur(s) PHP
TOTAL d’erreur(s) : 2
TOTAL fichier(s) : 195

PHP Parse error: syntax error, unexpected ‘,’ in fr_FR_SuiteCRM_v7211/modules/History/language/fr_FR.lang.php on line 113
PHP Parse error: syntax error, unexpected ‘,’ in fr_FR_SuiteCRM_v7211/install/language/fr_FR.lang.php on line 531

-> array are malformed

i’m happy there is a move in translation :wink:

Transifex is the right kind of tool for translations, even if SuiteCRM files are very badly created and coded!

Do not direct download files from Transifex: the packs I provided are already reverted from the edits required to upload suiteCRM files to transifex.
I will take a look into the errors you pointed.
I simple tested the translation pack and it works

Note: The changes on Transifex files are not done by Transifex. I had to make some changes so it could be uploaded to transifex as SuiteCRM languages files has mixed arrays type in the same file and sometimes it just do not parse on Transifex. On others some strings do not translate whan a specific type of array are not closed before the next type of array. Some other strings has the same field name, a totally nightmare for internationalization!

Maybecan I ask you if you could campaign in creating a SuiteCRM standard for translations files regarding code style?
I don’t have the knowledge for that!

Also: can you create a step by step for non tech guys on the tools you used to verify files for errors? I’m not a coder and I just use computer to execute files on windows!

(in my last message for testing the fr_FR files i have downloaded from sourceforge)

i have updated my transfiflex repo by this command :
tx pull

i see there is always troubles in array index like _txXX in those files
how did you have corrected the _txXX troubles in .zip archives on sourceforge ?

i’m using bash + php script, but there is manual steps ;(

After transifex download and before creatind the zip pack I had to create different steps with search and replace for some specific placeholders I included in the files for some arrays

1- Find =

 "_tx01" to "_tx18"

Action= remove completely

2- Find:

;removetx

Action= remove completely

3- Find:

,removetx

Action= remove completely

4- Find:

//removetx;

Action= remove just the removetx = will end up with ;

I use PSPAD editor and it didn’t require too much time on search and replace for all languages downoade with TX client
I tink i can improve the steps further, maybe with different placeholders because if we replace _tx01 before _tx011 is replaced (as your initial script did) it will ruin the strings!)
I willl post that info later when i will log into my main computer

ok it’s clear for me

i’v done it by using this command line :
sed ‘s/_tx[0-9]//g’ “${files}” > “${files}”.sed

i can help with a bash script on window you have to install (i’m on mac)

i could probably remove the cmder + ‘bash’ + ‘sed’ and write all in php :wink:

you will have this to test in few days…

The _tx[0-9 can’t handle with _tx[1 and _tx11 right?
I can change the _tx word part to any other term to have one for 1 to 9 and other for 10 to 18

Correction:

4- Find:

//removetx;

Action= remove just the: //removetx = will end up with a line with a single ;
This is used on 2 files where the array was closed but there are other lines after that with the same array style.
// is to comment the line so the actual end of array “;” is ignored when uploaded (transifex do not look into commented lines)
After download from transifex we need to have that array end again so SuiteCRM can use the file!

Hi, When installing the 7.2.1 Norwegian language pack i get the following problem:
Trying to access the admin panel after either choosing Norwegian language either in locale or through the language dropdown in login results in a blank page. the rest of the menu options seeminly work, and are translated.

I completed a repair after installing the language pack.

The following is an output from the error.log file.

[Wed May 27 06:26:32.336012 2015] [mpm_prefork:notice] [pid 21680] AH00163: Apache/2.4.10 (Ubuntu) configured – resuming normal operations
[Wed May 27 06:26:32.336061 2015] [core:notice] [pid 21680] AH00094: Command line: ‘/usr/sbin/apache2’
[Wed May 27 08:57:52.376022 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.html denie$
[Wed May 27 08:57:52.376121 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.cgi denied$
[Wed May 27 08:57:52.376158 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.pl denied $
[Wed May 27 08:57:52.376193 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.php denied$
[Wed May 27 08:57:52.376227 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.xhtml deni$
[Wed May 27 08:57:52.376260 2015] [core:error] [pid 29912] (13)Permission denied: [client 192.168.68.110:55170] AH00035: access to /suitecrm/suitecrm2/index.htm denied$
[Wed May 27 08:58:58.265267 2015] [:error] [pid 29911] [client 192.168.68.110:55186] PHP Notice: Undefined variable: js_custom_version in /var/www/html/suitecrm/suite$
[Wed May 27 08:59:17.216631 2015] [:error] [pid 31002] [client 192.168.68.110:55193] PHP Notice: Undefined index: db_port in /var/www/html/suitecrm/suitecrm2/include/$
[Wed May 27 08:59:17.219608 2015] [:error] [pid 31002] [client 192.168.68.110:55193] PHP Notice: Undefined index: db_port in /var/www/html/suitecrm/suitecrm2/include/$
[Wed May 27 09:00:08.750796 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.751471 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.809879 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.809947 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.810395 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.910084 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:08.910151 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:08.910633 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.010255 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.010329 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.010813 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.060393 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.060459 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.060895 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.110650 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.110715 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.111155 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.160777 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.160842 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.161278 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.211026 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:09.211092 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:09.211552 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.726073 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.726148 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: module in /var/www/html/suitecrm/suitecrm2/modules/A$
[Wed May 27 09:00:10.726645 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
[Wed May 27 09:00:10.776247 2015] [:error] [pid 31007] [client 192.168.68.110:55194] PHP Notice: Undefined index: moduleList in /var/www/html/suitecrm/suitecrm2/modul$
$ules/A$[Wed May 27 06:26:32.336012 2015] [mpm_prefork:notice] [pid 21680] AH00163: Apache/2.4.10 (Ubuntu) configured – resuming normal operations

  • Your error log shows issues on permissions. I can’t help you on this.
  • On the other side, I tested your lang pack in a clean install and I can confirm it has some issues and I will take it down from the download site…
    Also confirmed that Chinese pack as problems. I will have to test them all but many work fine.
    As all language packs are created the same way, there are no UTF-8 differences on files, but other lang packs do work fine the issues must rely on the translation itself (a wrong formated sentence or caused by bad translations done for previous sugar packs).
    I will try to find the files that are causing problems but, meanwhile you need to revise all translation for your language at https://www.transifex.com/projects/p/suitecrm/
    Hint: start by the files Modules/administration and Modules/Home

Intalian language Module Upload, install and I get this

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘)’ in /web/htdocs/www.iperg.net/home/SuiteCRM731/cache/upgrades/temp/I5GDnQ/include/language/it_IT.lang.php on line 1623

Not a programmer, do I have any chance here???

Your SuiteCRM version is 7.3 ?
Your download is from this link: https://sourceforge.net/projects/suitecrmtranslations/files/SuiteCRM%207.3/
After language module installed, did you make a “Quick repair”

I did reload the zip module as per link, yes it is a 7.3 ver and still come up with this
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ‘)’ in /web/htdocs/www.iperg.net/home/SuiteCRM731/cache/upgrades/temp/133PtB/include/language/it_IT.lang.php on line 1623

I id run the quick repair, but the module does not show been installed, Suit CRM just go to another page with that Parse error message, there anything I can check? is it some line of code with a syntax error? or something else? Thank you in advance, I will appreciate suggestions, this is the second day trying to install the module.

No issues for me using it-IT language pack so this is not a language issue related.

Maybe this could be related to your PHP version?
Blank views in non-English locales (1/1) - https://suitecrm.com/community/bug-tracker/4646-blank-views-in-non-english-locales