Jump to:

23477 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Pretty I18N URL like example.com/en/hello

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

Page: 1
Go to End
Author Topic: 1666 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    Pretty I18N URL like example.com/en/hello Link to this post

    I want to use SS for a website that gets translated into 7 languages. This recipe has modified the URL to what I want (example.com/en/hello/ example.com/fr/salut/ example.com/de/hallo/).

    But …
    1. … there is no "Director::addRules(10, array" code line anymore in 2.4.1 so I can't put in the new code
    2. … this will cause a lot of trouble with nested URL, right?

    I do only have two choices: put the translated pages into a subfolder or into a subdomain.

    Any ideas how I can get there with SS?

  • oleze
    Avatar
    Community Member
    65 Posts

    Re: Pretty I18N URL like example.com/en/hello Link to this post

    I would like to do that too. Should be standard within the whole CMS because it's much more SEO-friendly. Can anyone help us?

    Edit: I've found a ticket for that: http://open.silverstripe.org/ticket/5909

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Pretty I18N URL like example.com/en/hello Link to this post

    I've done a lot of research and tried various methods. Unfortunately theses two ones which would be fine are no longer supported in v.2.4 (cause code has changed) and the new nested URL.

    At this time it seems there is no way to achieve this with SS.

  • leafchild
    Avatar
    Community Member
    41 Posts

    Re: Pretty I18N URL like example.com/en/hello Link to this post

    Still no support for v.2.4?

  • Chris_Bryer
    Avatar
    Community Member
    35 Posts

    Re: Pretty I18N URL like example.com/en/hello Link to this post

    hi all,
    so in silverstripe 3.0, silverstripe is pulling translatable out of the core and turning it into a module which i am excited about because it means we dont have to hack the core to do certain things.

    I created a module that silverstripe is looking to merge into their translatable module associate domains to specific locales. it was originally built to handle different top level domains (like .de, .fr, .jp, etc), but i modified it so it should be able to handle subdomains within one tld as well. there isnt any support for sub directories like you are looking for, but for now its something. we havent incorporated it into the translatable module yet because it needs some beta testing, and i didnt add it to silverstripe's module list because it will probably be merged into translatable in the future.

    also, i included directions on how to set up multiple virtual hosts to simulate multiple domains while you are developing.

    you can download the module at https://github.com/cbryer/Translatable-Domains

    if you get a chance to kick the tires, please let me know how it goes, or if you have any questions.
    -Chris

    1666 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.