rejetto forum

Software => HTML & templates => HFS ~ HTTP File Server => RAWR-Designs => Topic started by: nuvolablu on January 19, 2010, 04:08:23 PM

Title: Multilanguage rawr template
Post by: nuvolablu on January 19, 2010, 04:08:23 PM
Hello,
   I know that RAWR template is multilanguage but we have to choose just one language!
It would be very usefull to allow the final user (the guy who browse) to choose between the languages like to put at the top of the page the interational flags or something like that.

Thanks in advance.
Best regards.
S.
Title: Re: Multilanguage rawr template
Post by: TSG on January 21, 2010, 03:17:23 AM
This is an eventual capability I am hoping for. It could even be made automatic, detecting the dns of the user, however HFS cannot do this at the moment.
Title: Re: Multilanguage rawr template
Post by: Mars on January 21, 2010, 08:29:24 AM
{.switch|%lang%|en|{:english tpl:}|fr|{:french tpl:}|......  .}
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 21, 2010, 08:57:17 AM
{.switch|%lang%|en|{:english tpl:}|fr|{:french tpl:}|......  .}

where I have to put it?
thanks in advance.
S:
Title: Re: Multilanguage rawr template
Post by: rejetto on January 21, 2010, 03:07:55 PM
INSTRUCTIONS :P

right click on the home/root > properties > diff template
paste this stuff

Code: [Select]
[+special:begin]
{.load|/template/rawr_default/languages/%lang%.txt|special:strings.}
{.if not|{.^special:strings.}|{:
    {.load|/template/rawr_default/languages/{.!language.}.txt|special:strings.}
:}.}
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 21, 2010, 03:26:16 PM
and what it should happend?
I tried it woks like abitual (nothing changed)
in fact I can't test it...
Thanks in advance for the explication.
forza raga!
Ciao.
S.
Title: Re: Multilanguage rawr template
Post by: rejetto on January 21, 2010, 03:36:51 PM
@nuvolablu
it will show the template using the same language of your browser.
if a translation for that language is not available, then it relies on the configured one.
if you already had configured "italian" and tried using an "italian" browser, then you'll see no change.
try configuring english and you'll see you'll continue getting an italian template, because of the "detection".
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 21, 2010, 03:45:12 PM
@nuvolablu
it will show the template using the same language of your browser.
if a translation for that language is not available, then it relies on the configured one.
if you already had configured "italian" and tried using an "italian" browser, then you'll see no change.
try configuring english and you'll see you'll continue getting an italian template, because of the "detection".

good!
1)why not to put it in the template?
2)how can I test it?
thants in advance.
S.
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 21, 2010, 04:30:57 PM
IT WORKS LIKE A CHARM!!!!
thanks a lot!!!!
U are great!

S.
Title: Re: Multilanguage rawr template
Post by: rejetto on January 21, 2010, 11:03:34 PM
1) i believe customization should be kept detached from the template.
reason: when a new version of rawr will be published, you'll be able to upgrade without having to reapply all modifications.
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 22, 2010, 08:21:32 AM
@nuvolablu
it will show the template using the same language of your browser.


I think it takes the language of the O.S.
I've altready installed the french version of opera browser...and hfs still keep the italian language (template set as default english)

the result is the same but...
what do you think?
Title: Re: Multilanguage rawr template
Post by: rejetto on January 22, 2010, 10:40:02 AM
no. i'm sure it's the browser, i know because i tested it.
BUT consider that the language of the GUI is not bound to the language requested for web pages.
so it's likely that your french Opera decided to request italian pages because of your italian system, but you can change this, and to say it all, you didn't even need to download a different version of Opera.

CTRL+F12 > general > language for web pages

as i change the option in Opera, the template is changing its language, with not modification of HFS files.
Title: Re: Multilanguage rawr template
Post by: nuvolablu on January 22, 2010, 10:43:32 AM
great!
Title: Re: Multilanguage rawr template
Post by: TSG on January 22, 2010, 01:14:03 PM
I'll add this to the next build, whenever I get around to making it.
Title: Re: Multilanguage rawr template
Post by: rejetto on January 22, 2010, 03:45:00 PM
wise move