Changeset 10480 for code/branches/core7/src/libraries/core/Language.cc
- Timestamp:
- May 25, 2015, 9:01:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Language.cc
r10479 r10480 37 37 #include "util/Output.h" 38 38 #include "util/StringUtils.h" 39 #include "Core.h"40 39 #include "PathConfig.h" 41 40 … … 247 246 /** 248 247 @brief Reads the language file of the configured language and assigns the localisation to the corresponding LanguageEntry object. 249 */ 250 void Language::readTranslatedLanguageFile() 251 { 252 orxout(internal_info, context::language) << "Read translated language file (" << Core::getInstance().getConfig()->getLanguage() << ")." << endl; 253 254 const std::string& filepath = PathConfig::getConfigPathString() + getFilename(Core::getInstance().getConfig()->getLanguage()); 248 @return Returns false if the language file couldn't be found. 249 */ 250 bool Language::readTranslatedLanguageFile(const std::string& language) 251 { 252 orxout(internal_info, context::language) << "Read translated language file (" << language << ")." << endl; 253 254 const std::string& filepath = PathConfig::getConfigPathString() + getFilename(language); 255 255 256 256 // Open the file … … 261 261 { 262 262 orxout(internal_error, context::language) << "An error occurred in Language.cc:" << endl; 263 orxout(internal_error, context::language) << "Couldn't open file " << getFilename(Core::getInstance().getConfig()->getLanguage()) << " to read the translated language entries!" << endl; 264 Core::getInstance().getConfig()->resetLanguage(); 265 orxout(internal_info, context::language) << "Reset language to " << this->defaultLanguage_ << '.' << endl; 266 return; 263 orxout(internal_error, context::language) << "Couldn't open file " << getFilename(language) << " to read the translated language entries!" << endl; 264 return false; 267 265 } 268 266 … … 291 289 else 292 290 { 293 orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename( Core::getInstance().getConfig()->getLanguage()) << endl;291 orxout(internal_warning, context::language) << "Invalid language entry \"" << lineString << "\" in " << getFilename(language) << endl; 294 292 } 295 293 } … … 297 295 298 296 file.close(); 297 return true; 299 298 } 300 299
Note: See TracChangeset
for help on using the changeset viewer.