[Rt-commit] rt branch, 3.999-trunk, updated. cec660aac337c18c0661144926110ee7c9ff8780
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Nov 18 02:55:57 EST 2009
The branch, 3.999-trunk has been updated
via cec660aac337c18c0661144926110ee7c9ff8780 (commit)
from 965cabb80f313a9339eab74cba3a29f365dc6403 (commit)
Summary of changes:
share/html/Elements/SelectLang | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit cec660aac337c18c0661144926110ee7c9ff8780
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Nov 18 15:55:37 2009 +0800
port rt3's SelectLang
diff --git a/share/html/Elements/SelectLang b/share/html/Elements/SelectLang
index 23349c9..4441a18 100755
--- a/share/html/Elements/SelectLang
+++ b/share/html/Elements/SelectLang
@@ -45,3 +45,37 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
+
+<select name="<%$name%>">
+% if ($show_null_option) {
+<option value="">-</option>
+% }
+% foreach my $lang (@lang) {
+<option value="<%$lang%>"<%(defined($default) && ($lang eq $default)) && qq[ selected="selected"] |n%>><% $lang_to_desc{$lang} %>
+% if (($verbose) and (my $description = I18N::LangTags::List::native_name($lang)) ){
+(<%$description%>)
+% }
+</option>
+% }
+</select>
+<%ARGS>
+$show_null_option => 1
+$show_all_queues => 1
+$name => undef
+$verbose => undef
+$default => 0
+$lite => 0
+</%ARGS>
+
+<%ONCE>
+use I18N::LangTags::List;
+my (@lang, %lang_to_desc);
+foreach my $lang (map { s/_/-/g; $_ } Jifty::I18N->available_languages) {
+ next if $lang =~ /i-default|en-us/;
+ my $desc = I18N::LangTags::List::name($lang);
+ next unless ($desc);
+ $desc =~ s/(.*) (.*)/$2 ($1)/ unless ( $desc =~ /.* \(.*\)/ );
+ $lang_to_desc{$lang} = $desc;
+}
+ at lang = sort { $lang_to_desc{$a} cmp $lang_to_desc{$b} } keys %lang_to_desc;
+</%ONCE>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list