4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Vincent on April 17, 2005, 04:11:43 PM

Title: text html in differen languages
Post by: Vincent 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
Title: Re: text html in differen languages
Post by: V@no 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.
Title: Re: text html in differen languages
Post by: Vincent 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.
Title: Re: text html in differen languages
Post by: martrix 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:
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...
Title: Re: text html in differen languages
Post by: Vincent 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
Title: Re: text html in differen languages
Post by: martrix 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\"
Title: Re: text html in differen languages
Post by: Vincent 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
Title: Re: text html in differen languages
Post by: martrix 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
Title: Re: text html in differen languages
Post by: Vincent 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
Title: Re: text html in differen languages
Post by: martrix 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?
Title: Re: text html in differen languages
Post by: Vincent 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:
Title: Re: text html in differen languages
Post by: V@no 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> :?: :?
Title: Re: text html in differen languages
Post by: Vincent on April 20, 2005, 11:02:32 AM
@Vano
if you just have one field you don't need <TR>

sincerly
vincent