Summary of the problem: a user's browser presents a locale which site translations are not available for, and a more appropriate locale than the default is available without their specific e.g. dialect. In other words, if a user comes with locale set to es_ES and we only have es_MX and es, es should be served instead of the default locale.
I was wondering what the best way to implement this would be. I was thinking that it could be if the ajax fails, put some logic in to try the file name with the underscore and everything after removed, but I was also thinking about how to then name that locale appropriately within the messageResource.js API.
[ more context: http://stackoverflow.com/questions/5047298/detecting-browser-locales-languages-and-generating-output ]
Summary of the problem: a user's browser presents a locale which site translations are not available for, and a more appropriate locale than the default is available without their specific e.g. dialect. In other words, if a user comes with locale set to
es_ES
and we only havees_MX
andes
,es
should be served instead of the default locale.I was wondering what the best way to implement this would be. I was thinking that it could be if the ajax fails, put some logic in to try the file name with the underscore and everything after removed, but I was also thinking about how to then name that locale appropriately within the messageResource.js API.