mikehaertl / localeurls

Automatic locale/language management for URLs
10 stars 3 forks source link

usage of file translation #10

Closed fro35i closed 10 years ago

fro35i commented 10 years ago

How can yo use file translation with "localeurls" ? I use a theme but my translated view file will not be loaded:

themes/ThemeID/views/ControllerID/contact.php themes/ThemeID/views/ControllerID/LocaleID/contact.php

And how can i get a different naming in the urlpath for different languages?

I want: http://example.com/en/contact and use languaged naming convention for the actions. http://example.com/de/kontakt

Do I need to change the rules? Thanks Michael Cheers

mikehaertl commented 10 years ago

This extension does not support any translation in the URL. All it does is to detect the current language from the URL and create appropriate URLs that contain the current language code.

For any configuration issues with your translation files please check the guide. Maybe first try to get translations working, before you use this extension.

mbohal commented 10 years ago

You can achieve this by creating custom class which implements the createUrl() and parseUrl() methods (http://www.yiiframework.com/doc/api/1.1/CBaseUrlRule#createUrl-detail). Then tell the urlManager to use this class in your config file, i.e.

'components'=>array(
    ...
    'urlManager' => array(
        ...
        array('class' => 'application.components.I18nUrlRule')
fro35i commented 10 years ago

I already did this :) thanks mbohal.