This topic is locked

Translation of field names

11/21/2006 3:54:12 AM
PHPRunner General questions
B
bluestrikealpha author

PHPrunner is the future, It is just a dream come true for me. Never programmed anything, and now a professional database.
I just want to solve some new challenges; When you change the language in the menu, I would like to have the field names changed as well. I already have changed the labels into english, but you still see the table names for instance above the table where you are working in. So my question is can I automatically change the field and table names into a new language for instance spanish or french when he user changed the language when logging in?
Thanks in advance Jane and Alexey
You are champions!

J
Jane 11/22/2006

Dion,
you can do the following:

  1. use {mlang_message tag="FieldName"} and {mlang_message tag="TableName"} instead of field and table names on the Visual Editor tab.
  2. build your project.
  3. open generated include/languages.php file and add new lines at the end of file:
    $mlang_messages["English"]["FieldName"]="FieldName";

    $mlang_messages["Spanish"]["FieldName"]="SpanishFieldName";

    $mlang_messages["French"]["FieldName"]="FrenchFieldName";
    $mlang_messages["English"]["TableName"]="TableName";

    $mlang_messages["Spanish"]["TableName"]="SpanishTableName";

    $mlang_messages["French"]["TableName"]="FrenchTableName";

V
vivek 1/22/2007

Hi there,
I just tried one field to make the registration proces multilingual and my custom fields do not translate. In stead they use the translation of the default language instead. If I change the default language the custom fields does translate.
Is there a workarround for this ?
Thanks,
Vivek

J
Jane 1/22/2007

Vivek,
I'm not sure that I understand you correctly.

Where and how have you edited your custom fields?

Please give me more detailed description of what you need to achieve and I'll help you.

V
vivek 1/22/2007

Well it does sound a little confusing. I'll tell you exactly what I did :
First in the visual editor i changed the Register page. I had added custom fields through Security -> User login settings -> Choose fields.
<TR>

<TD align=right width="50%">

<DIV align=left>{mlang_message tag="fname"}:</DIV></TD>

<TD width="50%">{build_edit_control field="firstname" mode="add" value=$value_firstname}

</TD></TR>
Than i Built the project and altered languages.php I added the following lines
// Customised field and tablenames
$mlang_messages["Dutch(Standard)"]["fname"]="Voornaam";

$mlang_messages["English"]["fname"]="Firstname";
I wanted to have the registration page translate as people would select a different language in the login screen and then go to register. I can't get the Firstname field (wich I added to the registration process) to translate. It gives the english translation which is the default language but not the desired language. The only way I can have the dutch translation show if I change the default language in the languages.php file but then offcourse the english does not show up anymore.
It would be nice if users could register in their own language otherwise I'll have to make seperate registration pages for each language.
Any help appreciated

V
vivek 2/16/2007

Is there anyone that can help ?

J
Jane 2/16/2007

Vivek,
thank you for pointing me to this bug.

We'll fix it in the next PHPRunner update.
To make your pages working please do following:

  • open C:/Program Files/PHPRunner3.1/source/login.php, find and remove following code snippet:
    if(!@$_SESSION["MyURL"])

    session_unset();


  • open C:/Program Files/PHPRunner3.1/source/register.php, find and remove this line:> session_unset();



Then rebuild your pages.

V
vivek 2/22/2007

Thanks! This works Great!