|(require koyo/l10n)||package: koyo-lib|
This module provides a middleware and facilities for localizing messages.
The directory must have one subdirectory per language and each language subdirectory must contain one translation file per region.
For example, for English, one might define the following structure:
Each translation file must contain a list of pairs where the first element is a symbol and the second is the translation format string for that symbol. For example:
((title . "Bogdan's Blog") (subtitle . "Just another one of these things") (hello . "Hi, ~a!"))
If there is no translation named message-name then message-name is converted to a string and the args are ignored.
((wrap-browser-locale sessions) handler)
→ (-> request? can-be-response?) sessions : session-manager? handler : (-> request? can-be-response?)
If 'l10n.lang is present in the current user’s session then that value takes precedence over the value of the Accept-Language header.