Jump to content

Languages...


Aureole

Recommended Posts

I'm thinking of making a Language type thing where a file would have like...

 

Welcome => "Welcome to my Website!";

 

Then instead of having text hard-coded I could get the thing from the language file so then I could make my Website more accessible to other languages...

 

...but I have no idea where to start, anyone got any pointers?

Link to comment
https://forums.phpfreaks.com/topic/64831-languages/
Share on other sites

Yeah I'm just thinking how to do it like I can easily make a row for lang in the user table but how do I get it to load the right lang file depending on their choice and how would I go about echoing a piece of language from the array. I tried searching Google but people here are more helpful than a Search Engine. :P

Link to comment
https://forums.phpfreaks.com/topic/64831-languages/#findComment-323496
Share on other sites

step one:

setup a php file with the array for english.

 

include that file and use something like str_replace to replace the text ie

"{greeting}" => "Hello"

 

once you have the site working in english you can change the php to connect to a database (if you want)

 

 

Link to comment
https://forums.phpfreaks.com/topic/64831-languages/#findComment-324505
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.