开发者

Multi language solution in Perl/Catalyst-based server

开发者 https://www.devze.com 2023-02-27 01:02 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消