r302 version update 1.4.1

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

r302 version update 1.4.1

Post by Jensensen »

http://code.google.com/p/phpwcms/source/detail?r=302

Note that there are two new variables which should be added in the config file:

Code: Select all

$phpwcms['i18n_parse']             = 1; // enable|disable browser based language parser - all @@Text@@ will be parsed and checked for translation/var based replacement
$phpwcms['i18n_complex']     = 0; // enable|disable the way browser language setting should be used, false = the easier way (always 2 chars "en"), true - "en-gb"...
Have a look at: /config/phpwcms/dist.conf.inc.php


btw. phpwcms by now is v1.4.1
Last edited by Jensensen on Thu 12. Feb 2009, 02:14, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Re: r302 version update 1.4.1

Post by sustia »

Hi, there is a small guide about the Internationalisation usage inside the r305?
Campeones del mundo!
Vegetables!
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

This is great stuff!!!

Just wrap any text with @@ like so: @@my super text@@
you can use it wit alt tags for images, title tags for links, text within your content, within your templates....
Every time a user with a new (browser) language setting is hitting the site, a new file will be placed into /template/lemplate_lang like en-us.php, de-de.php. Now you only need to translate it:
$i18n_tokens['Land / Sprache wählen'] = 'Choose Country / Language';

As I've said before: great stuff :lol:
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: r302 version update 1.4.1

Post by Jensensen »

claus wrote:... wrap any text ...image ...
Really sounds GREAT! (so far i had no time left for testing. obviously you did?}
claus wrote:... Now you only need to translate it:
$i18n_tokens['Land / Sprache wählen'] = 'Choose Country / Language';
...
Where, what, how? Do you mean manually?
I thought, that the translation will happen automatically, isn't it???¿¿¿
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

)
Jensensen wrote:Where, what, how? Do you mean manually?
I thought, that the translation will happen automatically, isn't it???¿¿¿
You won't want to run a somehow babelfished site, would you? :mrgreen:
(nothing against that great babelfish!
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Re: r302 version update 1.4.1

Post by sustia »

claus wrote:This is great stuff!!!

Just wrap any text with @@ like so: @@my super text@@
you can use it wit alt tags for images, title tags for links, text within your content, within your templates....
Every time a user with a new (browser) language setting is hitting the site, a new file will be placed into /template/lemplate_lang like en-us.php, de-de.php. Now you only need to translate it:
$i18n_tokens['Land / Sprache wählen'] = 'Choose Country / Language';

As I've said before: great stuff :lol:
Hi, if I understand, all the phrases in my site that I would link to translate must be enclosed in @@my text@@, so when a new user come to my site (with, for example, an italian browser) a file (in this example, it-it.php) is created.

So now I must open the file, translate the text in italian and put this
$i18n_tokens['Land / Sprache wählen'] = 'Choose Country / Language';

and the new language is avalaible for the italian user (only with respect to the translated text, obviously).

It's correct?
Campeones del mundo!
Vegetables!
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

Not exactly.
The newly created file (en-en.php) is already containing the line
$i18n_tokens['Land / Sprache wählen'] = Land / Sprache wählen';
Now you just translated it into
$i18n_tokens['Land / Sprache wählen'] = 'Choose Country / Language';
where ['Land / Sprache wählen'] would be your original @@Land / Sprache wählen@@
Everything else within this file has to be left untouched!

And of course in conf.inc.php:
$phpwcms['i18n_parse'] = 1; // enable|disable browser based language parser - all @@Text@@ will be parsed and checked for translation/var based replacement
$phpwcms['i18n_complex'] = 1; // enable|disable the way browser language setting should be used, false = the easier way (always 2 chars "en"), true - "en-gb"...
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Re: r302 version update 1.4.1

Post by sustia »

Hi claus, thanks for the answer.

I'm tried to modify the file it.php, but the ftp client say me
553 Can't open that file: Permission denied
because with a second browser (in spanish) I visited the page, but no es.php file is created. :?
Campeones del mundo!
Vegetables!
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

Please check the file permission: is it 600 (-rw------, 644 (-rw-r--r--), 666 (-rw-rw-rw-) or what.
There is another thread running about file permission questions already

And check the preferred language setting for your browser tests - if a spanish browser has set english as a preference, no file for spanish will be generated...
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

At least one question (of many?) remains: How can I use this within a template? or a SHOW_CONTENT? This doesn't seem to work....
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

Hmmm...
this doesn't seem to work as cleanly as expected. Two images side by side, each with a title tag wrapped with @@ will produce unpredictable results picking up pieces of surrounding code like " />" and so on...
One single image is working fine.
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

Well - I've had an empty comment tag nearby in the template like so:
{some_rt}<!-- -->
where the content to be replaced was wrapped with @@
and it took these pieces of <!-- --> and mixed the into the file. This has happened with divs too.... I think Oliver should have a look into this one...
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: r302 version update 1.4.1

Post by juergen »

so claus,

you have this im one line or what ?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

I have had it... but now I deleted it and everything seems to be fine. But it isn't meant to take over or collecting pieces of code from around... or?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: r302 version update 1.4.1

Post by update »

so now this is working I wonder how to inject the right language tag into the doctype
$phpwcms['default_lang'] = 'de'; //default language
$phpwcms['DOCTYPE_LANG'] = ''; //by default same as $phpwcms['default_lang'], but can be injected by whatever you like
$phpwcms['allowed_lang'] = array('en', 'de', 'fr', 'it', 'es', 'be', 'pl'); //array of allowed languages
I would like to inject it automagically in dependance of the choosen (linked) language tree so there is no need to fiddle around with custom templates while doubling and tripling the needed templates. Anybody any idea how to achieve this?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply