Text-module for easy install languages

Use GitHub to post feature requests for phpwcms.
Locked
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

Text-module for easy install languages

Post by Moozie »

To make other languages possible it is maybe a good idea not to work with hard-coded language in the php files, but with variables. And supply a seperate file with all the translations of these variables.

Example:
In the form-handling you get a page with all the filled fields when you press "send". That page is in German. It says something like: "Felden" und "Wert" or something.
A variation could be: $text1 and $text2.
And in a seperate language file:
$text1 = "Felden";
$text2 = "Wert";

So people can easily translate the whole file with maybe hundreds of lines like: $text345 etc.

Also easy when installing updates.
ruben
Posts: 29
Joined: Mon 10. Nov 2003, 21:58
Location: Norway

Post by ruben »

That would save 'everybody' including Oliver a lot of time in the 'long run'

just my 2 cents

ruben
User avatar
Oliver Georgi
Site Admin
Posts: 9906
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

That's the only possible way that makes sense - split everything into var/value and make different easy to translate language include files.
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
ruben
Posts: 29
Joined: Mon 10. Nov 2003, 21:58
Location: Norway

Post by ruben »

just use the same solution as for example phpnuke uses. really great with just 1 (and maybe 1 for the admin part) translation file.

Ruben
Locked