/** * @param locale The locale for which to return the problem. * @return The problem encountered while localizing this internationalization object to the supplied locale, or * <code>null</code> if none was encountered. */ public String problem( Locale locale ) { if (locale == null) { locale = Locale.getDefault(); } localize(i18nClass, locale); // Check for field/property error String problem = localeToProblemMap.get(locale); if (problem != null) { return problem; } // Check if text exists if (localeToTextMap.get(locale) != null) { // If so, no problem exists return null; } // If we get here, which will be at most once, there was at least one global localization error, so just return a message // indicating to look them up. problem = CommonI18n.i18nLocalizationProblems.text(i18nClass, locale); localeToProblemMap.put(locale, problem); return problem; }
private String rawText( Locale locale ) { assert locale != null; localize(i18nClass, locale); // Check if text exists String text = localeToTextMap.get(locale); if (text != null) { return text; } // If not, there was a problem, so throw it within an exception so upstream callers can tell the difference between normal // text and problem text. throw new SystemFailureException(problem(locale)); }
private String rawText( Locale locale ) { assert locale != null; localize(i18nClass, locale); // Check if text exists String text = localeToTextMap.get(locale); if (text != null) { return text; } // If not, there was a problem, so throw it within an exception so upstream callers can tell the difference between normal // text and problem text. throw new SystemFailureException(problem(locale)); }
private String rawText( Locale locale ) { assert locale != null; localize(i18nClass, locale); // Check if text exists String text = localeToTextMap.get(locale); if (text != null) { return text; } // If not, there was a problem, so throw it within an exception so upstream callers can tell the difference between normal // text and problem text. throw new SystemFailureException(problem(locale)); }
/** * @param locale The locale for which to return the problem. * @return The problem encountered while localizing this internationalization object to the supplied locale, or * <code>null</code> if none was encountered. */ public String problem( Locale locale ) { if (locale == null) { locale = Locale.getDefault(); } localize(i18nClass, locale); // Check for field/property error String problem = localeToProblemMap.get(locale); if (problem != null) { return problem; } // Check if text exists if (localeToTextMap.get(locale) != null) { // If so, no problem exists return null; } // If we get here, which will be at most once, there was at least one global localization error, so just return a message // indicating to look them up. problem = CommonI18n.i18nLocalizationProblems.text(i18nClass, locale); localeToProblemMap.put(locale, problem); return problem; }
/** * @param locale The locale for which to return the problem. * @return The problem encountered while localizing this internationalization object to the supplied locale, or * <code>null</code> if none was encountered. */ public String problem( Locale locale ) { if (locale == null) { locale = Locale.getDefault(); } localize(i18nClass, locale); // Check for field/property error String problem = localeToProblemMap.get(locale); if (problem != null) { return problem; } // Check if text exists if (localeToTextMap.get(locale) != null) { // If so, no problem exists return null; } // If we get here, which will be at most once, there was at least one global localization error, so just return a message // indicating to look them up. problem = CommonI18n.i18nLocalizationProblems.text(i18nClass, locale); localeToProblemMap.put(locale, problem); return problem; }