Multi language solution in Perl/Catalyst-based server
I'm building a website using perl/catalyst and I'm bothered with multi-language problem.
I'm supposed to put the strings in a file other than perl code file(.pl .pm), and it should stay within the memory throughout the lifetime of the server.
At first I try to put it into $c->config during setup of catalyst, so I used standard perl-style file-IO open LANG, "<file"
but I found out that after start up what's actually in the config is pack(H*, ...)
. I don't know what happene开发者_C百科d to my string.
Some more information: All file discussed above was utf-8 encoded.
Could anyone help me or give another better solution to multi-language problem?
Use the industry standard GNU gettext. It's supported by CatalystX::I18N.
精彩评论