mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-19 09:54:49 -04:00
add a special function to let tests fail, if there are missing language keys.
This commit is contained in:
parent
9be14b0103
commit
2cbde58381
@ -89,6 +89,13 @@ public final class Lang {
|
||||
return str;
|
||||
else {
|
||||
System.out.println("<string name=\"" + key + "\">" + key.substring(key.indexOf("_") + 1) + "</string>");
|
||||
|
||||
// If there is a missing language key and we are in testing mode which is the case
|
||||
// if the 'testdata' system property is set, let the test fail!
|
||||
// If we are in production usage, don't let the program crash, simply return the key itself instead!
|
||||
if (System.getProperty("testdata") != null)
|
||||
throw new Error("missing laguage key '" + key + "'");
|
||||
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user