MCPcopy Create free account
hub / github.com/OpenVicProject/OpenVic / load_localisation_dir

Method load_localisation_dir

extension/src/LoadLocalisation.cpp:97–112  ·  view source on GitHub ↗

REQUIREMENTS * FS-23 */

Source from the content-addressed store, hash-verified

95 * FS-23
96 */
97Error LoadLocalisation::load_localisation_dir(String const& dir_path) {
98 if(!DirAccess::dir_exists_absolute(dir_path)) {
99 UtilityFunctions::push_error("Localisation directory does not exist: ", dir_path);
100 return FAILED;
101 }
102 TranslationServer* server = TranslationServer::get_singleton();
103 Error err = OK;
104 for (String const& locale_name : DirAccess::get_directories_at(dir_path)) {
105 if (locale_name != server->standardize_locale(locale_name))
106 UtilityFunctions::push_error("Invalid locale directory name: ", locale_name);
107 else if (load_locale_dir(dir_path.path_join(locale_name), locale_name) == OK)
108 continue;
109 err = FAILED;
110 }
111 return err;
112}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected