Home | History | Annotate | Download | only in unicode

Lines Matching refs:Locale

41  * \brief C++ API: Locale ID object.
47 * A <code>Locale</code> object represents a specific geographical, political,
48 * or cultural region. An operation that requires a <code>Locale</code> to perform
49 * its task is called <em>locale-sensitive</em> and uses the <code>Locale</code>
51 * is a locale-sensitive operation--the number should be formatted
55 * The Locale class is not suitable for subclassing.
58 * You can create a <code>Locale</code> object using the constructor in
62 * Locale( const char* language,
92 * Because a <code>Locale</code> object is just an identifier for a region,
93 * no validity check is performed when you construct a <code>Locale</code>.
95 * <code>Locale</code> you construct, you must query those resources. For
99 * locale, you get back the best available match, not necessarily
104 * The <code>Locale</code> class provides a number of convenient constants
105 * that you can use to create <code>Locale</code> objects for commonly used
106 * locales. For example, the following refers to a <code>Locale</code> object
110 * Locale::getUS()
115 * Once you've created a <code>Locale</code> you can query it for information about
122 * the <code>getDisplayXXX</code> methods are themselves locale-sensitive
123 * and have two versions: one that uses the default locale and one
124 * that takes a locale as an argument and displays the name or country in
125 * a language appropriate to that locale.
128 * ICU provides a number of classes that perform locale-sensitive
130 * numbers, currency, or percentages in a locale-sensitive manner. Classes
138 * Locale myLocale;
146 * Each of these methods has two variants; one with an explicit locale
147 * and one without; the latter using the default locale.
155 * A <code>Locale</code> is the mechanism for identifying the kind of object
156 * (<code>NumberFormat</code>) that you would like to get. The locale is
161 * Each class that performs locale-sensitive operations allows you
170 * static Locale* getAvailableLocales(int32_t& numLocales)
171 * static UnicodeString& getDisplayName(const Locale& objectLocale,
172 * const Locale& displayLocale,
174 * static UnicodeString& getDisplayName(const Locale& objectLocale,
182 class U_COMMON_API Locale : public UObject {
184 /** Useful constant for the Root locale. @stable ICU 4.4 */
185 static const Locale &U_EXPORT2 getRoot(void);
187 static const Locale &U_EXPORT2 getEnglish(void);
189 static const Locale &U_EXPORT2 getFrench(void);
191 static const Locale &U_EXPORT2 getGerman(void);
193 static const Locale &U_EXPORT2 getItalian(void);
195 static const Locale &U_EXPORT2 getJapanese(void);
197 static const Locale &U_EXPORT2 getKorean(void);
199 static const Locale &U_EXPORT2 getChinese(void);
201 static const Locale &U_EXPORT2 getSimplifiedChinese(void);
203 static const Locale &U_EXPORT2 getTraditionalChinese(void);
206 static const Locale &U_EXPORT2 getFrance(void);
208 static const Locale &U_EXPORT2 getGermany(void);
210 static const Locale &U_EXPORT2 getItaly(void);
212 static const Locale &U_EXPORT2 getJapan(void);
214 static const Locale &U_EXPORT2 getKorea(void);
216 static const Locale &U_EXPORT2 getChina(void);
218 static const Locale &U_EXPORT2 getPRC(void);
220 static const Locale &U_EXPORT2 getTaiwan(void);
222 static const Locale &U_EXPORT2 getUK(void);
224 static const Locale &U_EXPORT2 getUS(void);
226 static const Locale &U_EXPORT2 getCanada(void);
228 static const Locale &U_EXPORT2 getCanadaFrench(void);
232 * Construct a default locale object, a Locale for the default locale ID.
238 Locale();
241 * Construct a locale from language, country, variant.
246 * This parameter can instead be an ICU style C locale (e.g. "en_US"),
249 * the locale is initialized to match the current default locale.
251 * Please note: The Java Locale class does NOT accept the form
252 * 'new Locale("en_US")' but only 'new Locale("en","US")'
264 Locale( const char * language,
270 * Initializes a Locale object from another Locale object.
272 * @param other The Locale object being copied in.
275 Locale(const Locale& other);
282 virtual ~Locale() ;
287 * @param other The Locale object being copied in.
291 Locale& operator=(const Locale& other);
294 * Checks if two locale keys are the same.
296 * @param other The locale key object to be compared with this.
297 * @return True if the two locale keys are the same, false otherwise.
300 UBool operator==(const Locale& other) const;
303 * Checks if two locale keys are not the same.
305 * @param other The locale key object to be compared with this.
306 * @return True if the two locale keys are not the same, false
310 UBool operator!=(const Locale& other) const;
323 Locale *clone() const;
327 * Common methods of getting the current default Locale. Used for the
330 * default locale, you probably want to reload your GUI, so that the change
337 * @return a reference to the Locale object for the default locale ID
341 static const Locale& U_EXPORT2 getDefault(void);
346 * setDefault() only changes ICU's default locale ID, <strong>not</strong>
347 * the default locale ID of the runtime environment.
349 * @param newLocale Locale to set to. If NULL, set to the value obtained
355 static void U_EXPORT2 setDefault(const Locale& newLocale,
360 * Creates a locale which has had minimal canonicalization
363 * the default Locale is used.
364 * @return new locale object
368 static Locale U_EXPORT2 createFromName(const char *name);
371 * Creates a locale from the given string after canonicalizing
373 * @param name the locale ID to create from. Must not be NULL.
374 * @return a new locale object corresponding to the given name
378 static Locale U_EXPORT2 createCanonical(const char* name);
381 * Returns the locale's ISO-639 language code.
388 * Returns the locale's ISO-15924 abbreviation script code.
397 * Returns the locale's ISO-3166 country code.
404 * Returns the locale's variant code.
411 * Returns the programmatic name of the entire locale, with the language,
421 * Returns the programmatic name of the entire locale as getName would return,
431 * Gets the list of keywords for the specified locale.
469 * returns the locale's three-letter language code, as specified
477 * Fills in "name" with the locale's three-letter ISO-3166 country code.
484 * Returns the Windows LCID value corresponding to this locale.
485 * This value is stored in the resource data for the locale as a one-to-four-digit
487 * there is no Windows LCID value that corresponds to this locale, returns 0.
493 * Fills in "dispLang" with the name of this locale's language in a format suitable for
494 * user display in the default locale. For example, if the locale's language code is
495 * "fr" and the default locale's language code is "en", this function would set
504 * Fills in "dispLang" with the name of this locale's language in a format suitable for
505 * user display in the locale specified by "displayLocale". For example, if the locale's
508 * @param displayLocale Specifies the locale to be used to display the name. In other words,
509 * if the locale's language code is "en", passing Locale::getFrench() for
510 * displayLocale would result in "Anglais", while passing Locale::getGerman()
516 UnicodeString& getDisplayLanguage( const Locale& displayLocale,
520 * Fills in "dispScript" with the name of this locale's script in a format suitable
521 * for user display in the default locale. For example, if the locale's script code
522 * is "LATN" and the default locale's language code is "en", this function would set
531 * Fills in "dispScript" with the name of this locale's country in a format suitable
532 * for user display in the locale specified by "displayLocale". For example, if the locale's
535 * @param displayLocale Specifies the locale to be used to display the name. In other
536 * words, if the locale's script code is "LATN", passing
537 * Locale::getFrench() for displayLocale would result in "", while
538 * passing Locale::getGerman() for displayLocale would result in
544 UnicodeString& getDisplayScript( const Locale& displayLocale,
548 * Fills in "dispCountry" with the name of this locale's country in a format suitable
549 * for user display in the default locale. For example, if the locale's country code
550 * is "FR" and the default locale's language code is "en", this function would set
559 * Fills in "dispCountry" with the name of this locale's country in a format suitable
560 * for user display in the locale specified by "displayLocale". For example, if the locale's
563 * @param displayLocale Specifies the locale to be used to display the name. In other
564 * words, if the locale's country code is "US", passing
565 * Locale::getFrench() for displayLocale would result in "&Eacute;tats-Unis", while
566 * passing Locale::getGerman() for displayLocale would result in
572 UnicodeString& getDisplayCountry( const Locale& displayLocale,
576 * Fills in "dispVar" with the name of this locale's variant code in a format suitable
577 * for user display in the default locale.
585 * Fills in "dispVar" with the name of this locale's variant code in a format
586 * suitable for user display in the locale specified by "displayLocale".
587 * @param displayLocale Specifies the locale to be used to display the name.
592 UnicodeString& getDisplayVariant( const Locale& displayLocale,
596 * Fills in "name" with the name of this locale in a format suitable for user display
597 * in the default locale. This function uses getDisplayLanguage(), getDisplayCountry(),
599 * "language (country[,variant])". For example, if the default locale is en_US, then
602 * @param name Receives the locale's display name.
609 * Fills in "name" with the name of this locale in a format suitable for user display
610 * in the locale specfied by "displayLocale". This function uses getDisplayLanguage(),
615 * @param displayLocale Specifies the locale to be used to display the name.
616 * @param name Receives the locale's display name.
620 UnicodeString& getDisplayName( const Locale& displayLocale,
624 * Generates a hash code for the locale.
630 * Sets the locale to bogus
631 * A bogus locale represents a non-existing locale associated
632 * with services that can be instantiated from non-locale data
633 * in addition to locale (for example, collation can be
634 * instantiated from a locale and from a rule set).
640 * Gets the bogus state. Locale object can be bogus if it doesn't exist
641 * @return FALSE if it is a real locale, TRUE if it is a bogus locale
649 * @return A pointer to an array of Locale objects. This array is the list
654 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
693 * Set this from a single POSIX style locale string.
701 * Initialize the locale object with a new name.
704 * @param cLocaleID The new locale name.
707 Locale& init(const char* cLocaleID, UBool canonicalize);
710 * Internal constructor to allow construction of a locale object with
712 * the default locale.)
717 Locale(ELocaleType);
720 * Initialize the locale cache for commonly used locales
722 static Locale *getLocaleCache(void);
736 static const Locale &getLocale(int locid);
739 * A friend to allow the default locale to be set by either the C or C++ API.
742 friend Locale *locale_set_default_internal(const char *, UErrorCode& status);
746 Locale::operator!=(const Locale& other) const
752 Locale::getCountry() const
758 Locale::getLanguage() const
764 Locale::getScript() const
770 Locale::getVariant() const
777 Locale::getName() const
783 Locale::isBogus(void) const {