Feature #2989
closedChanging language english to turkish not effect
0%
Description
After the change (System:General Setup > English to Turkish) is not effect, still WebGUI shows english language.
Files
Updated by N.Selim GUNER over 11 years ago
function set_language($lang = 'en_US', $encoding = "ISO8859-1") {
putenv("LANG={$lang}.{$encoding}");
setlocale(LC_ALL, "{$lang}.{$encoding}");
textdomain("pfSense");
bindtextdomain("pfSense","/usr/local/share/locale");
bind_textdomain_codeset("pfSense","{$lang}.{$encoding}");
}
function get_locale_list() {
$locales = array(
"en_US" => gettext("English"),
"pt_BR" => gettext("Portuguese (Brazil)"),
"tr_TR" => gettext("Turkish"),
is not effective /usr/local/www/head.inc line 16
(<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />)
if we can delete "charset=iso-8859-1" code that line and we rename folder /usr/local/share/locale/tr_TR.UTF-8 to tr_TR
lang default charset is effective and language working successfully.
and we can't understand why u need use a fonction
function set_language($lang = 'en_US', $encoding = "ISO8859-1") on line 2525.
thanks.
Updated by Chris Buechler over 11 years ago
- Priority changed from High to Normal
Updated by N.Selim GUNER over 11 years ago
note : after the head.inc line 16 changes turkish language works %80 diag_backup.php not working correctly.
i think other language's need to charset encoding functoin to but that function not working correctly
function set_language($lang = 'en_US', $encoding = "ISO8859-1") {
putenv("LANG={$lang}.{$encoding}");
setlocale(LC_ALL, "{$lang}.{$encoding}");
textdomain("pfSense");
bindtextdomain("pfSense","/usr/local/share/locale");
bind_textdomain_codeset("pfSense","{$lang}.{$encoding}");
we need create function to effective all php files.
Updated by N.Selim GUNER over 11 years ago
i found a fixes
Step 1: include code
/etc/inc/system.inc
@/* Init language environment */
function system_language_load()
{
global $config, $g_languages;
/* Get the language configured. */
$language = $config['system']['language'];
$domain = strtolower(get_product_name());
$codeset = $g_languages[$language]['codeset'];
putenv("LANG=$language");
setlocale(LC_MESSAGES, $language);
bindtextdomain($domain, "/usr/local/share/locale");
bind_textdomain_codeset($domain, $codeset);
textdomain($domain);
}
/* Get the codeset of the current configured language. /
/ Return: String containing codeset of current laguage. */
function system_get_language_codeset() {
global $config, $g_languages;
$language = $config['system']['language'];
$codeset = $g_languages[$language]['codeset'];
if (empty($codeset))
$codeset = "UTF-8"; // Set default codeset.
return $codeset;
}
/* Get the entity of LanguageCode of the current configured language. /
/ Return: String containing language code of current laguage. */
function system_get_language_code() {
global $config, $g_languages;
// a language code, as per [RFC3066]
$language = $config['system']['language'];
//$code = $g_languages[$language]['code'];
$code = str_replace("_", "-", $language);
if (empty($code))
$code = "en-us"; // Set default code.
return $code;
}@
STEP :2
/usr/local/www/index.php change code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="=system_get_language_code();?>" xml:lang="=system_get_language_code();?>">
<head>
<title>{$g['product_name']}.localdomain - {$g['product_name']} first time setup</title>
<meta http-equiv="Content-Type" content="text/html; charset==system_get_language_codeset();?>" />
STEP 3:
/usr/local/www/head.inc change code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="=system_get_language_code();?>" xml:lang="=system_get_language_code();?>">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset==system_get_language_codeset();?>" />
STEP 4:
/usr/local/www/system_firmware_auto.php change code<meta http-equiv="Content-Type" content="text/html; charset==system_get_language_codeset();?>" />
STEP 5:
/usr/local/www/graph_cpu.php delete code print('' . "\n");?>
to print('' . "\n");?>
STEP 6:
/usr/local/www/graph.phpprint('' . "\n");?>
to print('' . "\n");?>
STEP 7:
/usr/local/www/getserviceproviders.php delete code Header("Content-type: application/xml; charset=iso-8859-1");
echo "\n";
to
Header("Content-type: application/xml;");
echo "\n";
and need rename 2 folders in
/usr/local/share/locale
tr_TR.UTF-8 to tr
and
pt_BR.ISO8859-1 to pt_BR
po and mo must include that folders
and
last change
/etc/inc/pfsense-utils.inc
function get_locale_list() {
$locales = array(
"en_US" => gettext("English"),
"pt_BR" => gettext("Portuguese (Brazil)"),
"tr_TR" => gettext("Turkish"),
to
function get_locale_list() {
$locales = array(
"en_US" => gettext("English"),
"pt_BR" => gettext("Portuguese (Brazil)"),
"tr" => gettext("Turkish"),
all done.
thanks
Updated by N.Selim GUNER over 11 years ago
- File pfsense bug 2989.zip pfsense bug 2989.zip added
ignore #4 message text editor not give all codes
i send a files in zip here.
and lines copying here
head.inc
line 13 to 16
index.php
line 162 to 165
/etc/inc/system.inc
included line 1643 to 1685
system_firmware_auto.php
line 66
graph.php
line 100
graph_cpu.php
line 70
getserviceproviders.php
line 77 and 78
/etc/inc/pfense utils.inc
line 2537
Updated by N.Selim GUNER over 11 years ago
after that changes need rename folders in
/usr/local/share/locale
tr_TR.UTF-8 to tr
and
pt_BR.ISO8859-1 to pt_BR
Updated by N.Selim GUNER over 11 years ago
- File pfsense bug 2989.zip pfsense bug 2989.zip added
last change
system.inc changed
i re sending zip file
Updated by Renato Botelho over 11 years ago
You can use github and send a pull request with all changes. It's the best way to submit patches.
Updated by N.Selim GUNER over 11 years ago
i never used like github system can u contact for me in skype ? add me tech5050 please i must talk to you.
Updated by Renato Botelho over 11 years ago
You can find instructions on github help:
Updated by Chris Buechler over 11 years ago
- Tracker changed from Bug to Feature
- Priority changed from Normal to Low
- Target version deleted (
2.1) - Affected Version deleted (
2.1)
Updated by Renato Botelho over 11 years ago
- Target version set to 2.2
In order to have Turkish language working all pfSense pages charset must be changed to UTF-8, what is not going to happen for version 2.1 because it's on a point we need to avoid changes that could break things. I'm going to remove Turkish language from the menu of available languages for now.
You can maintain your own fork with all pages set to UTF-8 if you want to do it, and we can merge changes after 2.1 is released and get it ready for 2.2.
Updated by N.Selim GUNER over 11 years ago
Im complate my code for update from gethub pfsense all php pages now supporting dynamic charset codes check it for in github thanks.
Updated by N.Selim GUNER over 11 years ago
- File pfsense auto codeset.zip pfsense auto codeset.zip added
I send files here to please update all.
i send github one week ago no one import codes for releases.
Updated by Renato Botelho over 11 years ago
- Status changed from New to Resolved
Updated by Marcello Silva Coutinho almost 10 years ago
Is the pull request merged? what it's id?