Is there a specific way of offering sites in different languages, or does everyone just develop there own method of doing it?
I need to offer my site in a couple of different languages and hoped there was a more efficient way that just storing ALL the text in a database and extracting the correct one depending on language settings.
A common way of doing it is to create different language files. Each file would be a series of defines of the same phrases in different languages. Depending on user preferences you would require_once the appropriate language file.
Then you'd just use the defines throughout the script. Like ID_WELCOME_GREETING, which would be defined in each language file as however that message should be translated.
I do this in my projects which are only meant for one language, as well. This allows the non technical people involved in my project to change the phrasing that I've selected.
Bookmarks