Skip to content
Snippets Groups Projects
Commit 39c2abaf authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Translate the installer

parent c6dde547
Branches
Tags
No related merge requests found
...@@ -23,10 +23,7 @@ class HelpTipAjaxAPI extends AjaxController { ...@@ -23,10 +23,7 @@ class HelpTipAjaxAPI extends AjaxController {
function getTipsJson($namespace, $lang=false) { function getTipsJson($namespace, $lang=false) {
global $ost, $thisstaff; global $ost, $thisstaff;
if (!$lang) $lang = Internationalization::getCurrentLanguage();
$lang = ($thisstaff)
? $thisstaff->getLanguage()
: Internationalization::getDefaultLanguage();
$i18n = new Internationalization($lang); $i18n = new Internationalization($lang);
$tips = $i18n->getTemplate("help/tips/$namespace.yaml"); $tips = $i18n->getTemplate("help/tips/$namespace.yaml");
......
@import url("../../css/font-awesome.min.css"); @import url("../../css/font-awesome.min.css");
body { background: url('../images/background.jpg?1312906017') top left repeat-x white; font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000; margin: 0; padding: 0; } body { background: url('../images/background.jpg?1312906017') top left repeat-x white; font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000; margin: 0; padding: 0; line-height: 1.3em; }
#wizard { background: #fff; width: 800px; margin: 30px auto; padding: 10px; border: 1px solid #2a67ac; border-right: 2px solid #2a67ac; border-bottom: 3px solid #2a67ac; overflow: hidden; margin-bottom:5px;} #wizard { background: #fff; width: 800px; margin: 30px auto; padding: 10px; border: 1px solid #2a67ac; border-right: 2px solid #2a67ac; border-bottom: 3px solid #2a67ac; overflow: hidden; margin-bottom:5px;}
...@@ -11,16 +11,16 @@ a { color: #2a67ac; } ...@@ -11,16 +11,16 @@ a { color: #2a67ac; }
.hidden { display: none;} .hidden { display: none;}
.error { color:#f00;} .error { color:#f00;}
#header { height: 72px; margin-bottom: 20px; } #header { height: 72px; margin-bottom: 20px; width: 100%; }
#header #logo { width: 280px; height: 72px; display: block; float: left; } #header #logo { width: 280px; height: 72px; display: block; float: left; }
#header ul { margin: 0; padding: 0; width: 400px; float: right; text-align: right; } #header .info { font-size: 11pt; font-weight: bold; border-bottom: 1px solid #2a67ac; color: #444; text-align: right; float: right; }
#header ul .info { font-size: 11pt; font-weight: bold; border-bottom: 1px solid #2a67ac; color: #444; } #header ul { margin: 0; padding: 0; text-align: right; }
#header ul li { list-style: none; margin: 5px 0 0 0; padding: 0; } #header ul li { list-style: none; margin: 5px 0 0 0; padding: 0; }
#header ul li a { color: #F3811C; text-decoration: none; } #header ul li a { color: #F3811C; text-decoration: none; }
#header ul li a:hover { color: #2a67ac; } #header ul li a:hover { color: #2a67ac; }
#sidebar { width: 180px; padding: 10px; border: 1px solid #C8DDFA; float: right; background: #F7FBFE; } #sidebar { width: 180px; padding: 10px; border: 1px solid #C8DDFA; float: right; background: #F7FBFE; }
#sidebar h3 { font-size: 10pt; margin: 0 0 5px 0; padding: 0; text-indent: 32px; background: url('../images/cog.png?1312913866') top left no-repeat; line-height: 24px; color: #2a67ac; } #sidebar h3 { font-size: 10pt; margin: 0 0 5px 0; padding: 0; padding-left: 32px; background: url('../images/cog.png?1312913866') top left no-repeat; line-height: 1.2em; color: #2a67ac; min-height: 24px; }
#footer { color:#ccc; } #footer { color:#ccc; }
#footer a, #footer a:hover { text-decoration:none; color:#ccc; } #footer a, #footer a:hover { text-decoration:none; color:#ccc; }
...@@ -42,6 +42,10 @@ ul.progress li.no { background-image: url('../images/no.png?1312906277'); } ...@@ -42,6 +42,10 @@ ul.progress li.no { background-image: url('../images/no.png?1312906277'); }
ul.progress li.yes small {color:green; } ul.progress li.yes small {color:green; }
ul.progress li.no small {color:red;} ul.progress li.no small {color:red;}
#intro ul li + li {
margin-top: 8px;
}
#bar { clear: both; padding-top: 10px; height: 24px; line-height: 24px; text-align: center; border-top: 1px solid #aaaaaa; } #bar { clear: both; padding-top: 10px; height: 24px; line-height: 24px; text-align: center; border-top: 1px solid #aaaaaa; }
#bar a, #bar .btn { display: inline-block; margin: 0; height: 24px; line-height: 24px; font-weight: bold; border: 1px solid #666666; text-decoration: none; padding: 0 10px; background: url('../images/grey_btn_bg.png?1312910883') top left repeat-x; color: #333; } #bar a, #bar .btn { display: inline-block; margin: 0; height: 24px; line-height: 24px; font-weight: bold; border: 1px solid #666666; text-decoration: none; padding: 0 10px; background: url('../images/grey_btn_bg.png?1312910883') top left repeat-x; color: #333; }
#bar a:hover, #bar .btn:hover, #bar .btnover { background-position: bottom left; } #bar a:hover, #bar .btn:hover, #bar .btnover { background-position: bottom left; }
...@@ -56,9 +60,9 @@ form h4.system { background-image: url('../images/system.png?1262713696'); } ...@@ -56,9 +60,9 @@ form h4.system { background-image: url('../images/system.png?1262713696'); }
form h4.admin { background-image: url('../images/user.png?1262713720'); } form h4.admin { background-image: url('../images/user.png?1262713720'); }
form h4.database { background-image: url('../images/database.png?1262713698'); } form h4.database { background-image: url('../images/database.png?1262713698'); }
form h4.email { background-image: url('../images/email.png?1142218352'); } form h4.email { background-image: url('../images/email.png?1142218352'); }
form .row { clear: both; padding: 2px 0 0 24px; background: #F7FBFE; height: 24px; } form .row { clear: both; padding: 2px 0 0 24px; background: #F7FBFE; }
form .row input { background: #fff; height: 22px; padding: 0; line-height: 22px; border: 1px solid #cccccc; } form .row input { background: #fff; height: 22px; padding: 0 5px; line-height: 22px; border: 1px solid #cccccc; }
form .row label, form .row span { display: block; float: left; width: 150px; line-height: 24px; } form .row label, form .row span { display: block; line-height: 24px; padding: 0 5px; }
form .row span { width: 600px; color: #666666; } form .row span { width: 600px; color: #666666; }
.tip_box { .tip_box {
...@@ -109,7 +113,7 @@ form .row span { width: 600px; color: #666666; } ...@@ -109,7 +113,7 @@ form .row span { width: 600px; color: #666666; }
position:absolute; position:absolute;
top:0; top:0;
left:-1px; left:-1px;
min-width:300px; min-width:400px;
line-height: 1.15rem; line-height: 1.15rem;
} }
...@@ -178,6 +182,23 @@ i.help-tip:hover { ...@@ -178,6 +182,23 @@ i.help-tip:hover {
#loading { padding: 10px 10px 10px 60px; width: 400px; height: 150px; background: url('../images/ajax-loader.gif?1312925608') 10px 50% no-repeat white; position: fixed; display: none; z-index: 3000; } #loading { padding: 10px 10px 10px 60px; width: 400px; height: 150px; background: url('../images/ajax-loader.gif?1312925608') 10px 50% no-repeat white; position: fixed; display: none; z-index: 3000; }
#loading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; } #loading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; }
.tip { display: inline-block; width: 16px; height: 16px; outline: none; text-decoration: none; color: #d80; } div.flags { text-align: right; margin-top: 5px; }
a.flag { text-decoration: none; }
.tip { display: inline-block; width: 16px; height: 16px; outline: none; text-decoration: none; color: #d80; margin-left: 5px; }
.rtl .tip { margin-right: 5px;}
#links { margin: 10px 0; } #links { margin: 10px 0; }
.rtl ul.progress li.yes, .rtl ul.progress li.no { background-position: 100%; }
.rtl ul.progress li { padding-left: 0; padding-right: 24px; }
.rtl form h4.head { padding-right: 24px; background-position: right center; background-position: calc(100% - 5px); }
.rtl form .subhead { padding-right: 24px; }
.rtl #header #logo { float: right; }
.rtl #header .info, .rtl #header ul, .rtl div.flags { text-align:left; }
.rtl #header .info { float: left; }
.rtl .ltr { text-align: right; }
.ltr {
direction: ltr;
unicode-bidi: embed;
}
...@@ -7,15 +7,15 @@ if(!defined('SETUPINC')) die('Kwaheri!'); ...@@ -7,15 +7,15 @@ if(!defined('SETUPINC')) die('Kwaheri!');
<p> <?php <p> <?php
echo sprintf( echo sprintf(
__('osTicket installer requires ability to write to the configuration file %s'), __('osTicket installer requires ability to write to the configuration file %s'),
'<b>include/ost-config.php</b>');?> '<b style="white-space:nowrap">include/ost-config.php</b>');?>
</p> </p>
</div> </div>
<h3><?php echo __('Solution');?>: <font color="red"><?php echo $errors['err']; ?></font></h3> <h3><?php echo __('Solution');?>: <font color="red"><?php echo $errors['err']; ?></font></h3>
<?php echo __('Please follow the instructions below to give read and write access to the web server user.');?> <?php echo __('Please follow the instructions below to give read and write access to the web server user.');?>
<ul> <ul>
<li><b><?php echo __('CLI');?></b>:<br><i>chmod 0666 include/ost-config.php</i></li> <li><b><?php echo __('CLI');?></b>:<br><i class="ltr">chmod 0666 include/ost-config.php</i></li>
<li><b><?php echo __('Windows PowerShell');?></b>:<br><?php echo __('Add "Full Access" permission for the "Everyone" user'); ?><br> <li><b><?php echo __('Windows PowerShell');?></b>:<br><?php echo __('Add "Full Access" permission for the "Everyone" user'); ?><br>
<i>icacls include\ost-config.php /grant 'Everyone:F'</i></li> <i class="ltr">icacls include\ost-config.php /grant 'Everyone:F'</i></li>
<li><b><?php echo __('FTP');?></b>:<br><?php echo __('Using WS_FTP this would be right hand clicking on the file, selecting chmod, and then giving all permissions to the file.');?></li> <li><b><?php echo __('FTP');?></b>:<br><?php echo __('Using WS_FTP this would be right hand clicking on the file, selecting chmod, and then giving all permissions to the file.');?></li>
<li><b><?php echo __('Cpanel');?></b>:<br><?php echo __('Click on the file, select change permission, and then giving all permissions to the file.');?></li> <li><b><?php echo __('Cpanel');?></b>:<br><?php echo __('Click on the file, select change permission, and then giving all permissions to the file.');?></li>
</ul> </ul>
...@@ -24,7 +24,7 @@ if(!defined('SETUPINC')) die('Kwaheri!'); ...@@ -24,7 +24,7 @@ if(!defined('SETUPINC')) die('Kwaheri!');
<div id="bar"> <div id="bar">
<form method="post" action="install.php"> <form method="post" action="install.php">
<input type="hidden" name="s" value="config"> <input type="hidden" name="s" value="config">
<input class="btn" type="submit" name="submit" value="<?php echo __('Done? Continue');?> &raquo;"> <button class="btn" type="submit" name="submit"><?php echo __('Done? Continue');?> &raquo;</button>
</form> </form>
</div> </div>
</div> </div>
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html <?php
if (($lang = Internationalization::getCurrentLanguage())
&& ($info = Internationalization::getLanguageInfo($lang))
&& (@$info['direction'] == 'rtl'))
echo 'dir="rtl" class="rtl"';
?>>
<head> <head>
<title><?php echo $wizard['title']; ?></title> <title><?php echo $wizard['title']; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/wizard.css"> <link rel="stylesheet" href="css/wizard.css">
<link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/flags.css">
<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/tips.js"></script> <script type="text/javascript" src="js/tips.js"></script>
<script type="text/javascript" src="js/setup.js"></script> <script type="text/javascript" src="js/setup.js"></script>
...@@ -13,8 +19,9 @@ ...@@ -13,8 +19,9 @@
<div id="wizard"> <div id="wizard">
<div id="header"> <div id="header">
<img id="logo" src="./images/<?php echo $wizard['logo']?$wizard['logo']:'logo.png'; ?>" width="280" height="72" alt="osTicket"> <img id="logo" src="./images/<?php echo $wizard['logo']?$wizard['logo']:'logo.png'; ?>" width="280" height="72" alt="osTicket">
<ul> <div class="info"><?php echo $wizard['tagline']; ?></div>
<li class="info"><?php echo $wizard['tagline']; ?></li> <br/>
<ul class="links">
<li> <li>
<?php <?php
foreach($wizard['menu'] as $k=>$v) foreach($wizard['menu'] as $k=>$v)
...@@ -23,5 +30,20 @@ ...@@ -23,5 +30,20 @@
<a target="_blank" href="http://osticket.com/contact-us"><?php echo __('Contact Us');?></a> <a target="_blank" href="http://osticket.com/contact-us"><?php echo __('Contact Us');?></a>
</li> </li>
</ul> </ul>
<div class="flags">
<?php
if (($all_langs = Internationalization::availableLanguages())
&& (count($all_langs) > 1)
) {
foreach ($all_langs as $code=>$info) {
list($lang, $locale) = explode('_', $code);
?>
<a class="flag flag-<?php echo strtolower($locale ?: $info['flag'] ?: $lang); ?>"
href="?<?php echo urlencode($_GET['QUERY_STRING']); ?>&amp;lang=<?php echo $code;
?>" title="<?php echo Internationalization::getLanguageDescription($code); ?>">&nbsp;</a>
<?php }
} ?>
</div>
</div> </div>
<div class="clear"></div>
<div id="content"> <div id="content">
...@@ -15,10 +15,10 @@ if(!defined('SETUPINC')) die('Kwaheri!'); ...@@ -15,10 +15,10 @@ if(!defined('SETUPINC')) die('Kwaheri!');
<?php echo __('These items are necessary in order to install and use osTicket.');?> <?php echo __('These items are necessary in order to install and use osTicket.');?>
<ul class="progress"> <ul class="progress">
<li class="<?php echo $installer->check_php()?'yes':'no'; ?>"> <li class="<?php echo $installer->check_php()?'yes':'no'; ?>">
<?php echo sprintf(__('%s or greater'), 'PHP v5.3');?> &mdash; (<small><b><?php echo PHP_VERSION; ?></b></small>)</li> <?php echo sprintf(__('%s or greater'), '<span class="ltr">PHP v5.3</span>');?> &mdash; <small class="ltr">(<b><?php echo PHP_VERSION; ?></b>)</small></li>
<li class="<?php echo $installer->check_mysql()?'yes':'no'; ?>"> <li class="<?php echo $installer->check_mysql()?'yes':'no'; ?>">
<?php echo __('MySQLi extension for PHP');?> &mdash; (<small><b><?php <?php echo __('MySQLi extension for PHP');?> &mdash; <small><b><?php
echo extension_loaded('mysqli')?__('module loaded'):__('missing!'); ?></b></small>)</li> echo extension_loaded('mysqli')?__('module loaded'):__('missing!'); ?></b></small></li>
</ul> </ul>
<h3><?php echo __('Recommended');?>:</h3> <h3><?php echo __('Recommended');?>:</h3>
<?php echo __('You can use osTicket without these, but you may not be able to use all features.');?> <?php echo __('You can use osTicket without these, but you may not be able to use all features.');?>
......
...@@ -12,7 +12,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbho ...@@ -12,7 +12,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbho
<span class="subhead"><?php echo __('The URL of your helpdesk, its name, and the default system email address');?></span> <span class="subhead"><?php echo __('The URL of your helpdesk, its name, and the default system email address');?></span>
<div class="row"> <div class="row">
<label><?php echo __('Helpdesk URL');?>:</label> <label><?php echo __('Helpdesk URL');?>:</label>
<span><strong><?php echo URL; ?></strong></span> <span class="ltr"><strong><?php echo URL; ?></strong></span>
</div> </div>
<div class="row"> <div class="row">
<label><?php echo __('Helpdesk Name');?>:</label> <label><?php echo __('Helpdesk Name');?>:</label>
...@@ -33,7 +33,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbho ...@@ -33,7 +33,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):array('prefix'=>'ost_','dbho
<?php foreach($langs as $l) { <?php foreach($langs as $l) {
$selected = ($info['lang_id'] == $l['code']) ? 'selected="selected"' : ''; ?> $selected = ($info['lang_id'] == $l['code']) ? 'selected="selected"' : ''; ?>
<option value="<?php echo $l['code']; ?>" <?php echo $selected; <option value="<?php echo $l['code']; ?>" <?php echo $selected;
?>><?php echo $l['desc']; ?></option> ?>><?php echo Internationalization::getLanguageDescription($l['code']); ?></option>
<?php } ?> <?php } ?>
</select> </select>
<a class="tip" href="#default_lang"><i class="icon-question-sign help-tip"></i></a> <a class="tip" href="#default_lang"><i class="icon-question-sign help-tip"></i></a>
......
...@@ -40,9 +40,11 @@ jQuery(function($) { ...@@ -40,9 +40,11 @@ jQuery(function($) {
"left":x_pos + "px" "left":x_pos + "px"
}), }),
tip_timer = setTimeout(function() { tip_timer = setTimeout(function() {
var rtl = $('html.rtl').length > 0;
$('.tip_box').remove(); $('.tip_box').remove();
$('body').append(the_tip.hide().fadeIn()); $('body').append(the_tip.hide().fadeIn());
if ($(window).width() < tip_content.outerWidth() + the_tip.position().left) { if ((rtl && ($(window).width() > tip_content.outerWidth() + the_tip.position().left))
|| (!rtl && ($(window).width() < tip_content.outerWidth() + the_tip.position().left))) {
the_tip.css({'left':x_pos-tip_content.outerWidth()-40+'px'}); the_tip.css({'left':x_pos-tip_content.outerWidth()-40+'px'});
tip_box.addClass('right'); tip_box.addClass('right');
tip_arrow.addClass('flip-x'); tip_arrow.addClass('flip-x');
......
...@@ -63,4 +63,13 @@ require_once INCLUDE_DIR.'class.i18n.php'; ...@@ -63,4 +63,13 @@ require_once INCLUDE_DIR.'class.i18n.php';
Internationalization::bootstrap(); Internationalization::bootstrap();
// Set browser-preferred language (if installed)
require_once INCLUDE_DIR.'class.translation.php';
// Support flags in the setup portal too
if (isset($_GET['lang']) && $_GET['lang']) {
$_SESSION['client:lang'] = $_GET['lang'];
}
TextDomain::configureForUser();
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment