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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1444 Views

Avatar
patjnr

Community Member, 102 Posts

12 October 2009 at 8:29pm

Edited: 15/10/2009 8:19am

Hi

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 %>
                        </SELECT>
                    </FORM>
                <% end_if %> 

this is producing all languages in this order;

english
Deutsch
français
italiano

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

tx

Avatar
CodeGuerrilla

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.