Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of file translation #10

Closed
fro35i opened this issue Mar 3, 2014 · 3 comments
Closed

usage of file translation #10

fro35i opened this issue Mar 3, 2014 · 3 comments

Comments

@fro35i
Copy link

fro35i commented Mar 3, 2014

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
Copy link
Owner

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
Copy link

mbohal commented Mar 10, 2014

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
Copy link
Author

fro35i commented Mar 10, 2014

I already did this :) thanks mbohal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants