Feature 1451 : localization with gettext

Use php-gettext (developpement version rev43, because of php5.3) as fallback
Use native language (english) instead of key for translation
Keep directory en_UK for english customization
Need some refactoring for plurals

Todo : managing plugins in the same way

git-svn-id: http://piwigo.org/svn/trunk@5021 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2010-03-02 14:54:22 +00:00
parent 35694a636e
commit 2e890e9597
135 changed files with 22900 additions and 686 deletions
+6 -6
View File
@@ -55,10 +55,10 @@ class c13y_internal
if (version_compare($elem['current'], $elem['required'], '<'))
{
$c13y->add_anomaly(
sprintf(l10n('c13y_version_anomaly'), $elem['type'], $elem['current'], $elem['required']),
sprintf(l10n('The version of %s [%s] installed is not compatible with the version required [%s]'), $elem['type'], $elem['current'], $elem['required']),
null,
null,
l10n('c13y_version_correction')
l10n('You need to upgrade your system to take full advantage of the application else the application will not work correctly, or not at all')
.'<br>'.
$c13y->get_htlm_links_more_info());
}
@@ -80,10 +80,10 @@ class c13y_internal
if (($conf[$value]) and (!function_exists('read_exif_data')))
{
$c13y->add_anomaly(
sprintf(l10n('c13y_exif_anomaly'), '$conf[\''.$value.'\']'),
sprintf(l10n('%s value is not correct file because exif are not supported'), '$conf[\''.$value.'\']'),
null,
null,
sprintf(l10n('c13y_exif_correction'), '$conf[\''.$value.'\']')
sprintf(l10n('%s must be to set to false in your config_local.inc.php file'), '$conf[\''.$value.'\']')
.'<br>'.
$c13y->get_htlm_links_more_info());
}
@@ -208,7 +208,7 @@ class c13y_internal
create_user_infos($id);
$page['infos'][] = sprintf(l10n('c13y_user_created'), $name, $password);
$page['infos'][] = sprintf(l10n('User \"%s\" created with \"%s\" like password'), $name, $password);
$result = true;
}
@@ -239,7 +239,7 @@ class c13y_internal
array('primary' => array('user_id'),'update' => array('status')),
$updates);
$page['infos'][] = sprintf(l10n('c13y_user_status_updated'), get_username($id));
$page['infos'][] = sprintf(l10n('Status of user \"%s\" updated'), get_username($id));
$result = true;
}
+3 -3
View File
@@ -334,9 +334,9 @@ class check_integrity
return
sprintf
(
l10n('c13y_more_info'),
sprintf($link_fmt, $pwg_links['FORUM'], l10n('c13y_more_info_forum')),
sprintf($link_fmt, $pwg_links['WIKI'], l10n('c13y_more_info_wiki'))
l10n('Go to %s or %s for more informations'),
sprintf($link_fmt, $pwg_links['FORUM'], l10n('the forum')),
sprintf($link_fmt, $pwg_links['WIKI'], l10n('the wiki'))
);
}
+4 -4
View File
@@ -1182,7 +1182,7 @@ function create_virtual_category($category_name, $parent_id=null)
// is the given category name only containing blank spaces ?
if (preg_match('/^\s*$/', $category_name))
{
return array('error' => l10n('cat_error_name'));
return array('error' => l10n('The name of a category should not be empty'));
}
$parent_id = !empty($parent_id) ? $parent_id : 'NULL';
@@ -1268,7 +1268,7 @@ UPDATE
pwg_query($query);
return array(
'info' => l10n('cat_virtual_added'),
'info' => l10n('Virtual category added'),
'id' => $inserted_id,
);
}
@@ -1666,7 +1666,7 @@ SELECT id
return array(
'info' => sprintf(
l10n('Tag "%s" was added'),
l10n('Tag \"%s\" was added'),
stripslashes($tag_name)
),
'id' => $inserted_id,
@@ -1676,7 +1676,7 @@ SELECT id
{
return array(
'error' => sprintf(
l10n('Tag "%s" already exists'),
l10n('Tag \"%s\" already exists'),
stripslashes($tag_name)
)
);
@@ -204,8 +204,8 @@ function begin_users_env_nbm($is_to_send_mail = false)
$env_nbm['error_on_mail_count'] = 0;
$env_nbm['sent_mail_count'] = 0;
// Save sendmail message info and error in the original language
$env_nbm['msg_info'] = l10n('nbm_msg_mail_sent_to');
$env_nbm['msg_error'] = l10n('nbm_msg_error_sending_email_to');
$env_nbm['msg_info'] = l10n('Mail sent to %s [%s].');
$env_nbm['msg_error'] = l10n('Error when sending email to %s [%s].');
}
}
@@ -322,7 +322,7 @@ function display_counter_info()
else
{
if ($env_nbm['sent_mail_count'] == 0)
array_push($page['infos'], l10n('nbm_no_mail_to_send'));
array_push($page['infos'], l10n('No mail to send.'));
else
array_push($page['infos'], l10n_dec('nbm_msg_n_mail_sent', 'nbm_msg_n_mails_sent', $env_nbm['sent_mail_count']));
}
@@ -369,13 +369,13 @@ function do_subscribe_unsubscribe_notification_by_mail($is_admin_request, $is_su
if ($is_subscribe)
{
$msg_info = l10n('nbm_user_change_enabled_true');
$msg_error = l10n('nbm_user_not_change_enabled_true');
$msg_info = l10n('User %s [%s] was added to the subscription list.');
$msg_error = l10n('User %s [%s] was not added to the subscription list.');
}
else
{
$msg_info = l10n('nbm_user_change_enabled_false');
$msg_error = l10n('nbm_user_not_change_enabled_false');
$msg_info = l10n('User %s [%s] was removed from the subscription list.');
$msg_error = l10n('User %s [%s] was not removed from the subscription list.');
}
if (count($check_key_list) != 0)
@@ -385,7 +385,7 @@ function do_subscribe_unsubscribe_notification_by_mail($is_admin_request, $is_su
$data_users = get_user_notifications('subscribe', $check_key_list, !$is_subscribe);
// Prepare message after change language
$msg_break_timeout = l10n('nbm_break_timeout_send_mail');
$msg_break_timeout = l10n('Time to send mail is limited. Others mails are skipped.');
// Begin nbm users environment
begin_users_env_nbm(true);
@@ -408,7 +408,7 @@ function do_subscribe_unsubscribe_notification_by_mail($is_admin_request, $is_su
// set env nbm user
set_user_on_env_nbm($nbm_user, true);
$subject = '['.$conf['gallery_title'].']: '.($is_subscribe ? l10n('nbm_object_subscribe'): l10n('nbm_object_unsubscribe'));
$subject = '['.$conf['gallery_title'].']: '.($is_subscribe ? l10n('Unsubscribe from notification by mail'): l10n('Unsubscribe from notification by mail'));
// Assign current var for nbm mail
assign_vars_nbm_mail_content($nbm_user);
+3 -3
View File
@@ -87,7 +87,7 @@ SELECT permalink
{
$page['errors'][] =
sprintf(
l10n('Permalink_%s_histo_used_by_%s'),
l10n('Permalink %s has been previously used by category %s. Delete from the permalink history first'),
$permalink, $old_cat_id
);
return false;
@@ -140,7 +140,7 @@ function set_cat_permalink( $cat_id, $permalink, $save )
if ( $sanitized_permalink != $permalink
or preg_match( '#^(\d)+(-.*)?$#', $permalink) )
{
$page['errors'][] = l10n('Permalink_name_rule');
$page['errors'][] = l10n('The permalink name must be composed of a-z, A-Z, 0-9, \"-\", \"_\" or \"/\". It must not be numeric or start with number followed by \"-\"');
return false;
}
@@ -169,7 +169,7 @@ function set_cat_permalink( $cat_id, $permalink, $save )
{
$page['errors'][] =
sprintf(
l10n('Permalink_%s_histo_used_by_%s'),
l10n('Permalink %s has been previously used by category %s. Delete from the permalink history first'),
$permalink, $old_cat_id
);
return false;
+3 -3
View File
@@ -55,9 +55,9 @@ function set_plugins_tabsheet($selected)
$link = get_root_url().'admin.php?page=';
$tabsheet = new tabsheet();
$tabsheet->add('plugins_list', l10n('plugins_tab_list'), $link.'plugins_list');
$tabsheet->add('plugins_update', l10n('plugins_tab_update'), $link.'plugins_update');
$tabsheet->add('plugins_new', l10n('plugins_tab_new'), $link.'plugins_new');
$tabsheet->add('plugins_list', l10n('Plugin list'), $link.'plugins_list');
$tabsheet->add('plugins_update', l10n('Check for updates'), $link.'plugins_update');
$tabsheet->add('plugins_new', l10n('Other plugins'), $link.'plugins_new');
$tabsheet->select($selected);
$tabsheet->assign();
}
+2 -2
View File
@@ -127,7 +127,7 @@ WHERE id IN ("' . implode('","', $plugins) . '")
pwg_query($query);
array_push($page['infos'],
l10n('deactivated plugins').'<p><i>'.implode(', ', $plugins).'</i></p>');
l10n('As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:').'<p><i>'.implode(', ', $plugins).'</i></p>');
}
}
@@ -174,7 +174,7 @@ WHERE '.$conf['user_fields']['username'].'="'.$username.'"
if ($row['password'] != $conf['pass_convert']($password))
{
array_push($page['errors'], l10n('invalid_pwd'));
array_push($page['errors'], l10n('Invalid password!'));
}
elseif ($row['status'] != 'admin' and $row['status'] != 'webmaster')
{
+1 -1
View File
@@ -30,7 +30,7 @@ function waiting_tabsheet()
// TabSheet
$tabsheet = new tabsheet();
// TabSheet initialization
$tabsheet->add('comments', l10n('comments'), $link_start.'comments');
$tabsheet->add('Comments', l10n('Comments'), $link_start.'Comments');
$tabsheet->add('upload', l10n('Pictures'), $link_start.'upload');
// TabSheet selection
$tabsheet->select($page['page']);