#ifndef COMPONENTS_L10N_MANAGER_H #define COMPONENTS_L10N_MANAGER_H #include #include namespace VFS { class Manager; } namespace l10n { class Manager { public: Manager(const VFS::Manager* vfs) : mVFS(vfs) { } void dropCache() { mCache.clear(); } void setPreferredLocales(const std::vector& locales); const std::vector& getPreferredLocales() const { return mPreferredLocales; } std::shared_ptr getContext( const std::string& contextName, const std::string& fallbackLocale = "en"); private: void readLangData(const std::string& name, MessageBundles& ctx, const icu::Locale& lang); void updateContext(const std::string& name, MessageBundles& ctx); const VFS::Manager* mVFS; std::vector mPreferredLocales; std::map, std::shared_ptr> mCache; }; } #endif // COMPONENTS_L10N_MANAGER_H