From: Ivan Kohler Date: Sun, 25 Sep 2016 20:11:19 +0000 (-0700) Subject: localize preferences page, starting with patch from Fernando Kiernan , modified to fix escaping --- diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index b622efc15..75e57958f 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -2,7 +2,7 @@ % $cgi->param('error', $error); <% $cgi->redirect(popurl(1). "pref.html?". $cgi->query_string ) %> % } else { -<% include('/elements/header.html', 'Preferences updated') %> +<% include('/elements/header.html', mt('Preferences updated')) %> <% include('/elements/footer.html') %> % } <%init> @@ -25,13 +25,13 @@ if ( FS::Auth->auth_class->can('change_password') my $newpass = $cgi->param('new_password'); if ( $newpass ne $cgi->param('new_password2') ) { - $error = "New passwords don't match"; + $error = mt("New passwords don't match"); } elsif ( ! length($newpass) ) { - $error = 'No new password entered'; + $error = mt('No new password entered'); } elsif ( ! FS::Auth->authenticate( $access_user, $oldpass ) ) { - $error = 'Current password incorrect; password not changed'; + $error = mt('Current password incorrect; password not changed'); } else { @@ -67,7 +67,7 @@ unless ( $error ) { # if ($access_user) { foreach (@paramlist) { scalar($cgi->param($_)) =~ /^[,.\-\@\w]*$/ && next; - $error ||= "Illegal value for parameter $_"; + $error ||= mt("Illegal value for parameter")." $_"; last; } diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index 93c71996c..724967d95 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -1,26 +1,26 @@ -<% include('/elements/header.html', 'Preferences for '. $FS::CurrentUser::CurrentUser->username ) %> +<& /elements/header.html, mt('Preferences for [_1]', $FS::CurrentUser::CurrentUser->username) &>
-<% include('/elements/error.html') %> +<& /elements/error.html &> % if ( FS::Auth->auth_class->can('change_password') ) { - <% mt('Change password (leave blank for no change)') |h %> + <% emt('Change password (leave blank for no change)') %> <% ntable("#cccccc",2) %> - Current password: + <% emt("Current password:") %> - New password: + <% emt("New password:") %> - Re-enter new password: + <% emt("Re-enter new password:") %> @@ -29,11 +29,11 @@ % } -Interface +<% emt("Interface") %> <% ntable("#cccccc",2) %> - Locale: + <% emt("Locale:") %> > Left
- > Top
+ > <% emt("Left") %>
+ > <% emt("Top") %>
- Enable mobile-friendly menu: + <% emt("Enable mobile-friendly menu:") %> option('mobile_menu') ? 'CHECKED' : '' %>> @@ -64,7 +64,7 @@ Interface - Default customer view: + <% emt("Default customer view:") %> @@ -80,21 +80,21 @@ Interface % my $history_order = $curuser->option('history_order') || 'oldest'; - Customer history sort order: + <% emt("Customer history sort order:") %> <& /elements/select.html, field => 'history_order', curr_value => $history_order, options => [ 'oldest', 'newest' ], - labels => { 'oldest' => 'Oldest first', - 'newest' => 'Newest first', + labels => { 'oldest' => mt('Oldest first'), + 'newest' => mt('Newest first'), }, &> - Spreadsheet download format: + <% emt("Spreadsheet download format:") %> option('disable_html_editor') ? 'CHECKED' : '' %>> - Disable submission on [Enter] key - one-time charges: + <% emt("Disable submission on Enter key - one-time charges:") %> option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>> - Don't copy MAC address delimiters to clipboard + <% emt("Don't copy MAC address delimiters to clipboard") %> option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>> - Scale documents to fit on a letter-size page + <% emt("Scale documents to fit on a letter-size page") %> option('printtofit') ? 'CHECKED' : '' %>> - How many recently-modified customers displayed on dashboard + <% emt("How many recently-modified customers displayed on dashboard") %> - How many recent outbound emails to show in customer view + <% emt("How many recent outbound emails to show in customer view") %> @@ -154,11 +154,11 @@ Interface
-Email Address +<% emt("Email Address") %> <% ntable("#cccccc",2) %> - Email Address(es) (comma separated) + <% emt("Email Address(es) (comma separated) ") %> @@ -168,35 +168,35 @@ Email Address
-Development +<% emt("Development") %> <% ntable("#cccccc",2) %> - Show customer package timestamps: + <% emt("Show customer package timestamps:") %> option('cust_pkg-display_times') ? 'CHECKED' : '' %>> - Show internal package numbers: + <% emt("Show internal package numbers:") %> option('show_pkgnum') ? 'CHECKED' : '' %>> - Show config item counts: + <% emt("Show config item counts:") %> option('show_confitem_counts') ? 'CHECKED' : '' %>> - Show export data on service view (when available): + <% emt("Show export data on service view (when available):") %> option('export_getsettings') ? 'CHECKED' : '' %>> - Show database profiling (when available): + <% emt("Show database profiling (when available):") %> option('show_db_profile') ? 'CHECKED' : '' %>> - Save database profiling logs (when available): + <% emt("Save database profiling logs (when available):") %> option('save_db_profile') ? 'CHECKED' : '' %>> - Save temporary invoice typesetting files: + <% emt("Save temporary invoice typesetting files:") %> option('save_tmp_typesetting') ? 'CHECKED' : '' %>> @@ -205,44 +205,44 @@ Development % if ( $curuser->access_right('Employee preference telephony integration') ) { -SNOM integration +<% emt("SNOM integration") %> <% ntable("#cccccc",2) %> - SNOM IP address + <% emt("SNOM IP address") %> - SNOM HTTP username (if necessary) + <% emt("SNOM HTTP username (if necessary)") %> - SNOM HTTP password (if necessary) + <% emt("SNOM HTTP password (if necessary)") %>
-OR

+<% emt("OR")%>

-Vonage integration (see Click2Call) +<% emt("Vonage integration (see") %> <% emt("Click2Call") %>) <% ntable("#cccccc",2) %> - Vonage phone number + <% emt("Vonage phone number") %> - Vonage username + <% emt("Vonage username") %> - Vonage password + <% emt("Vonage password") %> @@ -258,9 +258,9 @@ Vonage integration (see Click2Call % } - +"> -<% include('/elements/footer.html') %> +<&/elements/footer.html &> <%init> my $curuser = $FS::CurrentUser::CurrentUser;