Quote:
Originally Posted by JohnnyChimpo
Why does this not put the file string into temp.filename array, the output of this is 0.
PHP Code:
const lngNumber = 8;
function onActionServerside() { for (temp.i =0;i<lngNumber;i++){ temp.filename[i] = "levels/translations/server_de.po"; } }
This isn't all the script obviously but when i take the for loop out everything works correctly i'm stumped. Thanks in advance.
|
Why not just store the languages like this
PHP Code:
function onChangeLanguage(lang){
temp.translationfiles = {
{"English", "en"},
{"Dutch", "de"},
{"Troll", "tr"}
};
for(temp.translationfile : temp.translationfiles){
if(temp.translationfile[0] == lang){
// then for your path do something like and whatever else you want to do
loadtranslation("levels/translations/server_" @ temp.translationfile[1] @ ".po");
}
I typed this on my phone so by the time i finished i don't know if it went where it needed to go to answer your original question and im sure the formatting is off.