Наследование: global::java.lang.Object, global::java.lang.Cloneable, global::java.io.Serializable
		private ResourceBundle loadResources(Locale locale) {
			try {
				return ResourceBundle.getBundle(targetPackageClass.getPackage().getName() + "." + shortName, locale);
			} catch (MissingResourceException e) {
				return null;
			}
		}
 public static ResourceBundle getBundle(string baseName, Locale locale)
 {
   if (ResourceBundleWrapper.noCodeBaseClassLoader != null)
     return ResourceBundle.getBundle(baseName, locale, (ClassLoader) ResourceBundleWrapper.noCodeBaseClassLoader);
   else
     return ResourceBundle.getBundle(baseName, locale, ResourceBundleWrapper.__\u003CGetCallerID\u003E());
 }
		private synchronized ResourceBundle getResourceBundle(Locale locale) {
			var result = resourceBundles.get(locale);
			if (result == null) {
				result = loadResources(locale);
				if (result != null) {
					resourceBundles.put(locale, result);
				}
			}
			return result;
		}
		public String getMessage(Locale locale, String key, params Object[] args) {
			var rb = getResourceBundle(locale);
			if (rb != null) {
				try {
					return MessageFormat.format(rb.getString(key), args);
				} catch {
				}
			}
			return key;
		}
Пример #5
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is an <code>Integer</code> return its integer value, otherwise return 0.
		/// </summary>
		public int getInt(object @key, Locale @l)
		{
			return default(int);
		}
Пример #6
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is an <code>Insets</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Insets getInsets(object @key, Locale @l)
		{
			return default(Insets);
		}
Пример #7
0
		/// <summary>
		/// Gets a calendar with the specified time zone and locale.
		/// </summary>
		public static Calendar getInstance(TimeZone zone, Locale aLocale)
		{
			return default(Calendar);
		}
 /**
    * As per {@link #getDescriptionForValidNumber(PhoneNumber, Locale)} but also considers the
    * region of the user. If the phone number is from the same region as the user, only a lower-level
    * description will be returned, if one exists. Otherwise, the phone number's region will be
    * returned, with optionally some more detailed information.
    *
    * <p>For example, for a user from the region "US" (United States), we would show "Mountain View,
    * CA" for a particular number, omitting the United States from the description. For a user from
    * the United Kingdom (region "GB"), for the same number we may show "Mountain View, CA, United
    * States" or even just "United States".
    *
    * <p>This method assumes the validity of the number passed in has already been checked.
    *
    * @param number  the phone number for which we want to get a text description
    * @param languageCode  the language code for which the description should be written
    * @param userRegion  the region code for a given user. This region will be omitted from the
    *     description if the phone number comes from this region. It is a two-letter uppercase ISO
    *     country code as defined by ISO 3166-1.
    * @return  a text description for the given language code for the given phone number, or empty
    *     string if the number passed in is invalid
    */
 public String getDescriptionForValidNumber(PhoneNumber number, Locale languageCode,
                                      String userRegion)
 {
     // If the user region matches the number's region, then we just show the lower-level
     // description, if one exists - if no description exists, we will show the region(country) name
     // for the number.
     String regionCode = phoneUtil.getRegionCodeForNumber(number);
     if (userRegion.equals(regionCode)) {
       return getDescriptionForValidNumber(number, languageCode);
     }
     // Otherwise, we just show the region(country) name for now.
     return getRegionDisplayName(regionCode, languageCode);
     // TODO: Concatenate the lower-level and country-name information in an appropriate
     // way for each language.
 }
Пример #9
0
		/// <summary>
		/// Sets the default locale used to initialize each JComponent's locale
		/// property upon creation.
		/// </summary>
		static public void setDefaultLocale(Locale @l)
		{
		}
Пример #10
0
 public static string getDisplayLanguageForLocaleCode(string code)
 {
     Locale locale = new Locale(code);
     return locale.getDisplayLanguage();
 }
Пример #11
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is boolean, return the boolean value, otherwise return false.
		/// </summary>
		public bool getBoolean(object @key, Locale @l)
		{
			return default(bool);
		}
Пример #12
0
 /// <summary>
 /// Gets the date formatter with the given formatting style for the given locale.
 /// </summary>
 public static DateFormat getDateInstance(int style, Locale aLocale)
 {
     return default(DateFormat);
 }
Пример #13
0
 /// <summary>
 /// Gets the date/time formatter with the given formatting styles for the given locale.
 /// </summary>
 public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale aLocale)
 {
     return default(DateFormat);
 }
Пример #14
0
		/// <summary>
		/// Converts all of the characters in this <code>String</code> to upper
		/// case using the rules of the given <code>Locale</code>.
		/// </summary>
		public string toUpperCase(Locale @locale)
		{
			return default(string);
		}
 /**
    * Returns the customary display name in the given language for the given region.
    */
 private String getRegionDisplayName(String regionCode, Locale language)
 {
     return (regionCode == null || regionCode.equals("ZZ") ||
     regionCode.equals(PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY))
     ? "" : new Locale("", regionCode).getDisplayCountry(language);
 }
 /**
    * Returns the customary display name in the given language for the given territory the phone
    * number is from.
    */
 private String getCountryNameForNumber(PhoneNumber number, Locale language)
 {
     String regionCode = phoneUtil.getRegionCodeForNumber(number);
     return getRegionDisplayName(regionCode, language);
 }
Пример #17
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is a <code>String</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public string getString(object @key, Locale @l)
		{
			return default(string);
		}
Пример #18
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is a <code>Border</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Border getBorder(object @key, Locale @l)
		{
			return default(Border);
		}
Пример #19
0
		/// <summary>
		/// Returns the value for key associated with the given locale.
		/// </summary>
		public object get(object @key, Locale @l)
		{
			return default(object);
		}
Пример #20
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is a <code>Color</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Color getColor(object @key, Locale @l)
		{
			return default(Color);
		}
		/// <summary>
		/// Returns the orientation that is appropriate for the given locale.
		/// </summary>
		public ComponentOrientation getOrientation(Locale @locale)
		{
			return default(ComponentOrientation);
		}
 /**
    * As per {@link #getDescriptionForValidNumber(PhoneNumber, Locale, String)} but
    * explicitly checks the validity of the number passed in.
    *
    * @param number  the phone number for which we want to get a text description
    * @param languageCode  the language code for which the description should be written
    * @param userRegion  the region code for a given user. This region will be omitted from the
    *     description if the phone number comes from this region. It is a two-letter uppercase ISO
    *     country code as defined by ISO 3166-1.
    * @return  a text description for the given language code for the given phone number, or empty
    *     string if the number passed in is invalid
    */
 public String getDescriptionForNumber(PhoneNumber number, Locale languageCode,
                                 String userRegion)
 {
     PhoneNumberType numberType = phoneUtil.getNumberType(number);
     if (numberType == PhoneNumberType.UNKNOWN) {
       return "";
     } else if (!canBeGeocoded(numberType)) {
       return getCountryNameForNumber(number, languageCode);
     }
     return getDescriptionForValidNumber(number, languageCode, userRegion);
 }
Пример #23
0
 /// <summary>
 /// Sets the locale of this component.
 /// </summary>
 public void setLocale(Locale @l)
 {
 }
Пример #24
0
 /// <summary>
 /// Returns a name of this time zone suitable for presentation to the user in the specified locale.
 /// </summary>
 public string getDisplayName(Locale locale)
 {
     return default(string);
 }
Пример #25
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is a <code>Dimension</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Dimension getDimension(object @key, Locale @l)
		{
			return default(Dimension);
		}
        /**
           * Returns a text description for the given phone number, in the language provided. The
           * description might consist of the name of the country where the phone number is from, or the
           * name of the geographical area the phone number is from if more detailed information is
           * available.
           *
           * <p>This method assumes the validity of the number passed in has already been checked, and that
           * the number is suitable for geocoding. We consider fixed-line and mobile numbers possible
           * candidates for geocoding.
           *
           * @param number  a valid phone number for which we want to get a text description
           * @param languageCode  the language code for which the description should be written
           * @return  a text description for the given language code for the given phone number
           */
        public String getDescriptionForValidNumber(PhoneNumber number, Locale languageCode)
        {
            String langStr = languageCode.getLanguage();
            String scriptStr = "";  // No script is specified
            String regionStr = languageCode.getCountry();

            String areaDescription =
            getAreaDescriptionForNumber(number, langStr, scriptStr, regionStr);
            return (areaDescription.length() > 0)
            ? areaDescription : getCountryNameForNumber(number, languageCode);
        }
Пример #27
0
 /// <summary>
 /// Returns a name of this time zone suitable for presentation to the user in the specified locale.
 /// </summary>
 public string getDisplayName(bool daylight, int style, Locale locale)
 {
     return default(string);
 }
Пример #28
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is a <code>Font</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Font getFont(object @key, Locale @l)
		{
			return default(Font);
		}
Пример #29
0
		/// <summary>
		/// Attempts to select an input method or keyboard layout that
		/// supports the given locale, and returns a value indicating whether such
		/// an input method or keyboard layout has been successfully selected.
		/// </summary>
		public bool selectInputMethod(Locale @locale)
		{
			return default(bool);
		}
Пример #30
0
		/// <summary>
		/// If the value of <code>key</code> for the given <code>Locale</code>
		/// is an <code>Icon</code> return it, otherwise return <code>null</code>.
		/// </summary>
		public Icon getIcon(object @key, Locale @l)
		{
			return default(Icon);
		}