Forums / Setup & design / Multi-languages and encoding

Multi-languages and encoding

Author Message

Guillaume D

Wednesday 13 October 2010 7:46:09 am

Hello,

here is my encoding problematic :

 

can a single ezpublish instance work with multiple languages, as far as different from latin languages ( French, English ) to Chinese, Russian and Arabic ?

 

Is an UTF8 encoded mysql db and UTF8 encoded ez templates enough for that ?

 

is it possible ? do we have to choose another encoding for that, or different encodings with different databases ?

 

as anyone already encountered this problematic ?

 

here is the project :

 

-1 single ezpublish instance, containing up to 15 international sites ( with different content trees ), with 1 to 3 languages per site.

 

- The back-office is only in French and English.

 

for example, list of sites and their languages :

 

- French,English

 

- German,French

 

- Mandarin

 

- Korean

 

- Arabic,English

 

- Italian,English

 

- Japanese

 

- French,English

 

- Romanian,English,French

 

- Russian,English,French

 

- Mandarin

 

- French,English

 

-Turkish,English

 

Environnement :

 

- ezpublish 4.0.2 w already existing specific extensions and templates UTF8 encoded

 

- MySql : 5.0.51a / UTF8 encoded

Thanks,

Best Regards.

Gaetano Giunta

Wednesday 13 October 2010 10:17:45 am

Using utf8 for the db should be good.

For the rendered pages, only japanese/chinese have (afaik) the need not to use utf8, as the font/browser support is still quite incomplete, so that utf8 code point exists but it will not be displayed properly.

But if you are careful enough in your config, you can have a correct chain:

- UTF8 data

- UTF8 settings files

- UTF8 or JP templates, depending on the siteaccess

- final page is rendered in the correct character set (based on setting in i18n.ini)

Principal Consultant International Business
Member of the Community Project Board

Gaetano Giunta

Wednesday 13 October 2010 10:18:55 am

ps: please do have the php mbstring extension enabled when you start to do charset juggling

Principal Consultant International Business
Member of the Community Project Board

Guillaume D

Thursday 14 October 2010 2:52:03 am

Thank you Gaetano for your answer.

I don't understand about the "JP templates". Do you say we'll have to use a different encoding for JP templates ?

For japanese language, in the local settings, the PreferedEncoding is UTF 8. So must we have to change that ?

In the case of an encoding change in the japan locale, or a choice of a different language as Turkish ( in locale Preferred=iso-8859-9 ) .. won't we have a conflict below in the web browser ? :

- Data ( UTF 8 )

- templates ( encoding in the new charset XXX )

- settings in UTF8

- i18n for siteaccess : ( encoding in the new charset XXX )

We will look forward to checking and testing mbstring.

Eric Sagnes

Thursday 14 October 2010 7:19:05 pm

Hi Guillaume,

From my experience, UTF8 will work without problems for Chinese, Japanese and Korean and theorically any langage, I suppose what Gaetano was refering was the font priority problem in rendering ideograms.
You can see the details of it at http://en.wikipedia.org/wiki/Unihan , but basically unicode defines "points" and not "characters", so even if the same ideogram is written in a different way in Japanese and Chinese, it will be one unicode "point", the font being responsable for rendering the right character.

But as the Japanese, Korean and Chinese users usually have their langage font on the top priority, it is not something you should worry much about.
The only tricky cases being when you mix Japanese, Korean and Chinese on the same page. The best practice in such cases being to set the lang attribute directly on the html tags, eventhough the browser might not render it with right font.

I personally think that a unicode charset is always the best choice as it is the only charset that allow to mix all the alphabets/symbols in the same document. (note that UTF8 is also ASCII compatible)

I hope it can help.

Guillaume D

Wednesday 20 October 2010 2:26:39 am

Eric,

sure il will help us :-)

We won't mix different languages in a same page, so no problem on this point.

Thanks a lot.

eZ debug

Timing: Jan 18 2025 04:13:06
Script start
Timing: Jan 18 2025 04:13:06
Module start 'content'
Timing: Jan 18 2025 04:13:06
Module end 'content'
Timing: Jan 18 2025 04:13:06
Script end

Main resources:

Total runtime0.1692 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.7109180.8438
Module start 'content' 0.00690.0139 768.5547101.8828
Module end 'content' 0.02070.1484 870.4375533.2578
Script end 0.1692  1,403.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00342.0015200.0002
Check MTime0.00140.8066200.0001
Mysql Total
Database connection0.00090.525310.0009
Mysqli_queries0.113967.29401410.0008
Looping result0.00160.95571390.0000
Template Total0.148287.510.1482
Template load0.00080.472610.0008
Template processing0.147487.069310.1474
Override
Cache load0.00050.310810.0005
Sytem overhead
Fetch class attribute can translate value0.00090.549510.0009
XML
Image XML parsing0.00020.131710.0002
General
dbfile0.00181.0483200.0001
String conversion0.00000.005430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs