code: public static LocalizedMessages getInstance(Locale locale)
    {
      LocalizedMessages instance = null;
  
      if (locale == null)
      {
        locale = Locale.getDefault();
      }
  
      String localeKey = locale.getLanguage();
      if (localizedMessages.containsKey(localeKey))
      {
        instance = localizedMessages.get(localeKey);
      } 
      else
      {
        synchronized (LocalizedMessages.class)
        {
          if (instance == null)
          {
            instance = new LocalizedMessages(locale);
            localizedMessages.put(localeKey, instance);
          }
        }
      }
  
      return instance;
    }
docs: Provides messages for the given locale.
  
  @param locale The locale. If null or unsupported, will use the default
  locale instead.
  @return Localized messages.