Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
remove warning if translation incomplete or unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-gui committed Feb 3, 2016
1 parent 9efbeee commit 2cf202e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/org/w3c/unicorn/action/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public ULocale getLanguage(String langParameter, HttpServletRequest req, ArrayLi
parameterLocale = Language.getAvailableLocale(langParameter);
matchedLocale = Language.getUILocale(langParameter);
if (messages != null && parameterLocale != matchedLocale) {
messages.add(new Message(Message.INFO, "$message_unavailable_requested_language", null, parameterLocale.getDisplayName(parameterLocale), "?" + Property.get("UNICORN_PARAMETER_PREFIX") + "lang=" + parameterLocale.getName()));
if ("true".equals(Property.get("ENABLE_TRANSLATION_CONTRIBS"))) {
messages.add(new Message(Message.INFO, "$message_unavailable_requested_language", null, parameterLocale.getDisplayName(parameterLocale), "?" + Property.get("UNICORN_PARAMETER_PREFIX") + "lang=" + parameterLocale.getName()));
}
return matchedLocale;
}
} else {
Expand All @@ -82,14 +84,16 @@ public ULocale getLanguage(String langParameter, HttpServletRequest req, ArrayLi
}

if (messages != null && browserLocale != matchedLocale) {
messages.add(new Message(Message.INFO, "$message_unavailable_language", null, browserLocale.getDisplayName(browserLocale), "?" + Property.get("UNICORN_PARAMETER_PREFIX") + "lang=" + browserLocale.getName()));
return matchedLocale;
if ("true".equals(Property.get("ENABLE_TRANSLATION_CONTRIBS"))) {
messages.add(new Message(Message.INFO, "$message_unavailable_language", null, browserLocale.getDisplayName(browserLocale), "?" + Property.get("UNICORN_PARAMETER_PREFIX") + "lang=" + browserLocale.getName()));
}
return matchedLocale;
}
}

if (messages != null && !Language.isComplete(matchedLocale))
if ("true".equals(Property.get("ENABLE_TRANSLATION_CONTRIBS")) && messages != null && !Language.isComplete(matchedLocale)) {
messages.add(new Message(Message.INFO, "$message_incomplete_language", null, "", "?" + Property.get("UNICORN_PARAMETER_PREFIX") + "lang=" + matchedLocale.getName()));

}
return matchedLocale;
}

Expand Down

0 comments on commit 2cf202e

Please sign in to comment.