Re: [Cppcms-users] localization problem
Brought to you by:
artyom-beilis
From: sergey l. <ccp...@gm...> - 2012-03-22 13:12:54
|
I think the main reason why skin's string not translated because of cppcms_tmpl_cc translate skin code to cppcms::locale::translate and locale structures in cppcms::locale not initialized but context().locale function. In controller I use cppcms::application::translate that proper initizalized by context().locale call. So can someone help me how to proper using localization from skin/view? Thanks in advance! On Thu, Mar 22, 2012 at 3:39 PM, sergey lavrov <ccp...@gm...>wrote: > Dear All! > > cppcms: 1.0.0 > os: windows 7 x86_64 > compiler: VS2010 > > I have strange problem with localization in skin and there is no problem > If I call translate from controller. > > In controller I have: > context().locale("ru_RU.UTF-8"); > render("skin", "test", content); > response().out() << "test: "<< translate("test"); > > In locale\ru\LC_MESSAGES\test.po I have: > msgid "" > msgstr "" > "Content-Type: text/plain; charset=utf-8\n" > "Content-Transfer-Encoding: 8bit\n" > msgid "test" > msgstr "ТЕСТ" > > In skin I have: <% gt "test" %> and cppcms_tmpl_cc produce code: > #line 116 "skin.tmpl" > out()<<cppcms::locale::translate("test"); > > I get untranslated skin's string and I get translated controller's string > in browser output. > > Thanks in advance! > > |