There has been a report form a translator claiming that some strings gives error if using apostrophe (when using catalan translation).
include/language/en_us.lang.php
'ERR_SQS_NO_MATCH_FIELD' => 'No match for field: ',
And /modules/Administration/language/en_us.lang.php
'MI_REDIRECT_TO_UPGRADE_WIZARD' => 'Selecting this patch will redirect you to the Upgrade Wizard to perform the necessary system checks. Do you wish to continue?',
Translations shouldn't fire errors when using apostrophe in values
Example:
English source: include/language/en_us.lang.php
'ERR_SQS_NO_MATCH_FIELD' => 'No match for field: ',
Translation for Catalan language:
No s'han trobat coincid猫ncies per al camp:
See live at: https://crowdin.com/translate/suitecrmtranslations/442/engb-ca#2570
Downloaded from crowdin as:
'ERR_SQS_NO_MATCH_FIELD' => 'No s\'han trobat coincid猫ncies per al camp: ',
SuiteCRM: Version 7.10.9
Browser: Google Chrome 69.0.3497.100 and 70.0.3538.67
Browser: IE 11.0.9600.19078
PHP 5.6 and 7.1
MySQL 5.6.41
Client SO: Windows 8.1 Pro
Sorry, I don't understand, where are the apostrophes in those strings?
Or do you mean that the apostrophes are only added in the translation?
@pgorod All apostrophes in the translation.
Ok, can you please provide a sample of how that code looks in the PHP files that are produced?
For example when go to mail receive this error:
Uncaught SyntaxError: missing ) after argument list - in line 1925 of index.php
And line 1925:
addToValidateBinaryDependency('MassUpdate', 'assigned_user_name', 'alpha', false, 'No s'han trobat coincid猫ncies per al camp: Assignat a:','assigned_user_id');
A text "No s'ha trobat" is correct but middle apostroph (i think) not have \ before it.
Thanks!
I would like to see what Crowdin produces, what is in the language file. We have to start from there - is it correct in the language file? If so, why does it break SuiteCRM? If not, why is Crowdin not generating correctly?
If you can get me the exact string from the language file, as it is in the PHP, and the steps to take the UI to the point where it breaks, I can try it myself and try to fix.
In language file i think is correct:
Line 1462
'ERR_SQS_NO_MATCH_FIELD' => 'No s\'han trobat coincid猫ncies per al camp: ',
Thanks!
That does NOT look correct. If you use ' inside the string, you need to change the outside quotes to ".
Alternatively, you could escape the apostrophe with \'
@horus68 doesn't Crowdin do this automatically, isn't it aware of the need to escape apostrophes?
@pgorod i see now in reply that not see \ before ' but in language file this is it.
'ERR_SQS_NO_MATCH_FIELD' => 'No s\'han trobat coincid猫ncies per al camp: ',
Ah, ok. And where do you go in the app (which screen, which button) to see that string breaking SuiteCRM?
When enter into collaboration and then mail.
I can't reproduce this. I changed the ERR_SQS_NO_MATCH_FIELD string in the original include/language/en_us.lang.php to include a \'s and I go the Emails screen and nothing wrong happens.
Any ideas? Can anybody else reproduce?
i think not explain well or not understand totally.
see attached files and if you need is possible to send login data for testing.



Ok, I can see that faulty code rendering in my system too. But I see it only on the Developer Console, I don't get any symptoms, nothing visible on screen.
This is old code, it is coming from here:
https://github.com/salesagility/SuiteCRM/blame/master/include/MassUpdate.php#L1157
But that whole MassUpdate section... I can't find a way to display it on the screen, it seems to be hidden... permanently.
For see symptom when put Catalan language with apostrophe and go to mail don't appear any item in From drop-down for example, some loading layers and others messages fail... if you need search and document some of this.
I see code, 5 years old but not is normal that this process not escape a string or process it when import language file to $app_strings array.
Something go wrong, all apostrophes strings in Catalan fail.
What is a better method for resolve this? you are in the way?
Thanks @pgorod !!
modules/Administration/language/en_us.lang.php so that:'MI_REDIRECT_TO_UPGRADE_WIZARD' => 'Selecting this patch will redirect you to the Upgrade Wizard to perform the necessary system checks. Do you wish to continue?',
gets modified into:
'MI_REDIRECT_TO_UPGRADE_WIZARD' => 'Selecting this patch will redirect you to the Upgrade Wizard to perform the necessary system\' checks. Do you wish to continue?',
Module Loader should show installed modules.
Html that is parsed by the web browser should contain:
tmpNodeRelease.onCheckClick = function(){this.uncheck();if(confirm('Selecting this patch will redirect you to the Upgrade Wizard to perform the necessary system\' checks. Do you wish to continue?')){location.href = 'index.php?module=UpgradeWizard&action=index'}};
Module Loader shows an empty space where the installed module list usually are.
Javascript log says:
index.php?module=Administration&action=UpgradeWizard&view=module:1660
Uncaught SyntaxError: missing ) after argument list
Html that is parsed by the web browser contains:
tmpNodeRelease.onCheckClick = function(){this.uncheck();if(confirm('Selecting this patch will redirect you to the Upgrade Wizard to perform the necessary system' checks. Do you wish to continue?')){location.href = 'index.php?module=UpgradeWizard&action=index'}};
The part of suitecrm which parses:
ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl
should not try to parse:
\`
on its javascript translations.
Please note that the part of suitecrm which parses translations into something else than javascript should parse it (as I guess it's the default behaviour).
Does anyone know where the tpl parsing is handled by suitecrm?
Or maybe advices any other fix?
Thank you.
The parsing is handled by the Smarty engine.
I guess if Javascript translated strings need to be handled differently, then it would have to occur at the moment when the assigns are being done, when sending the data over to Smarty.
Most helpful comment
@pgorod i see now in reply that not see \ before ' but in language file this is it.
'ERR_SQS_NO_MATCH_FIELD' => 'No s\'han trobat coincid猫ncies per al camp: ',