Hi folks,
I haven't been here for a long time. Sickness did kept me off-line for months. Now i try to catch up.
For a customer with an old installation of Cmsimple xh 1.1.2 (2010 i believe) i need to translate his website to Arabic and Chinese.
2 problems came up:
1. In the menu it is not showing the right text with Arabic and Chinese language. It does set the header to some numbers in the menu. However, on the page itself it is okay.
2. with Arabic language the text is from left to right (Google translate made the correct text from right to left but when paste it, things go wrong).
Did search for 2 hours now but can't find any solution.
If i update the version of Cmsimple, should that fix the problem? And if i wanne update, what version should i use from sourgeforce?
CMSimple_XH 1.1 2013-09-09
or
CMSimple_XH 1.5 2013-09-11
Thanks for any help/advice!
Arabic and Chinese content
Moderator: Tata
Re: Arabic and Chinese content
Hi Emile,
However, you're most likely better off to upgrade to CMSimple_XH 1.5.9. For one thing there won't be any maintenance releases for the CMSimple_XH 1.1 series after the end of this year, for another thing there have been many improvements made regarding the handling of UTF-8 encoded characters during the XH 1.5 series. Unfortunately, upgrading from XH 1.1.2 to 1.5.9 is not as simple than just updating to 1.1.7 (see how to do it).
The good news is that there are already Chinese translations for XH 1.5.x (simplified and traditional), and those seem to work fine. However, there is no Arabic translation (or for that matter any translation to a right-to-left language), so I don't know exactly, what has to be done to make that work. Besides adding the dir="rtl" attribute to the template (very easy, as you can use language specific templates since XH 1.5), you'll have to tell the editor to use rtl (using the TinyMCE plugin directionality is the easiest way to cater for all languages, although using the config option directionality seems to be preferable).
Anyway, the rtl stuff should be handled by CMSimple_XH, IMO. It already may suffice to add a new language setting and to make some modifcations to the editor.
Christoph
PS: I created the following patch against CMSimple_XH 1.5.9 (lines with a minus sign as first character have to removed; those with a plus sign have to be inserted; the rest is for orientation):
This seems to solve the most basic issues wrt. right-to-left scripts, but it seems for a completely proper support of such scripts there are several details to be improved and depending on the template this might have to be adapted (plugins might need adaption, too).
That might be related to an incompatibility of the code that strips out the heading ($h[...]) and the character encoding of the language file, as there is no special treatment of multibyte character sets in CMSimple_XH 1.1.x.bastingse wrote:In the menu it is not showing the right text with Arabic and Chinese language. It does set the header to some numbers in the menu. However, on the page itself it is okay.
That is most likely due to a missing dir="rtl" attribute of the HTML element. You probably have to add that to the template.bastingse wrote:with Arabic language the text is from left to right (Google translate made the correct text from right to left but when paste it, things go wrong).
You should update at least to CMSimple_XH 1.1.7, mainly because several bugs and vulnerabilities have been fixed since XH 1.1.2. Updating should be relatively easy: after updating to XH 1.1.3 (I can look up what has to be done for this step), it should suffice to simply upload all files of the update package.bastingse wrote:If i update the version of Cmsimple, should that fix the problem? And if i wanne update, what version should i use from sourgeforce?
However, you're most likely better off to upgrade to CMSimple_XH 1.5.9. For one thing there won't be any maintenance releases for the CMSimple_XH 1.1 series after the end of this year, for another thing there have been many improvements made regarding the handling of UTF-8 encoded characters during the XH 1.5 series. Unfortunately, upgrading from XH 1.1.2 to 1.5.9 is not as simple than just updating to 1.1.7 (see how to do it).
The good news is that there are already Chinese translations for XH 1.5.x (simplified and traditional), and those seem to work fine. However, there is no Arabic translation (or for that matter any translation to a right-to-left language), so I don't know exactly, what has to be done to make that work. Besides adding the dir="rtl" attribute to the template (very easy, as you can use language specific templates since XH 1.5), you'll have to tell the editor to use rtl (using the TinyMCE plugin directionality is the easiest way to cater for all languages, although using the config option directionality seems to be preferable).
Anyway, the rtl stuff should be handled by CMSimple_XH, IMO. It already may suffice to add a new language setting and to make some modifcations to the editor.
I'm glad, you're doing better now. You may not be aware yet that there is a fork of CMSimple_XH 1.5.3 now under the name CMSimple 4.bastingse wrote:Sickness did kept me off-line for months. Now i try to catch up.
Christoph
PS: I created the following patch against CMSimple_XH 1.5.9 (lines with a minus sign as first character have to removed; those with a plus sign have to be inserted; the rest is for orientation):
Code: Select all
Index: cmsimple/languages/en.php
===================================================================
--- cmsimple/languages/en.php (revision 2)
+++ cmsimple/languages/en.php (working copy)
@@ -223,4 +223,6 @@
$tx['utf-8']['marker']="äöü";
+$tx['script']['directionality']="rtl";
+
?>
Index: plugins/tinymce/init.php
===================================================================
--- plugins/tinymce/init.php (revision 2)
+++ plugins/tinymce/init.php (working copy)
@@ -88,7 +88,7 @@
* @return string
*/
function tinymce_config($xh_editor, $config) {
- global $pth, $sl, $sn, $cf, $plugin_cf;
+ global $pth, $sl, $sn, $cf, $tx, $plugin_cf;
if (!isset($plugin_cf['tinymce'])) {
include_once $pth['folder']['plugins'] . 'tinymce/config/config.php';
@@ -160,6 +160,8 @@
$temp = str_replace("%FILEBROWSER_CALLBACK%", $_SESSION['tinymce_fb_callback'], $temp);
+ $temp = str_replace('%DIRECTIONALITY%', $tx['script']['directionality'], $temp);
+
return $temp;
}
Index: plugins/tinymce/inits/init_full.js
===================================================================
--- plugins/tinymce/inits/init_full.js (revision 2)
+++ plugins/tinymce/inits/init_full.js (working copy)
@@ -33,6 +33,8 @@
external_image_list_url : "%TINY_FOLDER%cms_image_list.js",
external_link_list_url : "%TINY_FOLDER%cms_link_list.js",
+ directionality: "%DIRECTIONALITY%",
+
// Extra
plugin_insertdate_dateFormat: "%d-%m-%Y",
plugin_insertdate_timeFormat: "%H:%M:%S",
Index: templates/mini1/template.htm
===================================================================
--- templates/mini1/template.htm (revision 2)
+++ templates/mini1/template.htm (working copy)
@@ -1,17 +1,17 @@
<!DOCTYPE html>
-<html>
+<html dir="<?php echo $tx['script']['directionality'];?>">
<head>
<?php echo head();?>
</head>
-
+
<body id="body" <?php echo onload();?>>
<!--Head Navigation-->
<div class="headnav">
<p>
- <?php echo mailformlink();?>
- <?php echo sitemaplink();?>
- <?php echo printlink();?>
+ <?php echo mailformlink();?>
+ <?php echo sitemaplink();?>
+ <?php echo printlink();?>
<?php echo languagemenu();?>
</p>
</div>
Last edited by cmb on Sun Sep 29, 2013 3:11 pm, edited 1 time in total.
Reason: added PS
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH
Re: Arabic and Chinese content
Maybe it's the same bug shown here.bastingse wrote: 1. In the menu it is not showing the right text with Arabic and Chinese language. It does set the header to some numbers in the menu. However, on the page itself it is okay.
Re: Arabic and Chinese content
In CMSimple_XH 1.1.2 this particular bug had already been resolved:
But with multibyte character sets other than UTF-8 there may be similar issues, as e.g. the ">" sign encoded as Latin-1(character encoding of the PHP sources) is \x3E, which could be part of a multibyte character of the charset used for the content. Other characters may make problems as well, even an "h" (\x68) which could be part of a Big5 character.
IMHO one should use old CMSimple(_XH) versions only with single byte character sets that extends ASCII (such as ISO-8859-X). New versions of CMSimple_XH might have similar problems with characters sets other than UTF-8, by the way.
Code: Select all
$c = explode("\xC2\xA7", preg_replace("/(<h[1-".$cf['menu']['levels']."][^>]*>)/i", "\xC2\xA7\\1", str_replace("\xC2\xA7", '§', rf($pth['file']['content']))));
IMHO one should use old CMSimple(_XH) versions only with single byte character sets that extends ASCII (such as ISO-8859-X). New versions of CMSimple_XH might have similar problems with characters sets other than UTF-8, by the way.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Arabic and Chinese content
CMB and Manu, thank you both for reply to this topic. I'll see what i can do/change/update to my installation on this website.
I'm almost sure that i'll get it done with your tips and tricks!!
Thanks very much for your friendly help!
I'm almost sure that i'll get it done with your tips and tricks!!
Thanks very much for your friendly help!
Re: Arabic and Chinese content
Today i found out how to solve the problem of Arabic language from right to left........
Place text between div's and put in a dir="rtl"
Done !!
Thanks all for being so helpful !
Place text between div's and put in a dir="rtl"
Done !!
Thanks all for being so helpful !