I have made one language file,. It will look something like this.
lang.php
define('lang_var_1','english');
now I want a function that can replace 'english' to other value.
I have made one language file,. It will look something like this.
lang.php
define('lang_var_1','english');
now I want a function that can replace 'english' to other value.
My Suggestion is make multiple language files one for each language. Each file essentially looks the same except the translation itself. But they all share the same definition for that translation. You would then make a function that would load the given language file of choice.
However you always want one default language pack. Reason for this is when you load a language pack and your rendering whatever where ever if the definition your looking for either doesn't exist in one language pack or has no value cause the translation hasn't been found yet you want to revert to a pack that does have a translation for everything so your not left with empty gaps.
you can set a variable instead of defining language as constant
lang.php
define('lang_var_1',$language);
then give a choice to users to select which languages they want to use.Afterwards you can get that value and set $language to that value. Here you go.