tags:

views:

42

answers:

1

I am using config file which contains: config.php

define('SYS_TITLE','My Application Title');

I load language local for gettext based on SESSION variable in another file included after the config file is loaded. how to make it something like:

echo _(SYS_TITLE);

What is the best way to translate the SYS_TITLE without changing much of the code.

A: 

If I get you right you are looking for a way to import translated string into some php code.

How about loading all your strings in XL in the first column and generating the php code in the second column with a simple concatenate() call?

If you store "Something in English" in A1, you can setup B1 as follows:

=CONCATENATE("define('SYS_TITLE','",A1,"');")

You end up with

A1                      B1
Something in english    define('SYS_TITLE','Something in english');
sorry sir, but I am using gettext library to have separate files for translations.
wesamly