}
if (search == null || dao == null) {
return getDefaultLanguage();
}
Sysprop s = dao.read(appid, keyPrefix.concat(langCode));
TreeMap<String, String> lang = new TreeMap<String, String>();
if (s == null || s.getProperties().isEmpty()) {
Map<String, Object> terms = new HashMap<String, Object>();
terms.put("locale", langCode);
terms.put("approved", true);
List<Translation> tlist = search.findTerms(appid, Utils.type(Translation.class), terms, true);
Sysprop saved = new Sysprop(keyPrefix.concat(langCode));
lang.putAll(getDefaultLanguage()); // copy default langmap
int approved = 0;
for (Translation trans : tlist) {
lang.put(trans.getThekey(), trans.getValue());
saved.addProperty(trans.getThekey(), trans.getValue());
approved++;
}
if (approved > 0) {
updateTranslationProgressMap(appid, langCode, approved);
}