Hello,
We have to manage a batch of PHP.
We have created a new FILE TYPE (sdlftsettings) with regular expressions, but we cannot handle accented characters and apostrophe in French.
How can we do?
Thank you in advance for your help.
Virginie
Hello,
We have to manage a batch of PHP.
We have created a new FILE TYPE (sdlftsettings) with regular expressions, but we cannot handle accented characters and apostrophe in French.
How can we do?
Thank you in advance for your help.
Virginie
Paul Filkin | RWS Group
________________________
Design your own training!
You've done the courses and still need to go a little further, or still not clear?
Tell us what you need in our Community Solutions Hub
Hello Paul,
Thank you for your answer.
We have move forward but there is problem to settle.
Thee regex (?s)\\'.*?\; works but creates a conflict with (?s)\\.*? for the backslash of the apostrophes:
--------
La description adopte la structure suivante :
array(
array(\'field\' => \'the_field_name\',
\'label\' => \'some visible name\',
\'type\' => \'textfield\',
\'desc\' => \'some desc\',
\'attrs\' => array(\'size\' => 80)),
array(\'field\' => \'description_sample\',
\'label\' => \'Description (sample)\',
\'type\' => \'textarea\',
\'desc\' => \'Short Description (sample)\'),
array(\'field\' => \'template_sample\',
\'label\' => \'Model (sample)\',
\'type\' => \'select\',
\'desc\' => \'Course template (sample)\',
\'options\' => array(\'MOD1\' => \'Model1\', \'MOD2\' => \'Model2\')));
L\'expression résultante est :
-------
Is there a way of handling these?
Thank you,
It's my understanding that constructs encoded in such way simply CANNOT CONTAIN APOSTROPHE as it would create parsing error - e.g. the apostrophe in "L'expression" would be understood as the string closing apostrophe.
You would need to encode apostrophes in text as entities (i.e. named entity ' or one of the numeric entities).
EDIT:
A proper way is of course to let the author get rid of the stupid localization-totally-unfriendly construct and e.g. read the strings from external strings-only file. And that file would of course contain ONLY LOCALIZABLE strings, not that crappy noise like "size", "type", etc.
EDIT2:
Another way to handle this situation would be to use typographically correct French apostrophe as this is different character than the ASCII apostrophe and won't need to be escaped by backslash or encoded as entity.
It's my understanding that constructs encoded in such way simply CANNOT CONTAIN APOSTROPHE as it would create parsing error - e.g. the apostrophe in "L'expression" would be understood as the string closing apostrophe.
You would need to encode apostrophes in text as entities (i.e. named entity ' or one of the numeric entities).
EDIT:
A proper way is of course to let the author get rid of the stupid localization-totally-unfriendly construct and e.g. read the strings from external strings-only file. And that file would of course contain ONLY LOCALIZABLE strings, not that crappy noise like "size", "type", etc.
EDIT2:
Another way to handle this situation would be to use typographically correct French apostrophe as this is different character than the ASCII apostrophe and won't need to be escaped by backslash or encoded as entity.