[erlang-questions] Best Practices: Localization of Erlang Applications. Also, Error Messages!

Alex Arnon alex.arnon@REDACTED
Thu Jul 14 12:58:19 CEST 2011

On Thu, Jul 14, 2011 at 2:53 AM, Steve Davis <steven.charles.davis@REDACTED
> wrote:

> Given that "strings" are either ambiguous or implicitly constrained
> inventions of data representation, then you may consider applying
> something along the lines of:
> -record(text, {value, charset = utf8, locale = 'us-en'}).
This is similar to what we had in mind, for localized parts of a more
generic text structure (similar to iolists, but with records such as the
above supported as well).
Arguments might also be added as part of #text{}.
This covers the "bit up to rendering" - everything would be rendered to
UTF-8 binaries eventually for public consumption.

... snip ...

BTW This problem isn't really an erlang/otp but one that every
> platform that I have ever investigated. What makes erlang different is
> that you can easily forsee a potential, and implementable, solution to
> this legacy issue in CS.
Yes, this is indeed a universal "problem". I have seen several solutions in
other environments, usually using either a global string definitions file
(macros/constants/hashes, or a simple flat data file) or a database (usually
in larger systems).
For our application we think a file containing all the definitions could be
used, since the size of the message set will not be in the many-hundreds.
Would you suggest that this be a properties/XML/whatever data file, or a
module containing a translation function (or more)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110714/062ea57f/attachment.htm>

More information about the erlang-questions mailing list