Question

Here's the use case:

I'm building a site which will serve various global markets and run off more than one platform. Site already supports language files. Once locale is determined appropriate language file is served. All text is in the interface is served via language files.

For things link country / state-province I've used javascript in the past to swap out the options, but I'm looking for a solution that's handled on the server, without any client interaction (so the solution must work without javascript).

Does anyone have any recommendations on implementation be practice? Should I be storing countries / states / locales in the database? Should I require users to submit the signup form with only country selected, and based on the country selection show states + locales relevant to that country?

I am looking for a solution here that adheres to principles of progressive enhancement. I will improve whatever route I take with javascript later, but for now I need something that works without any client-side scripting. Thanks!

Was it helpful?

Solution

Most of what you are saying depends specifically on the end users and your clients needs.

My suggestion (which will probably be arguable), would be to have the user select their location when registering on the site (but allow them to modify it at any time later of course), and based on that selection, as you stated, populate all of the corresponding datas to that locale.

And as far as the localization of languages, that can be stored in tables or using php CONSTANTs or an xml file or any other method you are comfortable with.

Not sure if this was at all helpful, but hope it was worth something : )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top