Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Sorting Languages

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: 1101 Views
  • patjnr
    Community Member
    101 Posts

    Sorting Languages Link to this post


    i have a multilingual website with 4 translations ie de, fr, it, en. and im populating a drop down with all the available languages..

    <% if Translations %>
    <FORM NAME="form2">
    <SELECT NAME="select" >
    <% control Translations %>
    <OPTION <% if current %>selected<% end_if %> VALUE="$link"><% sprintf(_t('SHOWINPAGE',' %s'),$name) %></option>
    <% end_control %>
    <% end_if %>

    this is producing all languages in this order;


    Now how do i sort these languages, i want english to come last of this list.


  • CodeGuerrilla
    Community Member
    105 Posts

    Re: Sorting Languages Link to this post

    I would also like to know how to do this, I have looked at overloading Translatable::getTraslations but don't really see a way to do this as the language name is in the _config.php file and stored in: i18n::$common_locales, I also don't understand in which order they are currently appearing am guessing is the order the translations were created in the CMS? As it does not appear the order is by locale or by the order of $common_locales array.

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.