void TranslationServer::load_translations() { String locale = get_locale(); bool found = _load_translations("locale/translations"); //all if (_load_translations("locale/translations_" + locale.substr(0, 2))) found = true; if (locale.substr(0, 2) != locale) { if (_load_translations("locale/translations_" + locale)) found = true; } }
void TranslationServer::load_translations() { String locale = get_locale(); bool found = _load_translations("locale/translations"); //all if (_load_translations("locale/translations_"+locale.substr(0,2))) found=true; if ( locale.substr(0,2) != locale ) { if (_load_translations("locale/translations_"+locale)) found=true; } if (!found && fallback!="") { //none found anywhere, use fallback _load_translations("locale/translations_"+fallback.substr(0,2)); if ( fallback.substr(0,2) != fallback ) { _load_translations("locale/translations_"+fallback); } this->locale=fallback; } }