View Single Post
  #4  
Old 05-13-2013, 09:06 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by JohnnyChimpo View Post
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.=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.
Reply With Quote