Project

General

Profile

Actions

Feature #2989

closed

Changing language english to turkish not effect

Added by N.Selim GUNER over 11 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Low
Category:
Web Interface
Target version:
Start date:
05/09/2013
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

Description

After the change (System:General Setup > English to Turkish) is not effect, still WebGUI shows english language.


Files

pfsense bug 2989.zip (57.3 KB) pfsense bug 2989.zip N.Selim GUNER, 05/09/2013 05:20 AM
pfsense bug 2989.zip (57.3 KB) pfsense bug 2989.zip N.Selim GUNER, 05/09/2013 05:50 AM
pfsense auto codeset.zip (44.6 KB) pfsense auto codeset.zip N.Selim GUNER, 05/17/2013 04:28 AM
Actions #1

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.

Actions #2

Updated by Chris Buechler over 11 years ago

  • Priority changed from High to Normal
Actions #3

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.

Actions #4

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="" xml:lang="">
<head>
<title>{$g['product_name']}.localdomain - {$g['product_name']} first time setup</title>
<meta http-equiv="Content-Type" content="text/html; charset=" />

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="" xml:lang="">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=" />

STEP 4:
/usr/local/www/system_firmware_auto.php change code
<meta http-equiv="Content-Type" content="text/html; charset=" />
STEP 5:
/usr/local/www/graph_cpu.php delete code
print('' . "\n");?> to print('' . "\n");?>
STEP 6:
/usr/local/www/graph.php
print('' . "\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

Actions #5

Updated by N.Selim GUNER over 11 years ago

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

Actions #6

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

Actions #7

Updated by N.Selim GUNER over 11 years ago

last change

system.inc changed

i re sending zip file

Actions #8

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.

Actions #9

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.

Actions #10

Updated by Renato Botelho over 11 years ago

You can find instructions on github help:

https://help.github.com/articles/using-pull-requests

Actions #11

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)
Actions #12

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.

Actions #13

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.

Actions #14

Updated by N.Selim GUNER over 11 years ago

I send files here to please update all.
i send github one week ago no one import codes for releases.

Actions #15

Updated by Renato Botelho over 11 years ago

  • Status changed from New to Resolved
Actions #16

Updated by Marcello Silva Coutinho almost 10 years ago

Is the pull request merged? what it's id?

Actions

Also available in: Atom PDF