This topic is locked

Language issues

7/22/2008 21:06:48
PHPRunner General questions
Z
zeitsprung author

The application I've built uses German as default language. After the project was finished, I decided to optimize the German language file to suit my needs. After re-building the complete file set I discovered that not any template reflected the changes I made. In contrast 'languages.php' contains English and German and shows a line $mlang_defaultlang="English";.

I'm a little bit puzzled how to achive the altered phrases in my templates. As a work around I altered the resulting templates, but after a rebuild they're gone again.
BTW: I temporarily switched to multi lingual mode using English and German - alas, since no changes were visible I switched back to single language German...
What has to be done to get possible changes in language file into an already built project?

Thanks.

W
wrjost 7/23/2008

Hallo, Zeitspringer,

PHPR uses its own language files (XXX.lng, located in the \lang subdirectory) when you (re-)build a project.
So, you only need to alter the language file(s) once to suit your needs.
You can add your own field names in both languages, too.
Let's assume you have a database with a field called "fruehstueck" in German. In your template you will find a line like this:
[indent]href="_table1_list.php?orderby={$order_dir_fruehstueck}fruehstueck">fruehstueck</A> [/indent]
This will display in both German and English templates as "fruehstueck", the original German field name. Now you replace the last "fruehstueck" with {mlang_message tag="fruehstueck"} :

[indent]href="_table1_list.php?orderby={$order_dir_fruehstueck}fruehstueck">{mlang_message tag="fruehstueck"}</A> [/indent]
Then you add to the file "German.lng" the line
[indent]<message tag="fruehstueck">Frühstück</message>[/indent]
and to the "English.lng" file the line
[indent]<message tag="fruehstueck">Breakfast</message>.[/indent]
Rebuild your project and that's it - bilingual.
If you still have a problem, send me an email.
Greetings,

Wilfried
P.S.: Make sure you copy your altered *.lng files to a safe place before you install any update of PHPR - it loves to overwrite hours of work... :-)))

Z
zeitsprung author 7/23/2008

Hi Wilfried,

PHPR uses its own language files (XXX.lng, located in the \lang subdirectory) when you (re-)build a project.

So, you only need to alter the language file(s) once to suit your needs.



That's what I already did. I optimized the German.lng file to get an optimized translation with shorter expressions e.g.

You can add your own field names in both languages, too.



Yes, I've read about this feature in the posts

But what is bugging me is the fact that none of my changes appear in a new build of the project. The file 'languages.php' shows up all the changes - but the templates remain with the translation of the default 'German.lng' distibuted with the application itself.

I don't think I have to add a {mlang_message tag="something"} for altered but already existing expressions in the localized_language.lng file.

May be that there's another (obvious) solution I've overlooked. Imho I thought that each build always uses localized_language.lng for dynamically rebuild all template files...and in this case will reflect all changes made to this file.

Thanks you for your reply.