Many tools don't function at all if the debug language is set. This is described on the how to translate Sakai page:
This is because these strings are passed from the ResourceLoader directly into another method (like SimpleDateFormat) and the TimeService breaks if it doesn't get a "time" value.
and was a feature I used often in the past (~2.7 and 2.8). I know that
SAM-1522 specifically is breaking Samigo now.
- Add to sakai.properties
- Switch to "English Debug Locale" in your preferences.
I feel it's important to preserve this debug locale but how to best fix this regression?
ResourceLoader returns this as the first thing in all cases
public String getString(String key)
if ( getLocale().toString().equals(DEBUG_LOCALE) )
1) Make a special prefix for the key like "nodebug_KEY" or "simpledate_KEY" and have getString/getStrings check for this prefix? If the prefix matches always pass the value instead of the key. This would require fixing all of the code that is using this date but should be relatively easy.
2) Make all of the code that calls SimpleDateFormat call some wrapper instead. (Like maybe in BasicTimeService) If it can't parse the string, return one of the default strings that's present there. It seems like they should be all catching and handling ParseExceptions though?
3) Do a regex test on the value looking for date patterns?
4) ??? Remove debug as an option because it breaks most tools?
Any suggestions? This feels like a new regression for 2.9