1 [%- IF ctx.locales.keys.size > 1;
3 # Ensure the context locale is in xx_yy format
4 base_locale = ctx.locale FILTER lower;
5 base_locale = base_locale.replace('-','_');
7 set_locale = CGI.param('set_eg_locale') || CGI.cookie('eg_locale') || base_locale;
9 <form id="locale_picker_form" class="form-inline ml-auto" action="[% mkurl() %]" method="post">
10 <div class="input-group">
11 <label for="locale_picker" class="color_4 light_border col-3 text-left">[% l("Language:") %]</label>
12 [%- FOREACH param IN CGI.params(); -%]
13 [%- NEXT IF param.key == 'set_eg_locale'; -%]
14 <input type="hidden" name="[% param.key | html %]" value="[% param.value | html %]" />
17 <select id="locale_picker" name="set_eg_locale" class="form-control form-control-sm col-6">
18 [%- FOREACH locale IN ctx.locales.keys %]
19 [%- IF set_locale == locale;
20 selected = 'selected="selected"';
25 <option value="[% locale | html %]" [% selected %]>[% ctx.locales.$locale | html %]</option>
28 <button type="submit" class="btn btn-sm btn-confirm float-right"/><i class="fas fa-save" aria-hidden="true"></i>[% l("Save Changes") %]</button>