Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.