Test and fix for single quote escapes in I18n
This commit is contained in:
parent
ad31f71388
commit
684ec915fc
|
@ -125,7 +125,7 @@ public abstract class I18nBase {
|
|||
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
|
||||
message = MessageFormat.format(messages.getString(theMessage).trim(), theMessageArguments);
|
||||
} else {
|
||||
message = messages.getString(theMessage).trim();
|
||||
message = MessageFormat.format(messages.getString(theMessage).trim(), null);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
|
|
|
@ -109,6 +109,20 @@ class I18nBaseTest {
|
|||
assertEquals("Documents oder Messages müssen mindestens einen Eintrag enthalten", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Test double single quotes behaviour.")
|
||||
void testDoubleSingleQuotes() {
|
||||
I18nTestClass testClass = new I18nTestClass();
|
||||
testClass.setLocale(Locale.US);
|
||||
String actualMessageA = testClass.formatMessage(I18nConstants.VALUESET_EXAMPLE_SYSTEM_HINT, "Mazooma");
|
||||
assertEquals("Example System 'Mazooma' specified, so Concepts and Filters can't be checked", actualMessageA);
|
||||
|
||||
String actualMessageB = testClass.formatMessage(I18nConstants.VALUESET_NO_SYSTEM_WARNING);
|
||||
System.out.println(actualMessageB);
|
||||
assertEquals("No System specified, so Concepts and Filters can't be checked", actualMessageB);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@DisplayName("Test German localization file contains no umlauts.")
|
||||
void testThatNoOneHasMessedWithTheGermans() {
|
||||
|
|
Loading…
Reference in New Issue