+
+ // Set translations object, but only if the user didn't do so yet.
+ // This is to preserve compatibility with wx-2.8 where wxLocale was
+ // the only API for translations. wxLocale works as a stack, with
+ // latest-created one being the active one:
+ // wxLocale loc_fr(wxLANGUAGE_FRENCH);
+ // // _() returns French
+ // {
+ // wxLocale loc_cs(wxLANGUAGE_CZECH);
+ // // _() returns Czech
+ // }
+ // // _() returns French again
+ wxTranslations *oldTrans = wxTranslations::Get();
+ if ( !oldTrans ||
+ (m_pOldLocale && oldTrans == &m_pOldLocale->m_translations) )
+ {
+ wxTranslations::SetNonOwned(&m_translations);
+ }