Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » switching locales in CMS adds extra '/admin' to URL

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 870 Views
  • theoldlr
    Avatar
    Community Member
    103 Posts

    switching locales in CMS adds extra '/admin' to URL Link to this post

    Hi,

    For some strange reason When I switch languages in the CMS it is messing up the URL. For example: http://mysite.com/admin/admin/?locale=pt_BR

    If I backspace the extra admin out then it loads properly. No idea how this is happening. From my _config.php:

    Object::add_extension('SiteTree', 'Translatable');
    Translatable::set_default_locale('en_US');

    $allowed_locales = array(
    'en_US' => array('English', 'English'),
    'pt_BR' => array('Portuguese', 'Português'),
    'es_CL' => array('Spanish', 'Español')
    );

    i18n::$common_locales = $allowed_locales;

    Thanks in advance!

    Edit: I should add that I have a few other sites configured the exact same way, none of which are having this problem.

    Edit: I just realized this only occurs in IE (which in my case is ie7) Any ideas for a fix?

  • Gregor
    Avatar
    Community Member
    1 Post

    Re: switching locales in CMS adds extra '/admin' to URL Link to this post

    Hi,

    I just had the same problem and found the solution:

    edit:>>>>>cms/javascript/LangSelector.js

    line 18: document.location = 'admin/?locale=' + this.value;

    change to this: document.location = '?locale=' + this.value;

    and it works as it should.

    Kind regads,
    Gregor

  • fiona
    Avatar
    Community Member
    3 Posts

    Re: switching locales in CMS adds extra '/admin' to URL Link to this post

    Anybody know the answer?

    ________________
    golf clubs

    870 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.