HTML Tidy  5.8.0
The HTACG Tidy HTML Project
Localization Support

Detailed Description

These functions help manage localization in Tidy.

Data Structures

struct  tidyLocaleMapItem
 Represents an opaque type we can use for tidyLocaleMapItem, which is used to iterate through the language list, and used to access the windowsName() and the posixName(). More...
 

Tidy's Locale

Bool TIDY_CALL tidySetLanguage (ctmbstr languageCode)
 Tells Tidy to use a different language for output. More...
 
ctmbstr TIDY_CALL tidyGetLanguage (void)
 Gets the current language used by Tidy. More...
 

Locale Mappings

TidyIterator TIDY_CALL getWindowsLanguageList (void)
 Initiates an iterator for a list of Tidy's Windows<->POSIX locale mappings. More...
 
const tidyLocaleMapItem *TIDY_CALL getNextWindowsLanguage (TidyIterator *iter)
 Given a valid TidyIterator initiated with getWindowsLanguageList(), returns a pointer to a tidyLocaleMapItem, which can be further interrogated with TidyLangWindowsName() or TidyLangPosixName(). More...
 
ctmbstr TIDY_CALL TidyLangWindowsName (const tidyLocaleMapItem *item)
 Given a tidyLocaleMapItem, return the Windows name. More...
 
ctmbstr TIDY_CALL TidyLangPosixName (const tidyLocaleMapItem *item)
 Given a tidyLocaleMapItem, return the POSIX name. More...
 

Getting Localized Strings

ctmbstr TIDY_CALL tidyLocalizedStringN (uint messageType, uint quantity)
 Provides a string given messageType in the current localization for quantity. More...
 
ctmbstr TIDY_CALL tidyLocalizedString (uint messageType)
 Provides a string given messageType in the current localization for the single case. More...
 
ctmbstr TIDY_CALL tidyDefaultString (uint messageType)
 Provides a string given messageType in the default localization (which is en). More...
 
TidyIterator TIDY_CALL getStringKeyList (void)
 Initiates an iterator for a list of string key codes available in Tidy. More...
 
uint TIDY_CALL getNextStringKey (TidyIterator *iter)
 Given a valid TidyIterator initiated with getStringKeyList(), returns an unsigned integer representing the next key value. More...
 

Available Languages

TidyIterator TIDY_CALL getInstalledLanguageList (void)
 Initiates an iterator for a list of Tidy's installed languages. More...
 
ctmbstr TIDY_CALL getNextInstalledLanguage (TidyIterator *iter)
 Given a valid TidyIterator initiated with getInstalledLanguageList(), returns a string representing a language name that is installed in Tidy. More...
 

Data Structure Documentation

◆ tidyLocaleMapItem

struct tidyLocaleMapItem

Represents an opaque type we can use for tidyLocaleMapItem, which is used to iterate through the language list, and used to access the windowsName() and the posixName().

Function Documentation

◆ getInstalledLanguageList()

TidyIterator TIDY_CALL getInstalledLanguageList ( void  )

Initiates an iterator for a list of Tidy's installed languages.

This iterator allows you to iterate through this list. In order to iterate through the list, initiate the iterator with this function, and then use use getNextInstalledLanguage() to retrieve the first and subsequent strings. For example:

TidyIterator itList = getInstalledLanguageList();
while ( itList ) {
printf("%s", getNextInstalledLanguage( &itList ));
}
ctmbstr TIDY_CALL getNextInstalledLanguage(TidyIterator *iter)
Given a valid TidyIterator initiated with getInstalledLanguageList(), returns a string representing a...
TidyIterator TIDY_CALL getInstalledLanguageList(void)
Initiates an iterator for a list of Tidy's installed languages.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.

◆ getNextInstalledLanguage()

ctmbstr TIDY_CALL getNextInstalledLanguage ( TidyIterator *  iter)

Given a valid TidyIterator initiated with getInstalledLanguageList(), returns a string representing a language name that is installed in Tidy.

Parameters
iterThe TidyIterator (initiated with getInstalledLanguageList()) token.
Returns
Returns a string indicating the installed language.

◆ getNextStringKey()

uint TIDY_CALL getNextStringKey ( TidyIterator *  iter)

Given a valid TidyIterator initiated with getStringKeyList(), returns an unsigned integer representing the next key value.

Remarks
These are provided for documentation generation purposes, and probably aren't of much use to the average LibTidy implementor.
Parameters
iterThe TidyIterator (initiated with getStringKeyList()) token.
Returns
Returns a message code.

◆ getNextWindowsLanguage()

const tidyLocaleMapItem* TIDY_CALL getNextWindowsLanguage ( TidyIterator *  iter)

Given a valid TidyIterator initiated with getWindowsLanguageList(), returns a pointer to a tidyLocaleMapItem, which can be further interrogated with TidyLangWindowsName() or TidyLangPosixName().

Parameters
iterThe TidyIterator (initiated with getWindowsLanguageList()) token.
Returns
Returns a pointer to a tidyLocaleMapItem.

◆ getStringKeyList()

TidyIterator TIDY_CALL getStringKeyList ( void  )

Initiates an iterator for a list of string key codes available in Tidy.

This iterator allows you to iterate through all of the codes. In order to iterate through the codes, initiate the iterator with this function, and then use getNextStringKey() to retrieve the first and subsequent codes. For example:

TidyIterator itKey = getErrorCodeList();
while ( itKey ) {
uint code = getNextStringKey( &itKey );
// do something with the code, such as lookup a string.
}
uint TIDY_CALL getNextStringKey(TidyIterator *iter)
Given a valid TidyIterator initiated with getStringKeyList(), returns an unsigned integer representin...
TidyIterator TIDY_CALL getErrorCodeList(void)
Initiates an iterator for a list of message codes available in Tidy.
unsigned int uint
Definition: tidyplatform.h:569
Remarks
These are provided for documentation generation purposes, and probably aren't of much use to the average LibTidy implementor.
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.

◆ getWindowsLanguageList()

TidyIterator TIDY_CALL getWindowsLanguageList ( void  )

Initiates an iterator for a list of Tidy's Windows<->POSIX locale mappings.

This iterator allows you to iterate through this list. In order to iterate through the list, initiate the iterator with this function, and then use getNextWindowsLanguage() to retrieve the first and subsequent codes. For example:

TidyIterator itList = getWindowsLanguageList();
while ( itList ) {
// do something such as get the TidyLangWindowsName(item).
}
TidyIterator TIDY_CALL getWindowsLanguageList(void)
Initiates an iterator for a list of Tidy's Windows<->POSIX locale mappings.
const tidyLocaleMapItem *TIDY_CALL getNextWindowsLanguage(TidyIterator *iter)
Given a valid TidyIterator initiated with getWindowsLanguageList(), returns a pointer to a tidyLocale...
Represents an opaque type we can use for tidyLocaleMapItem, which is used to iterate through the lang...
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.

◆ tidyDefaultString()

ctmbstr TIDY_CALL tidyDefaultString ( uint  messageType)

Provides a string given messageType in the default localization (which is en).

Parameters
messageTypeThe message type.
Returns
Returns the desired string.

◆ tidyGetLanguage()

ctmbstr TIDY_CALL tidyGetLanguage ( void  )

Gets the current language used by Tidy.

Returns
Returns a string indicating the currently set language.

◆ TidyLangPosixName()

ctmbstr TIDY_CALL TidyLangPosixName ( const tidyLocaleMapItem item)

Given a tidyLocaleMapItem, return the POSIX name.

Parameters
itemAn instance of tidyLocaleMapItem to query.
Returns
Returns a string with the POSIX name of the mapping.

◆ TidyLangWindowsName()

ctmbstr TIDY_CALL TidyLangWindowsName ( const tidyLocaleMapItem item)

Given a tidyLocaleMapItem, return the Windows name.

Parameters
itemAn instance of tidyLocaleMapItem to query.
Returns
Returns a string with the Windows name of the mapping.

◆ tidyLocalizedString()

ctmbstr TIDY_CALL tidyLocalizedString ( uint  messageType)

Provides a string given messageType in the current localization for the single case.

Parameters
messageTypeThe message type.
Returns
Returns the desired string.

◆ tidyLocalizedStringN()

ctmbstr TIDY_CALL tidyLocalizedStringN ( uint  messageType,
uint  quantity 
)

Provides a string given messageType in the current localization for quantity.

Some strings have one or more plural forms, and this function will ensure that the correct singular or plural form is returned for the specified quantity.

Returns
Returns the desired string.
Parameters
messageTypeThe message type.
quantityThe quantity.

◆ tidySetLanguage()

Bool TIDY_CALL tidySetLanguage ( ctmbstr  languageCode)

Tells Tidy to use a different language for output.

Parameters
languageCodeA Windows or POSIX language code, and must match a TIDY_LANGUAGE for an installed language.
Returns
Indicates that a setting was applied, but not necessarily the specific request, i.e., true indicates a language and/or region was applied. If es_mx is requested but not installed, and es is installed, then es will be selected and this function will return true. However the opposite is not true; if es is requested but not present, Tidy will not try to select from the es_XX variants.