Yii Framework Forum: Localeurls - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Localeurls Automatic locale/language management for URLs Rate Topic: -----

#1 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 06 February 2013 - 03:16 PM

If you want to have the application language in your URLs like



/en/some/page
/de/some/page
http://www.example.com/en/some/page
http://www.example.com/de/some/page


then it has never been easier: Check out this new extension which does the dirty work for you.

http://www.yiiframew...ion/localeurls/

It's quick and easy to install, does not require any extra URL rules, creates language URLs transparently, supports a default language and persists the current language selection in session and a cookie.
0

#2 User is offline   Rasto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 06-February 13

Posted 07 February 2013 - 03:45 AM

And what about URLs with name of action in current language?
website.com/aboutus but in german website.com/uberuns?

and also for example I have forum programmed in Yii. How I can have URL website.com/forum/5/article-name-is-good-here-for-seo ?

Thanks
0

#3 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 07 February 2013 - 03:49 AM

View PostRasto, on 07 February 2013 - 03:45 AM, said:

And what about URLs with name of action in current language?


That's a different story :). You'll need a custom URL rule for this case anyway because how should an extension know, how you want to translate your page names?

This extension is only for applications where the URLs use the above patterns.
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 07 February 2013 - 03:51 AM

View PostRasto, on 07 February 2013 - 03:45 AM, said:

and also for example I have forum programmed in Yii. How I can have URL website.com/forum/5/article-name-is-good-here-for-seo ?


You can achieve that with regular URL rules or with a custom URL rule class. Please read the guide on this topic:
http://www.yiiframew...1/en/topics.url


0

#5 User is offline   Rasto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 06-February 13

Posted 07 February 2013 - 04:03 AM

View PostMike, on 07 February 2013 - 03:49 AM, said:

That's a different story :). You'll need a custom URL rule for this case anyway because how should an extension know, how you want to translate your page names?

Maybe from translations file :) I don't know I am just asking if somebody done this before.

Thanks for your answers.
0

#6 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 20 February 2013 - 04:27 AM

Updated the extension to 1.1.0: Handling of the default language has been improved. Default is now, whatever you configure in your main app config. You can decide if you want a redirect from www.example.com to www.example.com/en (if en is your default), by setting redirectDefault. Default is false.
0

#7 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 21 February 2013 - 04:26 AM

And yet another update (1.1.2): The extension now by default tries to auto detect the preferred user language from the HTTP headers (using CHttpRequest::preferredLanguages). It can be disabled through 'detectLanguage' => false.
0

#8 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 13 March 2013 - 04:03 AM

New Version 1.1.3: You can now map URL names to languages. So e.g. http://example.com/english/some/page can be mapped to language 'en'.
Find the full docs here.
0

#9 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 22 March 2013 - 05:15 AM

New Version 1.1.4: Fix an issue where you could not create links to reset to default language.
0

#10 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 09 April 2013 - 12:05 PM

New Version 1.1.5: Fix an issue where the query string ("?a=b") was lost, when you tried to switch to default language.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users