Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Language URL Prefix without translatable module


Reply


4 Posts   399 Views

Avatar
dondon

Community Member, 5 Posts

2 May 2013 at 9:17pm

Hi Guys,

Ive been searching for answers on how to add a language prefix in the url but it all leads me to translatable module..I don't want to install the translatable module i just want to add a language prefix and retain the english title of the page. Below are the example url.

http://mydomain/en/english-page-title
http://mydomain/es/english-page-title

Please help guys...Thanks in advance.

Avatar
knsqnt

Community Member, 85 Posts

2 May 2013 at 9:45pm

If you don't want to use the module, you have to create a separate site for each language. So why not put the language in the site tree to get it in the url:

SiteTree
- home
- en
- - english page
- es
- - spanish page

Not nice, but works.

Avatar
dondon

Community Member, 5 Posts

2 May 2013 at 10:53pm

Edited: 02/05/2013 11:03pm

Thanks theGermaniac...but the url on my first post that's just an example. I'm currently building a social networking tool for musicians just like the reverbnation.com i want all url of my site prefix with language ..its not just simple page with subpages.

A good example is http://ap.ign.com/en

Avatar
knsqnt

Community Member, 85 Posts

3 May 2013 at 4:52am

If you have pages in different languages, take the translation module. If you need a more complex way for your translations, extend the module. If you create every page independently from it's translation, make it by grouping the pages like I told you. Every page goes beneath it's language. Pages not belonging to any language create directly under root.

Another question: If you don't use the translation module, how do you want to let the system know what page is in wich language?