WowAddons

World of Warcraft Forever API · C_Intl.md, for your AI

C_Intl

27 functions, as Blizzard documents them for Forever 1.60.1 (70959).

Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.

Functions

C_Intl.CompareStrings

result = C_Intl.CompareStrings(left, right, strength)

Compares two UTF-8 strings using the options specified on a collator.

May return nothing.

Arguments

leftcstringThe first UTF-8 string passed to collation comparison.
rightcstringThe second UTF-8 string passed to collation comparison.
strengthCollationStrengthThe comparison level used by the collator for ordering and equality.

Returns

resultnumberThe comparison result: less than, equal to, or greater than zero.

C_Intl.CreateLocaleContext

context = C_Intl.CreateLocaleContext(locale)

Creates a locale context object for locale-scoped internationalization operations.

Arguments

localecstringThe locale ID used to initialize the locale context object.

Returns

contextLuaLocaleContextA locale context userdata object for calling locale-scoped APIs.

C_Intl.FindBreaks

byteOffsets = C_Intl.FindBreaks(text, breakType)

Opens a break iterator for locating text boundaries in a specified locale.

May return nothing.

Arguments

textcstringThe UTF-8 text whose boundary offsets are requested.
breakTypeBreakTypeThe break iterator kind to use for boundary analysis.

Returns

byteOffsetsluaIndex[]The native UTF-8 string indices for the text boundaries (returned with 1-based indexes for lua convenience).

C_Intl.FindStringMatches

byteOffsets = C_Intl.FindStringMatches(text, pattern, strength)

Creates a string search iterator using a collator and returns every match position.

May return nothing.

Arguments

textcstringThe UTF-8 text scanned by the string search iterator.
patterncstringThe UTF-8 pattern whose collation-aware matches are returned.
strengthCollationStrengthThe comparison level used by the collator while searching for matches.

Returns

byteOffsetsluaIndex[]The UTF-8 byte offsets of matches in the text (returned with 1-based indexes for lua convenience).

C_Intl.FoldCase

result = C_Intl.FoldCase(text)

Case-folds the characters in a string; case-folding is locale-independent and not context-sensitive.

May return nothing.

Arguments

textcstringThe UTF-8 text converted with locale-independent case folding.

Returns

resultstringThe case-folded string, which may be longer or shorter than the original.

C_Intl.FormatCurrency

result = C_Intl.FormatCurrency(number, currencyCode)

Formats a double as a localized currency value using the provided ISO 4217 currency code.

May return nothing.

Arguments

numbernumberThe double value formatted by the locale currency formatter.
currencyCodecstringThe 3-letter null-terminated ISO 4217 currency code for currency formatting.

Returns

resultstringThe localized currency text produced by the formatter.

C_Intl.FormatDate

result = C_Intl.FormatDate(unixTimeSeconds, style, timeZone)

Formats Unix time as localized date text using locale date patterns, symbols, style, and optional time zone.

May return nothing.

Arguments

unixTimeSecondsnumberThe date as seconds since the Unix epoch; this API converts it to milliseconds.
styleDateTimeStyleThe date format length; None omits the date portion.
timeZonecstringThe time zone ID applied to the formatter; empty strings keep the formatter default.

Returns

resultstringThe formatted date string.

C_Intl.FormatDateTime

result = C_Intl.FormatDateTime(unixTimeSeconds, dateStyle, timeStyle, timeZone)

Formats Unix time as localized date and time text using locale patterns, symbols, styles, and optional time zone.

May return nothing.

Arguments

unixTimeSecondsnumberThe date and time as seconds since the Unix epoch; this API converts it to milliseconds.
dateStyleDateTimeStyleThe date format length; None omits the date portion.
timeStyleDateTimeStyleThe time format length; None omits the time portion.
timeZonecstringThe time zone ID applied to the formatter; empty strings keep the formatter default.

Returns

resultstringThe formatted date and time string.

C_Intl.FormatNumber

result = C_Intl.FormatNumber(number, style)

Formats a double with locale number formatting using locale symbols, grouping, and the selected non-currency style.

May return nothing.

Arguments

numbernumberThe double value formatted according to the selected number formatter.
styleNumberStyleThe number style to format with; Currency is not accepted here, use FormatCurrency instead.

Returns

resultstringThe localized number text produced by the formatter.

C_Intl.FormatTime

result = C_Intl.FormatTime(unixTimeSeconds, style, timeZone)

Formats Unix time as localized time text using locale time patterns, symbols, style, and optional time zone.

May return nothing.

Arguments

unixTimeSecondsnumberThe time as seconds since the Unix epoch; this API converts it to milliseconds.
styleDateTimeStyleThe time format length; None omits the time portion.
timeZonecstringThe time zone ID applied to the formatter; empty strings keep the formatter default.

Returns

resultstringThe formatted time string.

C_Intl.GetCharacterProperties

result = C_Intl.GetCharacterProperties(text)

Returns Unicode property values for the first code point in a string.

May return nothing.

Arguments

textcstringThe string whose first code point is tested.

Returns

resultCharacterPropertiesUnicode property values for the first code point.

C_Intl.GetCurrencyFractionDigits

result = C_Intl.GetCurrencyFractionDigits(currencyCode)

Returns the number of fraction digits that should be displayed for the given currency.

May return nothing.

Arguments

currencyCodecstringThe null-terminated 3-letter ISO 4217 currency code.

Returns

resultnumberThe non-negative number of fraction digits to be displayed, or 0 if the lookup fails.

C_Intl.GetCurrencyName

result = C_Intl.GetCurrencyName(currencyCode, nameStyle)

Returns the display name for a currency in the given locale.

May return nothing.

Arguments

currencyCodecstringThe null-terminated 3-letter ISO 4217 currency code.
nameStyleCurrencyNameStyleThe selector for which kind of currency name to return.

Returns

resultstringThe display string for the currency, or the currency code itself if no localized name is available.

C_Intl.GetCurrentLocale

result = C_Intl.GetCurrentLocale()

Gets the current locale used by C_Intl.

Returns

resultcstringThe current locale ID.

C_Intl.GetDisplayName

result = C_Intl.GetDisplayName(displayLocale)

Gets a display name suitable for the specified locale.

May return nothing.

Arguments

displayLocalecstringThe locale whose language conventions are used for the display name

Returns

resultstringThe displayable name for the locale.

C_Intl.GetSortKey

sortKey = C_Intl.GetSortKey(text, strength)

Transforms a string into a collation sort key.

May return nothing.

Arguments

textcstringThe UTF-8 text converted into collation sort-key bytes.
strengthCollationStrengthThe comparison level used by the collator; lower strengths ignore later-level differences.

Returns

sortKeystringThe sort key bytes excluding the terminating zero byte.

C_Intl.IsNormalized

isNormalized = C_Intl.IsNormalized(text, form)

Tests if the string is normalized according to the specified normalization form.

Arguments

textcstringThe UTF-8 text checked against the requested normalization form.
formNormalizationFormThe normalization form to test against.

Returns

isNormalizedboolTrue if the string is normalized according to the specified form.

C_Intl.Length

result = C_Intl.Length(text)

Counts character break boundaries in UTF-8 text.

May return nothing.

Arguments

textcstringThe UTF-8 text counted by character break iteration.

Returns

resultnumberThe number of character boundaries minus the initial boundary.

C_Intl.Normalize

result = C_Intl.Normalize(text, form)

Writes the normalized form of the source string to the destination string.

May return nothing.

Arguments

textcstringThe UTF-8 text that is normalized.
formNormalizationFormThe normalization form to write.

Returns

resultstringThe normalized form of the source string.

C_Intl.ParseCurrency

result = C_Intl.ParseCurrency(text)

Parses an entire localized currency string into a double amount and ISO 4217 currency code.

May return nothing.

Arguments

textcstringThe localized currency text to parse for both amount and ISO 4217 code.

Returns

resultCurrencyParseResultThe numeric amount and ISO 4217 currency code parsed from the localized currency text.

C_Intl.ParseNumber

result = C_Intl.ParseNumber(text, style)

Parses an entire localized number string into a double using the selected non-currency number formatter.

May return nothing.

Arguments

textcstringThe localized numeric text to parse with the selected style.
styleNumberStyleThe number style to parse with; Currency is not accepted here, use ParseCurrency instead.

Returns

resultnumberThe numeric value parsed from the localized number text.

C_Intl.SelectPlural

result = C_Intl.SelectPlural(number, pluralType)

Returns the keyword of the first plural rule that applies to a number.

May return nothing.

Arguments

numbernumberThe number for which the plural rule has to be determined.
pluralTypePluralTypeThe plural rule type, cardinal or ordinal.

Returns

resultstringThe plural keyword for the rule that applies to the number.

C_Intl.ToLower

result = C_Intl.ToLower(text)

Lowercases the characters in a string; casing is locale-dependent and context-sensitive.

May return nothing.

Arguments

textcstringThe UTF-8 text whose characters are lowercased.

Returns

resultstringThe lowercased string, which may be longer or shorter than the original.

C_Intl.ToTitle

result = C_Intl.ToTitle(text)

Titlecases a string using titlecase positions determined by the default Unicode algorithm.

May return nothing.

Arguments

textcstringThe UTF-8 text whose titlecase positions are mapped.

Returns

resultstringThe titlecased string, which may be longer or shorter than the original.

C_Intl.ToUpper

result = C_Intl.ToUpper(text)

Uppercases the characters in a string; casing is locale-dependent and context-sensitive.

May return nothing.

Arguments

textcstringThe UTF-8 text whose characters are uppercased.

Returns

resultstringThe uppercased string, which may be longer or shorter than the original.

C_Intl.TransformLocale

result = C_Intl.TransformLocale(transform)

Applies a locale transform to the current locale and returns the transformed locale string.

May return nothing.

Arguments

transformLocaleTransformThe locale transform to apply.

Returns

resultstringThe transformed locale string.

C_Intl.Transliterate

result = C_Intl.Transliterate(text, transliteratorID)

Opens a system transliterator by ID and transliterates the text in place.

May return nothing.

Arguments

textcstringThe UTF-8 text converted by the opened transliterator.
transliteratorIDcstringA registered transliterator ID, such as a source-target system transliterator.

Returns

resultstringThe UTF-8 text after transliterator rules are applied.

It takes WowAddons

Free, for Windows, macOS and Linux: it puts the addon in your game in one click and keeps it up to date. Open it once, then press Install again.

WowAddons runs on your computer: open wowaddons.gg there.

Download for Windows