Setup script: move language strings to global variables, prefix them with "$strSetup"

This commit is contained in:
Piotr Przybylski
2008-10-14 10:31:07 +00:00
parent f1d78aa718
commit cd9da66ffb
11 changed files with 410 additions and 403 deletions

View File

@@ -20,7 +20,7 @@ $config_writable = false;
$config_exists = false;
check_config_rw($config_readable, $config_writable, $config_exists);
?>
<h2><?php echo $GLOBALS['str']['ConfigurationFile'] ?></h2>
<h2><?php echo $GLOBALS['strSetupConfigurationFile'] ?></h2>
<?php display_form_top('config.php?type=post'); ?>
<input type="hidden" name="eol" value="<?php echo htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) ?>" />
<?php display_fieldset_top('', '', null, array('class' => 'simple')); ?>
@@ -33,7 +33,7 @@ check_config_rw($config_readable, $config_writable, $config_exists);
</tr>
<tr>
<td class="lastrow" style="text-align: left">
<input type="submit" name="submit_download" value="<?php echo $GLOBALS['str']['Download'] ?>" class="green" />
<input type="submit" name="submit_download" value="<?php echo $GLOBALS['strSetupDownload'] ?>" class="green" />
<input type="submit" name="submit_save" value="<?php echo $GLOBALS['strSave'] ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
&nbsp; &nbsp;
<input type="reset" value="<?php echo $GLOBALS['strReset'] ?>" />

View File

@@ -36,8 +36,8 @@ if (!isset($formsets[$formset_id])) {
}
$formset = $formsets[$formset_id];
if (isset($GLOBALS['str']['Formset_' . $formset_id])) {
echo '<h2>' . $GLOBALS['str']['Formset_' . $formset_id] . '</h2>';
if (isset($GLOBALS['strSetupFormset_' . $formset_id])) {
echo '<h2>' . $GLOBALS['strSetupFormset_' . $formset_id] . '</h2>';
}
$form_display = new FormDisplay();
foreach ($formset['forms'] as $form_name) {

View File

@@ -53,7 +53,7 @@ if (!$config_writable || !$config_readable) {
//
$is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
if (!$is_https) {
$text = $GLOBALS['str']['InsecureConnectionMsg1'];
$text = $GLOBALS['strSetupInsecureConnectionMsg1'];
if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
$text .= ' ' . PMA_lang('InsecureConnectionMsg2',
'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
@@ -91,7 +91,7 @@ if (!$is_https) {
</select>
</form>
<h2><?php echo $GLOBALS['str']['Overview'] ?></h2>
<h2><?php echo $GLOBALS['strSetupOverview'] ?></h2>
<?php
// message handling
@@ -99,7 +99,7 @@ messages_end();
messages_show_html();
?>
<a href="#" id="show_hidden_messages" style="display:none"><?php echo $str['ShowHiddenMessages'] ?></a>
<a href="#" id="show_hidden_messages" style="display:none"><?php echo $GLOBALS['strSetupShowHiddenMessages'] ?></a>
<h3><?php echo $GLOBALS['strServers'] ?></h3>
<?php
@@ -139,7 +139,7 @@ display_form_top('index.php', 'get', array(
<table width="100%">
<tr>
<td>
<i><?php echo $GLOBALS['str']['NoServers'] ?></i>
<i><?php echo $GLOBALS['strSetupNoServers'] ?></i>
</td>
</tr>
</table>
@@ -147,7 +147,7 @@ display_form_top('index.php', 'get', array(
<table width="100%">
<tr>
<td class="lastrow" style="text-align: left">
<input type="submit" name="submit" value="<?php echo $GLOBALS['str']['NewServer'] ?>" />
<input type="submit" name="submit" value="<?php echo $GLOBALS['strSetupNewServer'] ?>" />
</td>
</tr>
</table>
@@ -156,7 +156,7 @@ display_form_top('index.php', 'get', array(
display_form_bottom();
?>
<h3><?php echo $GLOBALS['str']['ConfigurationFile'] ?></h3>
<h3><?php echo $GLOBALS['strSetupConfigurationFile'] ?></h3>
<?php
//
// Display config file settings and load/save form
@@ -183,7 +183,7 @@ foreach ($all_languages as $each_lang_key => $each_lang) {
}
$opts['values'][$each_lang_key] = $lang_name;
}
display_input('DefaultLang', $GLOBALS['str']['DefaultLanguage'], '', 'select',
display_input('DefaultLang', $GLOBALS['strSetupDefaultLanguage'], '', 'select',
$cf->getValue('DefaultLang'), true, $opts);
// Display server list
@@ -193,7 +193,7 @@ $opts = array(
'values' => array(),
'values_disabled' => array());
if ($cf->getServerCount() > 0) {
$opts['values']['0'] = $GLOBALS['str']['LetUserChoose'];
$opts['values']['0'] = $GLOBALS['strSetupLetUserChoose'];
$opts['values']['-'] = '------------------------------';
if ($cf->getServerCount() == 1) {
$opts['values_disabled'][] = '0';
@@ -204,10 +204,10 @@ if ($cf->getServerCount() > 0) {
$opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]";
}
} else {
$opts['values']['1'] = $GLOBALS['str']['-none-'];
$opts['values']['1'] = $GLOBALS['strSetupOptionNone'];
$opts['values_escaped'] = true;
}
display_input('ServerDefault', $GLOBALS['str']['DefaultServer'], '', 'select',
display_input('ServerDefault', $GLOBALS['strSetupDefaultServer'], '', 'select',
$cf->getValue('ServerDefault'), true, $opts);
// Display EOL list
@@ -217,19 +217,19 @@ $opts = array(
'win' => 'Windows (\r\n)'),
'values_escaped' => true);
$eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix'));
display_input('eol', $GLOBALS['str']['EndOfLine'], '', 'select',
display_input('eol', $GLOBALS['strSetupEndOfLine'], '', 'select',
$eol, true, $opts);
?>
<tr>
<td colspan="2" class="lastrow" style="text-align: left">
<input type="submit" name="submit_display" value="<?php echo $GLOBALS['str']['Display'] ?>" />
<input type="submit" name="submit_download" value="<?php echo $GLOBALS['str']['Download'] ?>" />
<input type="submit" name="submit_display" value="<?php echo $GLOBALS['strSetupDisplay'] ?>" />
<input type="submit" name="submit_download" value="<?php echo $GLOBALS['strSetupDownload'] ?>" />
&nbsp; &nbsp;
<input type="submit" name="submit_save" value="<?php echo $GLOBALS['strSave'] ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
<input type="submit" name="submit_load" value="<?php echo $GLOBALS['str']['Load'] ?>"<?php if (!$config_exists) echo ' disabled="disabled"' ?> />
<input type="submit" name="submit_load" value="<?php echo $GLOBALS['strSetupLoad'] ?>"<?php if (!$config_exists) echo ' disabled="disabled"' ?> />
<input type="submit" name="submit_delete" value="<?php echo $GLOBALS['strDelete'] ?>"<?php if (!$config_exists || !$config_writable) echo ' disabled="disabled"' ?> />
&nbsp; &nbsp;
<input type="submit" name="submit_clear" value="<?php echo $GLOBALS['str']['Clear'] ?>" class="red" />
<input type="submit" name="submit_clear" value="<?php echo $GLOBALS['strSetupClear'] ?>" class="red" />
</td>
</tr>
<?php
@@ -237,7 +237,7 @@ display_fieldset_bottom_simple();
display_form_bottom();
?>
<div id="footer">
<a href="http://phpmyadmin.net"><?php echo $GLOBALS['str']['HomepageLink'] ?></a>
<a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo $GLOBALS['str']['DonateLink'] ?></a>
<a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo $GLOBALS['str']['VersionCheckLink'] ?></a>
<a href="http://phpmyadmin.net"><?php echo $GLOBALS['strSetupHomepageLink'] ?></a>
<a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo $GLOBALS['strSetupDonateLink'] ?></a>
<a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo $GLOBALS['strSetupVersionCheckLink'] ?></a>
</div>

View File

@@ -15,10 +15,10 @@ if (!defined('PHPMYADMIN')) {
$separator = PMA_get_arg_separator('html');
?>
<ul>
<li><a href="index.php"><?php echo $GLOBALS['str']['Overview'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=features"><?php echo $GLOBALS['str']['Formset_features'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=left_frame"><?php echo $GLOBALS['str']['Form_Left_frame'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=main_frame"><?php echo $GLOBALS['str']['Form_Main_frame'] ?></a></li>
<li><a href="index.php"><?php echo $GLOBALS['strSetupOverview'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=features"><?php echo $GLOBALS['strSetupFormset_features'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=left_frame"><?php echo $GLOBALS['strSetupForm_Left_frame'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=main_frame"><?php echo $GLOBALS['strSetupForm_Main_frame'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=import"><?php echo $GLOBALS['strImport'] ?></a></li>
<li><a href="?page=form<?php echo $separator ?>formset=export"><?php echo $GLOBALS['strExport'] ?></a></li>
</ul>

View File

@@ -23,7 +23,7 @@ $cf = ConfigFile::getInstance();
$server_exists = !empty($id) && $cf->get("Servers/$id") !== null;
if ($mode == 'edit' && $server_exists) {
$page_title = $GLOBALS['str']['ServersEdit']
$page_title = $GLOBALS['strSetupServersEdit']
. ' ' . $id . ' <small>(' . $cf->getServerDSN($id) . ')</small>';
} elseif ($mode == 'remove' && $server_exists) {
$cf->removeServer($id);
@@ -32,7 +32,7 @@ if ($mode == 'edit' && $server_exists) {
} elseif ($mode == 'revert' && $server_exists) {
// handled by process_formset()
} else {
$page_title = $GLOBALS['str']['ServersAdd'];
$page_title = $GLOBALS['strSetupServersAdd'];
$id = 0;
}
?>