Translating hardcoded DirectAdmin results

Status
Not open for further replies.

AidarJan

Verified User
Joined
May 29, 2008
Messages
5
I'm translating the enhanced skin English language to Russian language.

Translating text variables is not difficult, but translating hardcoded results really hard to me.

I read tutorials on site and this one:
- there is a help on how-to:
http://help.directadmin.com/item.php?id=74

but i have a trouble to apply it.

Mine translate realization principles:

Content of file:
Code:
user/server_info.html

HTML:
|?TREE=» <a class=tree href="/CMD_SYSTEM_INFO">`LANG_SYS_INFO`</a>|
|?HELP_SECTION=`USER_HELPER`/misc.html#serverinfo|
|HTM_USER_TOP|

|HTM_HTOKEN_SERVERINFO_TABLE|

|HTM_USER_BOTTOM|

In file:
Code:
files_user.conf
i have:
HTML:
HTM_HTOKEN_SERVERINFO_TABLE=tables/serverinfo.html

Content of file:
Code:
tables/serverinfo.html

HTML:
|$/usr/local/bin/php
<?php
if ("|LANG_LANG|"=='RUS'){
$data = <<<END
|SERVERINFO|
END;

$data = str_replace('Name</a>', 'Íàèìåíîâàíèå</a>', $data);
$data = str_replace('Running', 'Çàïóùåí', $data);
$data = str_replace('Value</a>', 'Çíà÷åíèå</a>', $data);

echo $data;
}else {
echo<<<END
|SERVERINFO|
END;
}
?>
DONE|

P.S.
file:
Code:
lang/ru/lf_standard.html
contains the line:
HTML:
LANG_LANG=RUS

P.P.S. DirectAdmin version 1.31.0, enhanced skin downloaded from this site.

About all of these: the code not work, and it's no matter to use ' or " in the code.

I need help and any advices.
 
Can anybody give any, any suggestions?
Just tell your opinion about post.

Translating hardcoded DirectAdmin results

HTML:
|$/usr/local/bin/php
<?php
$data = <<<END
|TABLE_TOKEN|
END;
$data = str_replace("englishtext", "newtext", $data);
$data = str_replace("englishtext2", "newtext2", $data);
echo $data;
?>
DONE|

Is this work?
May be somebody released this on the working site?
 
So is just nothing happening? Does the page appear blank or anything?

After this line:
Code:
if ("|LANG_LANG|"=='RUS'){
I'd probably temporarily put:
Code:
echo "testing testing testing<br />";
and look for it at the top of the page to make sure that that conditional statement returned true as that seems like the only thing that could cause a problem.
 
So is just nothing happening? Does the page appear blank or anything?

After this line:
Code:
if ("|LANG_LANG|"=='RUS'){
I'd probably temporarily put:
Code:
echo "testing testing testing<br />";
and look for it at the top of the page to make sure that that conditional statement returned true as that seems like the only thing that could cause a problem.

After this i have no effect.
echo "testing testing testing<br />"; - doesn't work

This code give me a blank screen area where must be a "serverinfo" table.

Code:
|$/usr/local/bin/php
<?php
if ("|LANG_LANG|"=='RUS'){
$data = <<<END
|SERVERINFO|
echo "testing testing testing<br />";
END;

$data = str_replace('Name</a>', 'Наименование</a>', $data);
$data = str_replace('Running', 'Запущен', $data);
$data = str_replace('Value</a>', 'Значение</a>', $data);
echo "testing2 testing2 testing2<br />"
echo $data;
}else {
echo<<<END
|SERVERINFO|
END;
}
?>
DONE|
 
Supposed to be:
Code:
|$/usr/local/bin/php
<?php
if ("|LANG_LANG|"=='RUS'){
echo "testing testing testing<br />";
$data = <<<END
|SERVERINFO|
END;

$data = str_replace('Name</a>', 'Наименование</a>', $data);
$data = str_replace('Running', 'Запущен', $data);
$data = str_replace('Value</a>', 'Значение</a>', $data);
echo "testing2 testing2 testing2<br />"
echo $data;
}else {
echo<<<END
|SERVERINFO|
END;
}
?>
DONE|
:)
 
Yeah, correcting to this
Code:
|$/usr/local/bin/php
<?php
if ("|LANG_LANG|"=='RUS'){
echo "testing testing testing<br />";
$data = <<<END
|SERVERINFO|
END;

$data = str_replace('Name</a>', 'Наименование</a>', $data);
$data = str_replace('Running', 'Запущен', $data);
$data = str_replace('Value</a>', 'Значение</a>', $data);
echo "testing2 testing2 testing2<br />"
echo $data;
}else {
echo<<<END
|SERVERINFO|
END;
}
?>
DONE|
has no any effect.

blank page, no tables.

It's interesting that this code doesn't work too:
Code:
|$/usr/local/bin/php
<?php
echo "testing testing testing<br />";
$data = <<<END
|SERVERINFO|
END;
$data = str_replace('Name</a>', 'testname</a>', $data);
$data = str_replace('Running', 'testrunnig', $data);
$data = str_replace('Value</a>', 'testvalue</a>', $data);
echo "testing2 testing2 testing2<br />"
echo $data;
?>
DONE|

and this too:
Code:
|$/usr/local/bin/php
<?php
echo "testing testing testing<br />";
?>
DONE|

may be something wrong with php interpretation? or other thing?
 
Have the same trouble.
This construction doesnt work
Code:
|$/usr/local/bin/php
<?php

some code...

?>
DONE|
BTW, translation in russian already exists...
Maybe just correct some phrases in this? and that's all? =) If you interested - write me in PM.
 
Status
Not open for further replies.
Back
Top