Skip to content
Snippets Groups Projects
Commit 039581d0 authored by srosse's avatar srosse
Browse files

FXOLAT-321: prevent red screen in admin controller if no i18n keys are found...

FXOLAT-321: prevent red screen in admin controller if no i18n keys are found for a language, fix the olat.properties for i18n source
parent 4208dd21
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
package org.olat.core.util.i18n.ui; package org.olat.core.util.i18n.ui;
import java.io.File;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
...@@ -121,7 +120,11 @@ class I18nConfigController extends FormBasicController { ...@@ -121,7 +120,11 @@ class I18nConfigController extends FormBasicController {
if (explLang != null && !explLang.equals(key)) all += " (" + key + ")"; if (explLang != null && !explLang.equals(key)) all += " (" + key + ")";
// count translation status // count translation status
int keyCount = i18nMgr.countI18nItems(i18nMgr.getLocaleOrNull(key), null, true); int keyCount = i18nMgr.countI18nItems(i18nMgr.getLocaleOrNull(key), null, true);
all += " <span class='b_translation_status'>" + (keyCount * 100 / referenceKeyCount) + "%</span>"; if(keyCount > 0) {
all += " <span class='b_translation_status'>" + (keyCount * 100 / referenceKeyCount) + "%</span>";
} else {
all += " <span class='b_translation_status'>0%</span>";
}
availableValues[i] = all; availableValues[i] = all;
} }
ArrayHelper.sort(availablelangKeys, availableValues, false, true, false); ArrayHelper.sort(availablelangKeys, availableValues, false, true, false);
......
...@@ -354,7 +354,7 @@ course.display.participants.count=true ...@@ -354,7 +354,7 @@ course.display.participants.count=true
is.translation.server=disabled is.translation.server=disabled
# Path to the CVS "olat3" project that contains the languages DE and EN # Path to the CVS "olat3" project that contains the languages DE and EN
# During development this is normally /workspace/olat/src/main/java # During development this is normally /workspace/olat/src/main/java
i18n.application.src.dir =${project.build.home.directory} i18n.application.src.dir=
# Path to any directory that contains # Path to any directory that contains
# translatable packages other than DE and EN which are in the application source directory # translatable packages other than DE and EN which are in the application source directory
# During development this is normally ${i18n.application.src.dir} # During development this is normally ${i18n.application.src.dir}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment