Closed Frozenlock closed 10 years ago
Hey there,
If you're using the Ring middleware, you'll have some additional info in your Ring requests like a :locale
and :t
translation fn.
Note that the :locale
isn't necessarily the language your users will end up seeing since that's dependant on what translations you actually have available in your dictionary. So a useful trick here may be to use the t
translation fn while generating your HTML templates. Something like:
(str "<html lang=\"" (t :html-lang) "\">) ; => <html lang="en">, etc.
Then just make sure your dictionary has the necessary :html-lang
keys. Does that make sense?
Ah yes!
I was worried about using the :locale
from the request exactly because the user might just get a fallback language, but the :html-lang
might just do it!
One should usually let the browser know what is the language of the document. (see http://nimbupani.com/declaring-languages-in-html-5.html)
How is that usually done with Tower?