Author Topic: Posting of a new translated sentence  (Read 5351 times)

0 Members and 1 Guest are viewing this topic.

Offline CharlyG

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Villes-fleuries.com
Posting of a new translated sentence
« on: May 14, 2005, 02:23:53 PM »
I have a problem of posting of a sentence translated
 here is my problem:
I created a template "partenaires.html"
 I call it via a link "index.php?template=partenaires" which I put in "user_logininfo.html"
now I have this in my file "user_logininfo.html":  
Code: [Select]
<table width="100%" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td valign="top" align="left">
 {lang_loggedin_msg}<br /><br />
<div id="categories">
      <a href="index.php?template=partenaires">&raquo; {lang_partenaires}</a>
      <a href="{url_lightbox}">&raquo; {lang_lightbox}</a>
      <a href="{url_control_panel}">&raquo; {lang_control_panel}</a>
      <a href="{url_logout}">&raquo; {lang_logout}</a>
</div>
</td>
  </tr>
</table>
as you notice it, I made so that the word "Partners" changes according to the language selected
thus I created an additional line in the files of translation "main.php" of the various languages.  
Code: [Select]
$lang['partenaires']="Partners";
but here, that is not posted on my page
I have well the bond but not the text. on the other hand the sign is posted.....

then if somebody has the solution, thank you to communicate it to me  

thanks in advance

Here is my site : http://www.villes-fleuries.com

Sorry for this english,  but I use a translator to write.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: Posting of a new translated sentence
« Reply #1 on: May 14, 2005, 06:47:40 PM »
New language words are not automatically output to all templates.  You must register the new variable first.  Open includes/page_header.php and find this:
Code: [Select]
$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],

Change it to this:
Code: [Select]
$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_partenaires" => $lang['partenaires'], // My "Partners" language word

Offline CharlyG

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • Villes-fleuries.com
Re: Posting of a new translated sentence
« Reply #2 on: May 14, 2005, 07:14:30 PM »
yes !!

thank you very much  :mrgreen:

Offline hinzwiekunz

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.hinzwiekunz.de
Re: Posting of a new translated sentence
« Reply #3 on: July 25, 2005, 12:07:59 AM »
mmmmh. I had a similar problem, but nothing is changed.

In page_header.php

i registered following lines:

Code: [Select]
// Replace Globals in $lang
$lang = $site_template->parse_array($lang);

$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_license_free" => $lang['license_free'],
  "lang_license_notfree" => $lang['license_notfree'],
  "lang_license_all" => $lang['license_all'],

in the language-main-file i add also:

Code: [Select]
//-----------------------------------------------------
//--- Search ------------------------------------------
//-----------------------------------------------------
$lang['license_free'] = "Lizenzfrei";  // "NEU"
$lang['license_notfree'] = "Lizensiert";  // "NEU"
$lang['license_all'] = "alle Lizenzarten";  // "NEU"

and in my search_form.html-Template i want to use it:

Code: [Select]
<table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input type="radio" name="image_license" value="1" />
                    {lang_license_free}</td>
                <td>&nbsp;</td>
                <td><input type="radio" name="image_license" value="0" />
                    {lang_license_notfree}</td>
                <td>&nbsp;</td>
                <td><input type="radio" name="image_license" value="all" checked="checked" /> 
                    {lang_license_all}</td>
              </tr>
            </table>

But it doesn't display the text!!! Have I forgot something. I can't read any mistake...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Posting of a new translated sentence
« Reply #4 on: July 25, 2005, 12:29:58 AM »
There is no prefix "lang_" when u register entire $lang array as u did.
{license_free} would be the correct tag.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline hinzwiekunz

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
    • http://www.hinzwiekunz.de
Re: Posting of a new translated sentence
« Reply #5 on: July 25, 2005, 09:59:53 PM »
Many Thanks, Vano.  :lol:

It works. But I don't understand why there are so differences. Some times its enough to take the entries in the llanguage_main, sometimes I need to register in page_header...
Are there some rules?

hinzwiekunz

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Posting of a new translated sentence
« Reply #6 on: July 26, 2005, 01:12:32 AM »
The only rule there is that a tag must be registered before it can be used ;)
as u can see the "lang_" prefix is being added during registration the tag:
Quote
  "lang_site_stats" => $lang['site_stats'],
  "lang_license_free" => $lang['license_free'],
  "lang_license_notfree" => $lang['license_notfree'],
  "lang_license_all" => $lang['license_all'],
When you register the entire array as u did, the tag name is being taken from array keys.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)