Module localization

Author Message

Sao Tavi

Sunday 08 May 2011 3:35:50 am

I was wondering if there is possible to localize the module url.

As for example, a module called user profile that can be accessed at http://www.example.com/eng/user-profile, but I want, for Spanish users, the module to be also accessible at http://www.example.com/esl/perfil-del-usuario (or whatever the right translation may be).

I've tried doing this through .htaccess, but it does not work and I am not knowledgeable enough to be able to debug why not. Here is my htaccess file (I removed my modifications)

# Copy this file to a new file called .htaccess in your eZ Publish root
# to make the site more secure in non-virtualhost mode (index.php used in urls).
#

DirectoryIndex index.php
 
RewriteEngine On
 
# RewriteCond %{HTTP_HOST} ^webdav\..*
# RewriteRule ^(.*) webdav.php [L]
# RewriteCond %{HTTP_HOST} ^soap\..*
# RewriteRule ^(.*) soap.php [L]
 
RewriteRule content/treemenu/? /index_treemenu.php [L]
 
RewriteRule ^var/storage/.* - [L]
RewriteRule ^var/[^/]+/storage/.* - [L]
RewriteRule ^var/([^/]+/)?cache/(texttoimage|public)/.* - [L]
 
RewriteRule ^design/[^/]+/(stylesheets|images|javascript)/.* - [L]
RewriteRule ^share/icons/.* - [L]
RewriteRule ^extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
Rewriterule ^packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^packages/styles/.+/thumbnail/.* - [L]
 
RewriteRule ^favicon\.ico - [L]
RewriteRule ^robots\.txt - [L]
 
# Uncomment the following lines when using popup style debug.
# RewriteRule ^var/cache/debug\.html.* - [L]
# RewriteRule ^var/[^/]+/cache/debug\.html.* - [L]
RewriteRule  ^(.*)esl/perfil-del-usuario(/.*)?$  $1esl/user-profile$2 [L]
RewriteRule .* index.php [L]

I also tried changing last line to

 RewriteRule .* indexProxy.php [L]

And in indexProxy.php changing indexProxy.php to index.php and perfil-del-usuario to user-profile in REQUEST_URI, PHP_SELF, SCRIPT_NAME and then including index.php, but, in practice, this does not work.

I have several modules that I want to have the url translated. Do the links really have to be the module names, or can they be localized? If not, shouldn't this be a feature?

Gaetano Giunta

Sunday 08 May 2011 10:45:53 am

You can translate module names using the virtual urls feature within the eZP admin interface

Principal Consultant International Business
Member of the Community Project Board

Sao Tavi

Monday 09 May 2011 2:31:21 pm

Thank you for your kind reply.

I found the menu, but it seems that I have problems using it. I have, for example, a module called 'coordonate-localitati' that has a view, 'cauta' As it is enable site-wise, the url would be ezroot()/coordonate-localitati/cauta.

On the other hand, I want for English version the url to be: "geographical-coordinates/search".

The problem is that regardless what url I type in the text-box labeled "Destination (path to existing functionality or resource):", I get a response like

"The specified destination URL <coordonate-localitati/cauta> does not exist in the system, cannot create alias for it"

(Sorry for the big letters, it's copy paste and I don't know how to make them small)

So... is there some additional step that I missed? Or what should I input at the "Destination" in my example?

Sao Tavi

Monday 16 May 2011 10:04:48 am

It took a while of searching and hair pulling, but eventually I realized that "-" gets transformed. So, I had to rename my extension by removing the - and everything worked fine.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:18:59
Script start
Timing: Jan 18 2025 05:18:59
Module start 'layout'
Timing: Jan 18 2025 05:18:59
Module start 'content'
Timing: Jan 18 2025 05:19:01
Module end 'content'
Timing: Jan 18 2025 05:19:01
Script end

Main resources:

Total runtime1.2966 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.8125152.6094
Module start 'layout' 0.00680.0034 740.421939.4219
Module start 'content' 0.01021.2851 779.8438551.9141
Module end 'content' 1.29530.0013 1,331.757812.5000
Script end 1.2965  1,344.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2560160.0002
Check MTime0.00130.1001160.0001
Mysql Total
Database connection0.00060.045110.0006
Mysqli_queries1.246096.0991600.0208
Looping result0.00050.0379580.0000
Template Total1.265197.620.6326
Template load0.00190.144120.0009
Template processing1.263297.428120.6316
Template load and register function0.00010.011510.0001
states
state_id_array0.00090.072310.0009
state_identifier_array0.00120.092020.0006
Override
Cache load0.00160.1259240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.055820.0004
Fetch class attribute name0.00190.145850.0004
XML
Image XML parsing0.00060.044220.0003
class_abstraction
Instantiating content class attribute0.00000.000850.0000
General
dbfile0.00080.0613160.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs