Forums / Developer / Impossible to create a truly multi-lingual web site

Impossible to create a truly multi-lingual web site

Author Message

Sven Ryen

Sunday 03 August 2003 9:45:37 am

As far as I can tell, creating a multi-lingual site with EZ Publish is impossible - at least if you want all content to adhere to the selected Locale.

I have managed to localize the content of template files, through x18n. The current view of the content module displays the language specified in the URI.

But, the _template functions_ do not seem to take into account neither the currently chosen locale, nor the language specified in the querystring, when content is fetched from the database.

The site I'm working on relies heavily on the {fetch("content","list",...)} function, and so far, attempts of receiving content in any language other than Norwegian have been unsucessful.

I have tried browsing through the attributes returned by content list, by using |attribute(show), and have come across objects that contain lists of available translations and locales. I found no data structure that would allow easy access to the translation corresponding to the selected locale.

I know I could be missing something, so if you have any suggestions on what to do, please respond.

Sven Ryen

Sunday 03 August 2003 2:15:15 pm

To clarify: I wanted to dynamically set the current ContentObjectLocale (not just read it from the site.ini-file).

I was able to work around this by modifying the two files:
/kernel/classes/ezcontentobjecttreenode.php
/kernel/classes/ezcontentobject.php

The following code reads out the session variable that has been previously set through another module, and defaults to the value from the ini file if the session variable is empty:

$lang = false;
$xpohttp =& eZHTTPTool::instance();
//$xpohttp->setSessionVariable( "xpoLocale" ,"nor-NO");
if ( $xpohttp->hasSessionVariable( "xpoLocale" ) ) {
$lang = $xpohttp->sessionVariable( "xpoLocale" );
}
if ($lang === false) {
$ini =& eZINI::instance();
$lang = $ini->variable( 'RegionalSettings', 'ContentObjectLocale' );
}

It's odd that this functionality is not built into EZ Publish by default, as few modifications were needed to make this work.

It took some effort to figure out how to accomplish it though.

Feel free to contact me if you want more info. sven[at]maxus.no

Jan Borsodi

Monday 04 August 2003 1:55:51 am

One way to get multilingual site is to use one siteaccess per language and enable url based siteaccess matching.
For instance an article in english would have the url
/en/content/view/full/42
while the japanese version would have
/jp/content/view/full/42

Here the en and jp of the url is the siteaccess. On each siteaccess you will alter the locale and content object locale to the given language (site.ini).

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Sven Ryen

Tuesday 05 August 2003 1:44:29 am

Thanks, Jan, for offering a possible solution!

I'm afraid siteaccesses would not be sufficient for this project, as the client wants to add translations at any given time, and she is not technically capable of editing the ini-files.

Your cms would have much broader appeal to non-programmers, if more tasks could be accomplished without editing the ini's.

Bård Farstad

Tuesday 05 August 2003 2:04:33 am

Sven, take a look at fast.no. This site has nine different languages. Using the site access method.

-bård

Documentation: http://ez.no/doc

Jan Borsodi

Tuesday 05 August 2003 2:23:26 am

How often would new languages be added? Not very often I would guess.

But to make it easier to add new languages I suggest you make a new module which creates the siteaccess with the necessary .ini files.
It shouldn't be too much php code write either.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Selmah Maxim

Tuesday 05 August 2003 3:13:04 am

Hi Sven ...

You said :
"I'm afraid siteaccesses would not be sufficient for this project, as the client wants to add translations at any given time, and she is not technically capable of editing the ini-files.

Your cms would have much broader appeal to non-programmers, if more tasks could be accomplished without editing the ini's. "

I think this much better for you to gain more money :)

To make new module to creat site ini files and accesse in the best, I don`t think you will find any program can do this for you, actually maybe there is one with C# named 'vignette' the site : http://vignette.com/
some thing like this, but check the price and also read this at sitepoint.com :
http://www.sitepointforums.com/showthread.php?threadid=102813
(you must read this all .. its LOL :) )

The Ezp is you best choice !

cfa cfa

Thursday 14 August 2003 12:55:34 am

any idea of what DATABASE character set fast.no is using? the have one asian language (japanese), so i wonder if they are working with utf-8.

the search function works OK in japanese.

eZ debug

Timing: Jan 18 2025 15:18:51
Script start
Timing: Jan 18 2025 15:18:51
Module start 'content'
Timing: Jan 18 2025 15:18:52
Module end 'content'
Timing: Jan 18 2025 15:18:52
Script end

Main resources:

Total runtime0.9404 sec
Peak memory usage4,096.0000 KB
Database Queries215

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.9922180.8125
Module start 'content' 0.00580.8260 769.8047711.4688
Module end 'content' 0.83180.1085 1,481.2734340.4297
Script end 0.9403  1,821.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.4663210.0002
Check MTime0.00180.1913210.0001
Mysql Total
Database connection0.00060.066010.0006
Mysqli_queries0.868492.34402150.0040
Looping result0.00180.18892130.0000
Template Total0.915497.320.4577
Template load0.00200.217420.0010
Template processing0.913497.124720.4567
Template load and register function0.00010.008810.0001
states
state_id_array0.00080.083510.0008
state_identifier_array0.00080.087220.0004
Override
Cache load0.00180.1967640.0000
Sytem overhead
Fetch class attribute can translate value0.00120.122460.0002
Fetch class attribute name0.00060.0690100.0001
XML
Image XML parsing0.00150.154460.0002
class_abstraction
Instantiating content class attribute0.00000.0016110.0000
General
dbfile0.00380.4080350.0001
String conversion0.00000.000730.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs