X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=lib%2Fapp%2Ftinygettext.cpp;h=91c29b72093603ce1ffdd5b3d4b88b6cd1842714;hb=133d94d5b145f325c38c8c15c9ea561bfffb092d;hp=abaa48a11b3a0adf5570439bc752365688515fba;hpb=17dbb2bd444a744fa435b32cbb20b2ad42c44ed1;p=supertux.git diff --git a/lib/app/tinygettext.cpp b/lib/app/tinygettext.cpp index abaa48a11..91c29b720 100644 --- a/lib/app/tinygettext.cpp +++ b/lib/app/tinygettext.cpp @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include #include #include @@ -237,6 +238,8 @@ DictionaryManager::get_dictionary(const std::string& spec) Dictionary& dict = dictionaries[lang]; dict.set_language(get_language_def(lang)); + if(charset != "") + dict.set_charset(charset); for (SearchPath::iterator p = search_path.begin(); p != search_path.end(); ++p) { @@ -309,6 +312,14 @@ DictionaryManager::set_language(const std::string& lang) } void +DictionaryManager::set_charset(const std::string& charset) +{ + dictionaries.clear(); // changing charset invalidates cache + this->charset = charset; + set_language(language); +} + +void DictionaryManager::set_language_alias(const std::string& alias, const std::string& language) { @@ -334,9 +345,8 @@ DictionaryManager::get_language_from_spec(const std::string& spec) void DictionaryManager::add_directory(const std::string& pathname) { + dictionaries.clear(); // adding directories invalidates cache search_path.push_back(pathname); - // cache is outdated now - dictionaries.clear(); set_language(language); }