REQUIREMENTS * FS-23 */
| 95 | * FS-23 |
| 96 | */ |
| 97 | Error 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected