Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
#20 Fixed multi-language support
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-koch committed Jul 13, 2014
1 parent 136d991 commit dc57fce
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 36 deletions.
65 changes: 30 additions & 35 deletions inc/common.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,54 +903,49 @@ function hesk_msgToPlain($msg, $specialchars=0, $strip=1)

function hesk_showTopBar($page_title)
{
global $hesk_settings, $hesklang;
echo $page_title;
} // END hesk_showTopBar()

if ($hesk_settings['can_sel_lang'])
{
function hesk_getLanguagesAsFormIfNecessary()
{

global $hesk_settings, $hesklang;

if ($hesk_settings['can_sel_lang'])
{

$str = '<form method="get" action="" style="margin:0;padding:0;border:0;white-space:nowrap;">';
$str = '<form method="get" action="" role="form" style="margin:0;padding:0;border:0;white-space:nowrap;">';

if ( ! isset($_GET) )
{
$_GET = array();
$_GET = array();
}

foreach ($_GET as $k => $v)
{
if ($k == 'language')
{
continue;
}
$str .= '<input type="hidden" name="'.hesk_htmlentities($k).'" value="'.hesk_htmlentities($v).'" />';
}
foreach ($_GET as $k => $v)
{
if ($k == 'language')
{
continue;
}
$str .= '<input type="hidden" name="'.hesk_htmlentities($k).'" value="'.hesk_htmlentities($v).'" />';
}

$str .= '<select name="language" onchange="this.form.submit()">';
$str .= hesk_listLanguages(0);
$str .= '</select>';
$str .= '<select name="language" class="form-control" onchange="this.form.submit()">';
$str .= hesk_listLanguages(0);
$str .= '</select><br/>';

?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="headersm" style="padding-left: 0px;"><?php echo $page_title; ?></td>
<td class="headersm" style="padding-left: 0px;text-align: right">
?>
<script language="javascript" type="text/javascript">
document.write('<?php echo str_replace(array('"','<','=','>'),array('\42','\74','\75','\76'),$str . '</form>'); ?>');
document.write('<?php echo str_replace(array('"','<','=','>'),array('\42','\74','\75','\76'),$str . '</form>'); ?>');
</script>
<noscript>
<?php
echo $str . '<input type="submit" value="'.$hesklang['go'].'" /></form>';
?>
<?php
echo $str . '<input type="submit" value="'.$hesklang['go'].'" /></form>';
?>
</noscript>
</td>
</tr>
</table>
<?php
}
else
{
echo $page_title;
}
} // END hesk_showTopBar()
<?php
}
}


function hesk_listLanguages($doecho = 1) {
Expand Down
8 changes: 8 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ function print_add_ticket()
</ul>
<div class="summaryList">
<div class="viewTicketSidebar">
<div class="row">
<div class="col-md-6 col-xs-12">
<label class="control-label" style="margin-top:8px;"><?php echo $hesklang['changeLanguage']; ?></label>
</div>
<div class="col-md-6 col-xs-12">
<?php echo hesk_getLanguagesAsFormIfNecessary(); ?>
</div>
</div>
<p><?php echo $hesklang['quick_help_submit_ticket']; ?></p>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions language/en/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
// This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------';

// ADDED OR MODIFIED IN NuMods 1.2.2
$hesklang['changeLanguage'] = 'Change language to';

// ADDED OR MODIFIED IN NuMods 1.2
$hesklang['statuses'] = 'Statuses';
$hesklang['basicProperties'] = 'Basic Properties';
Expand Down
2 changes: 1 addition & 1 deletion nuMods_settings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
$nuMods_settings['questionMarkColor'] = '#000000';

/* DO NOT EDIT ANYTHING BELOW THIS LINE */
$nuMods_settings['version']='1.2.1';
$nuMods_settings['version']='1.2.2';

?>
8 changes: 8 additions & 0 deletions ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@
</ul>
<div class="summaryList">
<div class="viewTicketSidebar">
<div class="row">
<div class="col-md-6 col-xs-12">
<label class="control-label" style="margin-top:8px;"><?php echo $hesklang['changeLanguage']; ?></label>
</div>
<div class="col-md-6 col-xs-12">
<?php echo hesk_getLanguagesAsFormIfNecessary(); ?>
</div>
</div>
<p><?php echo $hesklang['quick_help_ticket']; ?></p>
</div>
</div>
Expand Down

0 comments on commit dc57fce

Please sign in to comment.