Home | History | Annotate | Download | only in unicode

Lines Matching defs:Locale

41  * \brief C++ API: Locale ID object.
53 * A <code>Locale</code> object represents a specific geographical, political,
54 * or cultural region. An operation that requires a <code>Locale</code> to perform
55 * its task is called <em>locale-sensitive</em> and uses the <code>Locale</code>
57 * is a locale-sensitive operation--the number should be formatted
61 * The Locale class is not suitable for subclassing.
64 * You can create a <code>Locale</code> object using the constructor in
68 * Locale( const char* language,
98 * Because a <code>Locale</code> object is just an identifier for a region,
99 * no validity check is performed when you construct a <code>Locale</code>.
101 * <code>Locale</code> you construct, you must query those resources. For
105 * locale, you get back the best available match, not necessarily
110 * The <code>Locale</code> class provides a number of convenient constants
111 * that you can use to create <code>Locale</code> objects for commonly used
112 * locales. For example, the following refers to a <code>Locale</code> object
116 * Locale::getUS()
121 * Once you've created a <code>Locale</code> you can query it for information about
128 * the <code>getDisplayXXX</code> methods are themselves locale-sensitive
129 * and have two versions: one that uses the default locale and one
130 * that takes a locale as an argument and displays the name or country in
131 * a language appropriate to that locale.
134 * ICU provides a number of classes that perform locale-sensitive
136 * numbers, currency, or percentages in a locale-sensitive manner. Classes
144 * Locale myLocale;
152 * Each of these methods has two variants; one with an explicit locale
153 * and one without; the latter using the default locale.
161 * A <code>Locale</code> is the mechanism for identifying the kind of object
162 * (<code>NumberFormat</code>) that you would like to get. The locale is
167 * Each class that performs locale-sensitive operations allows you
176 * static Locale* getAvailableLocales(int32_t& numLocales)
177 * static UnicodeString& getDisplayName(const Locale& objectLocale,
178 * const Locale& displayLocale,
180 * static UnicodeString& getDisplayName(const Locale& objectLocale,
188 class U_COMMON_API Locale : public UObject {
190 /** Useful constant for the Root locale. @stable ICU 4.4 */
191 static const Locale &U_EXPORT2 getRoot(void);
193 static const Locale &U_EXPORT2 getEnglish(void);
195 static const Locale &U_EXPORT2 getFrench(void);
197 static const Locale &U_EXPORT2 getGerman(void);
199 static const Locale &U_EXPORT2 getItalian(void);
201 static const Locale &U_EXPORT2 getJapanese(void);
203 static const Locale &U_EXPORT2 getKorean(void);
205 static const Locale &U_EXPORT2 getChinese(void);
207 static const Locale &U_EXPORT2 getSimplifiedChinese(void);
209 static const Locale &U_EXPORT2 getTraditionalChinese(void);
212 static const Locale &U_EXPORT2 getFrance(void);
214 static const Locale &U_EXPORT2 getGermany(void);
216 static const Locale &U_EXPORT2 getItaly(void);
218 static const Locale &U_EXPORT2 getJapan(void);
220 static const Locale &U_EXPORT2 getKorea(void);
222 static const Locale &U_EXPORT2 getChina(void);
224 static const Locale &U_EXPORT2 getPRC(void);
226 static const Locale &U_EXPORT2 getTaiwan(void);
228 static const Locale &U_EXPORT2 getUK(void);
230 static const Locale &U_EXPORT2 getUS(void);
232 static const Locale &U_EXPORT2 getCanada(void);
234 static const Locale &U_EXPORT2 getCanadaFrench(void);
238 * Construct a default locale object, a Locale for the default locale ID.
244 Locale();
247 * Construct a locale from language, country, variant.
252 * This parameter can instead be an ICU style C locale (e.g. "en_US"),
255 * the locale is initialized to match the current default locale.
257 * Please note: The Java Locale class does NOT accept the form
258 * 'new Locale("en_US")' but only 'new Locale("en","US")'
270 Locale( const char * language,
276 * Initializes a Locale object from another Locale object.
278 * @param other The Locale object being copied in.
281 Locale(const Locale& other);
288 virtual ~Locale() ;
293 * @param other The Locale object being copied in.
297 Locale& operator=(const Locale& other);
300 * Checks if two locale keys are the same.
302 * @param other The locale key object to be compared with this.
303 * @return True if the two locale keys are the same, false otherwise.
306 UBool operator==(const Locale& other) const;
309 * Checks if two locale keys are not the same.
311 * @param other The locale key object to be compared with this.
312 * @return True if the two locale keys are not the same, false
316 UBool operator!=(const Locale& other) const;
329 Locale *clone() const;
333 * Common methods of getting the current default Locale. Used for the
336 * default locale, you probably want to reload your GUI, so that the change
343 * @return a reference to the Locale object for the default locale ID
347 static const Locale& U_EXPORT2 getDefault(void);
352 * setDefault() only changes ICU's default locale ID, <strong>not</strong>
353 * the default locale ID of the runtime environment.
355 * @param newLocale Locale to set to. If NULL, set to the value obtained
361 static void U_EXPORT2 setDefault(const Locale& newLocale,
366 * Creates a locale which has had minimal canonicalization
369 * the default Locale is used.
370 * @return new locale object
374 static Locale U_EXPORT2 createFromName(const char *name);
377 * Creates a locale from the given string after canonicalizing
379 * @param name the locale ID to create from. Must not be NULL.
380 * @return a new locale object corresponding to the given name
384 static Locale U_EXPORT2 createCanonical(const char* name);
387 * Returns the locale's ISO-639 language code.
394 * Returns the locale's ISO-15924 abbreviation script code.
403 * Returns the locale's ISO-3166 country code.
410 * Returns the locale's variant code.
417 * Returns the programmatic name of the entire locale, with the language,
427 * Returns the programmatic name of the entire locale as getName() would return,
437 * Gets the list of keywords for the specified locale.
463 * and construct a new Locale if it differs from getName().
476 * returns the locale's three-letter language code, as specified
484 * Fills in "name" with the locale's three-letter ISO-3166 country code.
491 * Returns the Windows LCID value corresponding to this locale.
492 * This value is stored in the resource data for the locale as a one-to-four-digit
494 * there is no Windows LCID value that corresponds to this locale, returns 0.
500 * Returns whether this locale's script is written right-to-left.
509 * @return TRUE if the locale's script is written right-to-left
515 * Fills in "dispLang" with the name of this locale's language in a format suitable for
516 * user display in the default locale. For example, if the locale's language code is
517 * "fr" and the default locale's language code is "en", this function would set
526 * Fills in "dispLang" with the name of this locale's language in a format suitable for
527 * user display in the locale specified by "displayLocale". For example, if the locale's
530 * @param displayLocale Specifies the locale to be used to display the name. In other words,
531 * if the locale's language code is "en", passing Locale::getFrench() for
532 * displayLocale would result in "Anglais", while passing Locale::getGerman()
538 UnicodeString& getDisplayLanguage( const Locale& displayLocale,
542 * Fills in "dispScript" with the name of this locale's script in a format suitable
543 * for user display in the default locale. For example, if the locale's script code
544 * is "LATN" and the default locale's language code is "en", this function would set
553 * Fills in "dispScript" with the name of this locale's country in a format suitable
554 * for user display in the locale specified by "displayLocale". For example, if the locale's
557 * @param displayLocale Specifies the locale to be used to display the name. In other
558 * words, if the locale's script code is "LATN", passing
559 * Locale::getFrench() for displayLocale would result in "", while
560 * passing Locale::getGerman() for displayLocale would result in
566 UnicodeString& getDisplayScript( const Locale& displayLocale,
570 * Fills in "dispCountry" with the name of this locale's country in a format suitable
571 * for user display in the default locale. For example, if the locale's country code
572 * is "FR" and the default locale's language code is "en", this function would set
581 * Fills in "dispCountry" with the name of this locale's country in a format suitable
582 * for user display in the locale specified by "displayLocale". For example, if the locale's
585 * @param displayLocale Specifies the locale to be used to display the name. In other
586 * words, if the locale's country code is "US", passing
587 * Locale::getFrench() for displayLocale would result in "&Eacute;tats-Unis", while
588 * passing Locale::getGerman() for displayLocale would result in
594 UnicodeString& getDisplayCountry( const Locale& displayLocale,
598 * Fills in "dispVar" with the name of this locale's variant code in a format suitable
599 * for user display in the default locale.
607 * Fills in "dispVar" with the name of this locale's variant code in a format
608 * suitable for user display in the locale specified by "displayLocale".
609 * @param displayLocale Specifies the locale to be used to display the name.
614 UnicodeString& getDisplayVariant( const Locale& displayLocale,
618 * Fills in "name" with the name of this locale in a format suitable for user display
619 * in the default locale. This function uses getDisplayLanguage(), getDisplayCountry(),
621 * "language (country[,variant])". For example, if the default locale is en_US, then
624 * @param name Receives the locale's display name.
631 * Fills in "name" with the name of this locale in a format suitable for user display
632 * in the locale specfied by "displayLocale". This function uses getDisplayLanguage(),
637 * @param displayLocale Specifies the locale to be used to display the name.
638 * @param name Receives the locale's display name.
642 UnicodeString& getDisplayName( const Locale& displayLocale,
646 * Generates a hash code for the locale.
652 * Sets the locale to bogus
653 * A bogus locale represents a non-existing locale associated
654 * with services that can be instantiated from non-locale data
655 * in addition to locale (for example, collation can be
656 * instantiated from a locale and from a rule set).
662 * Gets the bogus state. Locale object can be bogus if it doesn't exist
663 * @return FALSE if it is a real locale, TRUE if it is a bogus locale
671 * @return A pointer to an array of Locale objects. This array is the list
676 static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
715 * Set this from a single POSIX style locale string.
723 * Initialize the locale object with a new name.
726 * @param cLocaleID The new locale name.
729 Locale& init(const char* cLocaleID, UBool canonicalize);
732 * Internal constructor to allow construction of a locale object with
734 * the default locale.)
739 Locale(ELocaleType);
742 * Initialize the locale cache for commonly used locales
744 static Locale *getLocaleCache(void);
758 static const Locale &getLocale(int locid);
761 * A friend to allow the default locale to be set by either the C or C++ API.
764 friend Locale *locale_set_default_internal(const char *, UErrorCode& status);
773 Locale::operator!=(const Locale& other) const
779 Locale::getCountry() const
785 Locale::getLanguage() const
791 Locale::getScript() const
797 Locale::getVariant() const
803 Locale::getName() const
809 Locale::isBogus(void) const {