Browse Source

#20 Fixed multi-language support

merge-requests/2/head v1.2.2
Mike Koch 8 years ago
parent
commit
dc57fceab3
  1. 65
      inc/common.inc.php
  2. 8
      index.php
  3. 3
      language/en/text.php
  4. 2
      nuMods_settings.inc.php
  5. 8
      ticket.php

65
inc/common.inc.php

@ -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) {

8
index.php

@ -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>

3
language/en/text.php

@ -21,6 +21,9 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// 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';

2
nuMods_settings.inc.php

@ -14,6 +14,6 @@ $nuMods_settings['dropdownItemTextHoverBackgroundColor'] = '#f5f5f5';
$nuMods_settings['questionMarkColor'] = '#000000';
/* DO NOT EDIT ANYTHING BELOW THIS LINE */
$nuMods_settings['version']='1.2.1';
$nuMods_settings['version']='1.2.2';
?>

8
ticket.php

@ -216,6 +216,14 @@ require_once(HESK_PATH . 'inc/header.inc.php');
</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>

Loading…
Cancel
Save