Skip to content

Commit

Permalink
gettext conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Delisle committed May 9, 2010
1 parent fde1269 commit 632211d
Show file tree
Hide file tree
Showing 84 changed files with 12,248 additions and 11,394 deletions.
2 changes: 1 addition & 1 deletion db_create.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
require_once './libraries/header.inc.php';
require_once './main.php';
} else {
$message = PMA_Message::success('strDatabaseHasBeenCreated');
$message = PMA_Message::success(__('Database %1$s has been created.'));
$message->addParam($new_db);
$GLOBALS['db'] = $new_db;

Expand Down
8 changes: 4 additions & 4 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}

if (!isset($newname) || !strlen($newname)) {
$message = PMA_Message::error('strDatabaseEmpty');
$message = PMA_Message::error(__('The database name is empty!'));
} else {
$sql_query = ''; // in case target db exists
$_error = false;
Expand Down Expand Up @@ -233,11 +233,11 @@
$sql_query .= "\n" . $local_query;
PMA_DBI_query($local_query);

$message = PMA_Message::success('strRenameDatabaseOK');
$message = PMA_Message::success(__('Database %s has been renamed to %s'));
$message->addParam($db);
$message->addParam($newname);
} elseif (! $_error) {
$message = PMA_Message::success('strCopyDatabaseOK');
$message = PMA_Message::success(__('Database %s has been copied to %s'));
$message->addParam($db);
$message->addParam($newname);
}
Expand Down Expand Up @@ -606,7 +606,7 @@

if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
$message = PMA_Message::notice('strRelationNotWorking');
$message = PMA_Message::notice(__('The additional features for working with linked tables have been deactivated. To find out why click %shere%s.'));
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
$message->addParam('</a>', false);
/* Show error if user has configured something, notice elsewhere */
Expand Down
26 changes: 13 additions & 13 deletions import.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
;
if ($_POST == array() && $_GET == array()) {
require_once './libraries/header.inc.php';
$message = PMA_Message::error('strUploadLimit');
$message = PMA_Message::error(__('You probably tried to upload too large file. Please refer to %sdocumentation%s for ways to workaround this limit.'));
$message->addParam('[a@./Documentation.html#faq1_16@_blank]');
$message->addParam('[/a]');

Expand Down Expand Up @@ -276,15 +276,15 @@
*/
$compression = PMA_detectCompression($import_file);
if ($compression === FALSE) {
$message = PMA_Message::error('strFileCouldNotBeRead');
$message = PMA_Message::error(__('File could not be read'));
$error = TRUE;
} else {
switch ($compression) {
case 'application/bzip2':
if ($cfg['BZipDump'] && @function_exists('bzopen')) {
$import_handle = @bzopen($import_file, 'r');
} else {
$message = PMA_Message::error('strUnsupportedCompressionDetected');
$message = PMA_Message::error(__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.'));
$message->addParam($compression);
$error = TRUE;
}
Expand All @@ -293,7 +293,7 @@
if ($cfg['GZipDump'] && @function_exists('gzopen')) {
$import_handle = @gzopen($import_file, 'r');
} else {
$message = PMA_Message::error('strUnsupportedCompressionDetected');
$message = PMA_Message::error(__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.'));
$message->addParam($compression);
$error = TRUE;
}
Expand All @@ -312,7 +312,7 @@
$import_text = $result['data'];
}
} else {
$message = PMA_Message::error('strUnsupportedCompressionDetected');
$message = PMA_Message::error(__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.'));
$message->addParam($compression);
$error = TRUE;
}
Expand All @@ -321,20 +321,20 @@
$import_handle = @fopen($import_file, 'r');
break;
default:
$message = PMA_Message::error('strUnsupportedCompressionDetected');
$message = PMA_Message::error(__('You attempted to load file with unsupported compression (%s). Either support for it is not implemented or disabled by your configuration.'));
$message->addParam($compression);
$error = TRUE;
break;
}
}
// use isset() because zip compression type does not use a handle
if (!$error && isset($import_handle) && $import_handle === FALSE) {
$message = PMA_Message::error('strFileCouldNotBeRead');
$message = PMA_Message::error(__('File could not be read'));
$error = TRUE;
}
} elseif (!$error) {
if (!isset($import_text) || empty($import_text)) {
$message = PMA_Message::error('strNoDataReceived');
$message = PMA_Message::error(__('No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See [a@./Documentation.html#faq1_16@Documentation]FAQ 1.16[/a].'));
$error = TRUE;
}
}
Expand Down Expand Up @@ -369,7 +369,7 @@
// Check for file existance
if (!file_exists('./libraries/import/' . $format . '.php')) {
$error = TRUE;
$message = PMA_Message::error('strCanNotLoadImportPlugins');
$message = PMA_Message::error(__('Could not load import plugins, please check your installation!'));
} else {
// Do the real import
$plugin_param = $import_type;
Expand All @@ -394,11 +394,11 @@

// Show correct message
if (!empty($id_bookmark) && $action_bookmark == 2) {
$message = PMA_Message::success('strBookmarkDeleted');
$message = PMA_Message::success(__('The bookmark has been deleted.'));
$display_query = $import_text;
$error = FALSE; // unset error marker, it was used just to skip processing
} elseif (!empty($id_bookmark) && $action_bookmark == 1) {
$message = PMA_Message::notice('strShowingBookmark');
$message = PMA_Message::notice(__('Showing bookmark'));
} elseif ($bookmark_created) {
$special_message = '[br]' . sprintf(__('Bookmark %s created'), htmlspecialchars($bkm_label));
} elseif ($finished && !$error) {
Expand All @@ -412,7 +412,7 @@
$message->addString($import_notice);
$message->addString('(' . $_FILES['import_file']['name'] . ')');
} else {
$message = PMA_Message::success('strImportSuccessfullyFinished');
$message = PMA_Message::success(__('Import has been successfully finished, %d queries executed.'));
$message->addParam($executed_queries);
$message->addString('(' . $_FILES['import_file']['name'] . ')');
}
Expand All @@ -421,7 +421,7 @@

// Did we hit timeout? Tell it user.
if ($timeout_passed) {
$message = PMA_Message::error('strTimeoutPassed');
$message = PMA_Message::error(__('Script timeout passed, if you want to finish import, please resubmit same file and import will resume.'));
if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) {
$message->addString('strTimeoutNothingParsed');
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/Index.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static public function getView($table, $schema, $print_mode = false)
$indexes = PMA_Index::getFromTable($table, $schema);

if (count($indexes) < 1) {
return PMA_Message::warning('strNoIndex')->getDisplay();
return PMA_Message::warning(__('No index defined!'))->getDisplay();
}

$r = '';
Expand Down Expand Up @@ -573,7 +573,7 @@ static public function findDuplicates($table, $schema)
// did not find any difference
// so it makes no sense to have this two equal indexes

$message = PMA_Message::warning('strIndexesSeemEqual');
$message = PMA_Message::warning(__('The indexes %1$s and %2$s seem to be equal and one of them could possibly be removed.'));
$message->addParam($each_index->getName());
$message->addParam($while_index->getName());
$output .= $message->getDisplay();
Expand Down
2 changes: 1 addition & 1 deletion libraries/auth/http.auth.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function PMA_auth()
<br />

<?php
PMA_Message::error('strWrongUser')->display();
PMA_Message::error(__('Wrong username/password. Access denied.'))->display();

if (file_exists(CUSTOM_FOOTER_FILE)) {
require CUSTOM_FOOTER_FILE;
Expand Down
4 changes: 2 additions & 2 deletions libraries/dbg/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* Loads the DBG extension if needed
*/
if (! @extension_loaded('dbg') ) {
$message = PMA_Message::error('strCantLoad');
$message = PMA_Message::error(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'));
$message->addParam('DBG');
$message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false);
$message->addString('strDocu');
$message->addString(__('Documentation'));
$message->addMessage('</a>', false);
$message->display();
} else {
Expand Down
10 changes: 5 additions & 5 deletions libraries/display_export.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function PMA_exportIsActive($what, $val) {

/* Fail if we didn't find any plugin */
if (empty($export_list)) {
PMA_Message::error('strCanNotLoadExportPlugins')->display();
PMA_Message::error( __('Could not load export plugins, please check your installation!'))->display();
require './libraries/footer.inc.php';
}
?>
Expand Down Expand Up @@ -149,17 +149,17 @@ function PMA_exportIsActive($what, $val) {

$trans = new PMA_Message;
$trans->addMessage('__SERVER__/');
$trans->addString('strFileNameTemplateDescriptionServer');
$trans->addString(__('server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/');
$trans->addString('strFileNameTemplateDescriptionDatabase');
$trans->addString(__('database name'));
if ($export_type == 'table') {
$trans->addMessage('__TABLE__/');
$trans->addString('strFileNameTemplateDescriptionTable');
$trans->addString(__('table name'));
}
}

$message = new PMA_Message('strFileNameTemplateDescription');
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.'));
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="'
. __('Documentation') . '">', false);
$message->addParam('</a>', false);
Expand Down
6 changes: 3 additions & 3 deletions libraries/display_import.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/* Fail if we didn't find any plugin */
if (empty($import_list)) {
PMA_Message::error('strCanNotLoadImportPlugins')->display();
PMA_Message::error(__('Could not load import plugins, please check your installation!'))->display();
require './libraries/footer.inc.php';
}
?>
Expand Down Expand Up @@ -145,7 +145,7 @@ function(response) {
</div>
<?php
} else {
PMA_Message::warning('strUploadsNotAllowed')->display();
PMA_Message::warning(__('File uploads are not allowed on this server.'))->display();
}
if (!empty($cfg['UploadDir'])) {
$extensions = '';
Expand All @@ -160,7 +160,7 @@ function(response) {
$files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : '');
echo '<div class="formelementrow">' . "\n";
if ($files === FALSE) {
PMA_Message::error('strWebServerUploadDirectoryError')->display();
PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display();
} elseif (!empty($files)) {
echo "\n";
echo ' <i>' . __('Or') . '</i><br/><label for="select_local_import_file">' . __('web server upload directory') . '</label>&nbsp;: ' . "\n";
Expand Down
8 changes: 4 additions & 4 deletions libraries/display_tbl.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1936,15 +1936,15 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)

if (PMA_Table::isView($db, $table)
&& $total == $GLOBALS['cfg']['MaxExactCountViews']) {
$message = PMA_Message::notice('strViewHasAtLeast');
$message = PMA_Message::notice(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'));
$message->addParam('[a@./Documentation.html#cfg_MaxExactCount@_blank]');
$message->addParam('[/a]');
$message_view_warning = PMA_showHint($message);
} else {
$message_view_warning = false;
}

$message = PMA_Message::success('strShowingRecords');
$message = PMA_Message::success(__('Showing rows'));
$message->addMessage($_SESSION['tmp_user_values']['pos']);
if ($message_view_warning) {
$message->addMessage('...', ' - ');
Expand All @@ -1954,15 +1954,15 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
$message->addMessage($last_shown_rec, ' - ');
$message->addMessage(' (');
$message->addMessage($pre_count . PMA_formatNumber($total, 0));
$message->addString('strTotal');
$message->addString(__('total'));
if (!empty($after_count)) {
$message->addMessage($after_count);
}
$message->addMessage($selectstring, '');
$message->addMessage(', ', '');
}

$messagge_qt = PMA_Message::notice('strQueryTime');
$messagge_qt = PMA_Message::notice(__('Query took %01.4f sec'));
$messagge_qt->addParam($GLOBALS['querytime']);

$message->addMessage($messagge_qt, '');
Expand Down
2 changes: 1 addition & 1 deletion libraries/header.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
// note: here, the decoration won't work because without cookies,
// our standard CSS is not operational
if (empty($_COOKIE)) {
PMA_Message::notice('strCookiesRequired')->display();
PMA_Message::notice(__('Cookies must be enabled past this point.'))->display();
}

if (!defined('PMA_DISPLAY_HEADING')) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/import.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function PMA_importRunQuery($sql = '', $full = '', $controluser = false)
if (!$cfg['AllowUserDropDatabase']
&& !$is_superuser
&& preg_match('@^[[:space:]]*DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE @i', $import_run_buffer['sql'])) {
$GLOBALS['message'] = PMA_Message::error('strNoDropDatabases');
$GLOBALS['message'] = PMA_Message::error(__('"DROP DATABASE" statements are disabled.'));
$error = TRUE;
} else {
$executed_queries++;
Expand Down
2 changes: 1 addition & 1 deletion libraries/mult_submits.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,6 @@
$GLOBALS['pma']->databases->build();
}
} else {
$message = PMA_Message::success('strNoModification');
$message = PMA_Message::success(__('No change'));
}
?>
2 changes: 1 addition & 1 deletion libraries/replication_gui.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function PMA_replication_print_slaves_table($hidden = false) {
echo ' </tbody>';
echo ' </table>';
echo ' <br />';
PMA_Message::notice('strReplicationShowConnectedSlavesNote')->display();
PMA_Message::notice(__('Only slaves started with the --report-host=host_name option are visible in this list.'))->display();
echo ' <br />';
echo ' </div>';
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/sql_query_form.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function PMA_sqlQueryFormUpload(){
echo '</div>';

if ($files === FALSE) {
$errors[] = PMA_Message::error('strWebServerUploadDirectoryError');
$errors[] = PMA_Message::error( __('The directory you set for upload work cannot be reached'));
} elseif (!empty($files)) {
echo '<div class="formelement">';
echo '<strong>' . __('web server upload directory') .':</strong>' . "\n";
Expand Down
Loading

0 comments on commit 632211d

Please sign in to comment.