Author Topic: text html in differen languages  (Read 9903 times)

0 Members and 1 Guest are viewing this topic.

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
text html in differen languages
« on: April 17, 2005, 04:11:43 PM »
Hello

on my homepage when i add some information like a copyright information i crate a copyright.php file (with minimum code) this php will call a copyright.html file!
the html file I do edit and write down all the infromation - so far is everithing all right!

But if i wish to go more international i will need to rewrite something, so my question how could i do it different to be able to switch easy the language? First language is German - but later i wish also english, french, türkish!

thanks
for a feedback
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


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: text html in differen languages
« Reply #1 on: April 17, 2005, 09:15:38 PM »
in your .php file u should have register some tags, there u can add something like: "lang_copyright" => $lang['copyright'], which will register {lang_copyright} template tag with content of your $lang['copyright'] variable (that variable should be in your lang/<yourlang>/main.php file.
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 Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #2 on: April 19, 2005, 10:14:13 AM »
could you pleas explain me how i should do it? I tryed it but it was not working!
vincent

Quote
in your .php file u should have register some tags, there u can add something like: "lang_copyright" => $lang['copyright'], which will register {lang_copyright} template tag with content of your $lang['copyright'] variable (that variable should be in your lang/<yourlang>/main.php file.
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: text html in differen languages
« Reply #3 on: April 19, 2005, 05:01:06 PM »
for any text, you want to have multi-lingual:

first we have to make the language tag in the language-files

so we have to open

lang/<yourlang>/main.php

and at the end just before ?> add this line:

Code: [Select]
$lang['copyright'] = "Copyright violators will get kicked in the b***s (if no b***s available, *ss will be used for kicking)";

now, when the lang-variable does exist, we can register it into the templates as a tag...

so open
./includes/page_header.php and find:

Code: [Select]
$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
  "thumb_url" => THUMB_PATH,

with a lot of more variables there... and into that array add

Code: [Select]
"lang_copyrigt" => $lang['copyright'],for your copyright notice...
In this array:
"lang_copyright" will be your tag-text in the template files
and
$lang['copyright'] is the reference to the language-variable...


then you can use {lang_copyright} - look at the page_header.php code above, where we just registered it as "lang_copyright"...

Notice: this is just an example, so if you want to:
  • kick no b***s for copyright violation, but tell an absolute different story, replace copyright with different_story or anything you consider appropriate
  • use the language-tag only on the home-page, use it in index.php or only on a category page, use it in categories.php etc.
  • If you use this - register the tag under
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
because
Code: [Select]
$site_template->register_vars(array(is more than one time in the code there for different situations...
[li]add another language tag, create the language variable in the language/<yourlanguage>/main.php and register it in the .php file of your needs...[/li]
[li]if you create a new lang['yourlanguagevariable'] in the lang/<yourlang>/main.php files, check if "yourlanguagevariable" is not there already - otherwise it won't work as you expect  :wink:[/li]
[/list]

I hope that it is right what I wrote  :D
It at least works on my 1.7 gallery...
MAяTRIX


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #4 on: April 19, 2005, 09:55:16 PM »
@matrix
you want belive it but it works  :lol:

but  :?

if i have a Headline i would like to make a <H2>  text </H2> it makes error
or i would like a spezial font
or maybe a table
or a url to a homepage or a php file
is it possible to add it in the Main.php

sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: text html in differen languages
« Reply #5 on: April 19, 2005, 10:09:55 PM »
Great! :D

I believe it, if you write it  :wink:

but  :?

I don't really understand what you want to say with
 
if i have a Headline i would like to make a <H2> text </H2> it makes error
or i would like a spezial font
or maybe a table
or a url to a homepage or a php file
is it possible to add it in the Main.php

hm... if you just want to ask if html is allowed to use in the main.php file then: yes  8O

you may use formatting tags... use images instead of text...

BUT BEWARE: quotes MUST always follow after a \!
So instead of font="arial" you MUST write font=\"arial\"
MAяTRIX


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #6 on: April 19, 2005, 10:38:46 PM »
i mean if you go to my page the copyright
is as haed 2 definet in html but if i add the code <H2> i get a error
but maybe i have to use \<H2>

will try
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: text html in differen languages
« Reply #7 on: April 19, 2005, 10:57:22 PM »
well, "an error" is not enough to help you   :roll:
Your doctor won't help you also if you tell him "I have some problems:wink:

I don't see any error on your copyright page
MAяTRIX


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #8 on: April 19, 2005, 10:57:55 PM »
right !
i have a table as example with my adresse:
$lang['IKOV_Adresse'] = "<table><td>Meine Adresse:</td><td>Vincent Kocher<BR>Gotthelfstrasse 14<br>CH-4800 Zofingen<br>Schweiz</td></table> ";

above it works

but i would like to have the "<table><td valign="top">Meine Adresse

to add this part i make a error
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline martrix

  • Hero Member
  • *****
  • Posts: 755
    • View Profile
    • overlord.cz
Re: text html in differen languages
« Reply #9 on: April 19, 2005, 11:13:37 PM »
BUT BEWARE: quotes MUST always follow after a \!
So instead of font="arial" you MUST write font=\"arial\"

 :|

Did you read that?

Did you post it like you wrote here (incl. the valingt), or did you write

$lang['IKOV_Adresse']="<table><td valign=\"top\">"Meine Adresse?
MAяTRIX


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #10 on: April 19, 2005, 11:23:33 PM »
 :)  no no writing faster then thinking and controlling

and now it works i put the \ on the wrong plase
and it works also with the H2 code

cheers thanks
a lot

vincent

PS what next to improve?  :wink:
Beati pauperi spiritus

4images 1.7 // My Installed Mods


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: text html in differen languages
« Reply #11 on: April 20, 2005, 12:08:59 AM »
Copyright violators will get kicked in the b***s (if no b***s available, *ss will be used for kicking)
LMAO! I choked on the chicken I was eating, when saw that...lol nice!


@Vincent:
I thought <tr> tag should be between <table> and <td> :?: :?
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 Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: text html in differen languages
« Reply #12 on: April 20, 2005, 11:02:32 AM »
@Vano
if you just have one field you don't need <TR>

sincerly
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods