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, Ed, biapar, Willr, Ingo, swaiba

Sorting Languages

Go to End

2 Posts   1378 Views


Community Member, 102 Posts

12 October 2009 at 8:29pm

Edited: 15/10/2009 8:19am


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.



Community Member, 105 Posts

16 May 2011 at 6:52pm

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.