Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //< In main project file
- extern "C" int FMXmain()
- {
- try
- {
- Application->Initialize();
- static const UnicodeString sc_localePath =
- IncludeTrailingPathDelimiter(
- System::Ioutils::TPath::GetDocumentsPath()
- );
- EsI18nManager::langFileLoad(
- "ru",
- sc_localePath
- );
- // ...
- // Form header
- class TFrmMain : public TForm
- {
- private:
- class I18nHandler: public EsI18nSubscriberIntf
- {
- public:
- I18nHandler(TFrmMain& owner);
- virtual void onLangChanged(const UnicodeString& lang);
- private:
- TFrmMain& m_owner;
- };
- friend class I18nHandler;
- // ....
- // Form implementation
- //
- TFrmMain::I18nHandler::I18nHandler(TFrmMain& owner):
- EsI18nSubscriberIntf(),
- m_owner(owner)
- {}
- //---------------------------------------------------------------------------
- void TFrmMain::I18nHandler::onLangChanged(const UnicodeString& lang)
- {
- m_owner.m_textUpdatePending = true;
- m_owner.actions_->langCodeSet(lang);
- if( m_owner.Active )
- m_owner.textUpdate();
- }
- //---------------------------------------------------------------------------
- __fastcall TFrmMain::TFrmMain(TComponent* Owner) :
- TForm(Owner),
- m_i18n(*this),
- m_textUpdatePending(true)
- {
- /// ....
- void TFrmMain::textUpdate()
- {
- if( !m_textUpdatePending )
- return;
- m_textUpdatePending = false;
- grpMain_->Text = _("Main");
- itemCalc_->Text = _("Soap Calculator");
- itemCalc_->ItemData->Detail = _("Create your own soap brew...");
- itemRecipes_->Text = _("Recipes");
- itemRecipes_->ItemData->Detail = _("Browse soap recipes...");
- grpExtra_->Text = _("Extras");
- //...
- void __fastcall TFrmMain::FormActivate(TObject *Sender)
- {
- textUpdate();
- // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement