[web-devel] Happstack internationalization and localization
Michael Snoyman
michael at snoyman.com
Wed Dec 14 07:32:47 CET 2011
OK, the new package is on Github, under the hamlet repo:
https://github.com/yesodweb/hamlet/tree/master/shakespeare-i18n
Jeremy: Can you review the code and let me know if anything needs to
change before it can be used by Happstack?
Thanks,
Michael
On Mon, Dec 12, 2011 at 11:58 AM, Michael Snoyman <michael at snoyman.com> wrote:
> I personally hate the thought of typing Shakespeare so often, but in
> this case you're right that it will be mostly under-the-hood. I'm fine
> either way.
>
> On Mon, Dec 12, 2011 at 11:54 AM, Greg Weber <greg at gregweber.info> wrote:
>> I would much prefer something like Text.Shakespeare.I18n and
>> shakespeare-i18n or shakespeare-translate over requiring an extra mental
>> translation step to understand the name. Especially since this is under the
>> hood, there is no reason to try to give it a themed name.
>>
>>
>> On Mon, Dec 12, 2011 at 5:01 AM, Michael Snoyman <michael at snoyman.com>
>> wrote:
>>>
>>> On Sat, Dec 10, 2011 at 9:56 PM, Michael Snoyman <michael at snoyman.com>
>>> wrote:
>>> > On Sat, Dec 10, 2011 at 8:31 PM, Jeremy Shaw <jeremy at n-heptane.com>
>>> > wrote:
>>> >> On Sat, Dec 10, 2011 at 4:18 AM, Greg Weber <greg at gregweber.info>
>>> >> wrote:
>>> >>
>>> >>> Yesod guesses the user's locale from the request headers and allows it
>>> >>> to be
>>> >>> overridden - this could easily be ported to Happstack.
>>> >>
>>> >> Right. That sounds useful and easy to do.
>>> >>
>>> >>> Yesod also directly
>>> >>> supports putting i18n into Hamlet templates, which I think can also be
>>> >>> done
>>> >>> in Happstack. Yesod also provides a translator friendly veneer over
>>> >>> Haskell
>>> >>> data types- I think this could also be ported to different settings
>>> >>> like
>>> >>> Happstack.
>>> >>
>>> >> We already have Hamlet support in Happstack. But, it seems like that
>>> >> is not enough? We also need some stuff that is in Yesod.Message, etc?
>>> >>
>>> >> In my ignorance, it seems like there are three pieces:
>>> >>
>>> >> 1. a little bit of framework/application specific code that
>>> >> detects/sets the language to use
>>> >>
>>> >> 2. a bunch of framework independent code that deals with mapping
>>> >> data-types to translated strings
>>> >>
>>> >> 3. some glue code that makes it easy to use #2 with a particular
>>> >> templating library
>>> >>
>>> >> But, right now it seems that #2 is wrapped up in the yesod hierarchy
>>> >> even though it would be useful for any Haskell program that wants
>>> >> i18n? Or am I missing something?
>>> >
>>> > Looks like you hit everything. You're correct, (2) is currently
>>> > included in the yesod-core package, but could easily be moved out to a
>>> > common, shared package. Any ideas on package/module name?
>>> >
>>> > Michael
>>>
>>> OK, it's a Shakespeare-like system, and it's for translations.
>>>
>>> Any objections to titus (and Text.Titus)?
>>>
>>> Michael
>>
>>
More information about the web-devel
mailing list