Jump to content
MakeWebGames

Game in Different Languages.


Will

Recommended Posts

I'm thinking of making the entire site into other languages, I have people who can translate it. I was thinking either copy all the files into a different folder with all the text a different language or have a database for languages and have a code for every text and every page it searches the database for that code.

Which method do you people think is faster? I would prefer the second but I'm thinking it will be too slow.

Link to comment
Share on other sites

Re: Game in Different Languages.

Have language files, like en.lang.php

Inside, something like

 

$lang['help'] = 'Help';
$lang['register_info'] = 'Register with us to do whatever.';

 

Translate that page, and include the one that corresponds to their language. I did it on a few new projects, but it takes a LOT of time to add new text into it, especially since while making new pages, i had to do things like:

 

echo '<h1>'.$l->register_info.'</h1>';

 

then had to add that text into the file. It takes a lot longer but it usually has its obvious benefits

Link to comment
Share on other sites

Re: Game in Different Languages.

 

Have language files, like en.lang.php

Inside, something like

 

$lang['help'] = 'Help';
$lang['register_info'] = 'Register with us to do whatever.';

 

Translate that page, and include the one that corresponds to their language. I did it on a few new projects, but it takes a LOT of time to add new text into it, especially since while making new pages, i had to do things like:

 

echo '<h1>'.$l->register_info.'</h1>';

 

then had to add that text into the file. It takes a lot longer but it usually has its obvious benefits

Or,

$lang = array(
 'af' => array(
       'reg' => 'registreer',
       'bye' => 'baai'),
 'en' => array(
       'reg' => 'register',
       'bye' => 'bye'));

Then to use it, you would use.

echo $lang['af']['reg'];

ps. decepti0n, thanks for the new bbc, and your avatar is not very good. ):

Link to comment
Share on other sites

Re: Game in Different Languages.

Theres no point in using multi-dimensional arrays

and will, you should be able to just loop through it all, if you have descriptive enough titles in the array

foreach ($lang as $key => $val) {
echo $key . ': <input type="text" value="'.$val.'" />';
}

 

well, thats an idea, then they'll have a form to just change everything

Link to comment
Share on other sites

Re: Game in Different Languages.

 

Theres no point in using multi-dimensional arrays

and will, you should be able to just loop through it all, if you have descriptive enough titles in the array

foreach ($lang as $key => $val) {
echo $key . ': <input type="text" value="'.$val.'" />';
}

 

well, thats an idea, then they'll have a form to just change everything

And why is that?

Edit: Oh now I see.. so i'm slow, so what. d:

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...