HTML Tidy  5.6.0
The HTACG Tidy HTML Project
Localization Support

Detailed Description

These functions help manage localization in Tidy.

Data Structures

struct  tidyLocalMapItem
 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...
 
const ctmbstr TIDY_CALL TidyLangWindowsName (const tidyLocaleMapItem *item)
 Given a tidyLocalMapItem, return the Windows name. More...
 
const ctmbstr TIDY_CALL TidyLangPosixName (const tidyLocaleMapItem *item)
 Given a tidyLocalMapItem, 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

struct tidyLocalMapItem

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

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 ));
}
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
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.
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.
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.
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.
}
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.
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 ) {
tidyLocaleMapItem *item = getNextWindowsLanguage( &itList );
// do something such as get the TidyLangWindowsName(item).
}
Returns
Returns a TidyIterator, which is a token used to represent the current position in a list within LibTidy.
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.
ctmbstr TIDY_CALL tidyGetLanguage ( void  )

Gets the current language used by Tidy.

Returns
Returns a string indicating the currently set language.
const ctmbstr TIDY_CALL TidyLangPosixName ( const tidyLocaleMapItem *  item)

Given a tidyLocalMapItem, return the POSIX name.

Parameters
itemAn instance of tidyLocalMapItem to query.
Returns
Returns a string with the POSIX name of the mapping.
const ctmbstr TIDY_CALL TidyLangWindowsName ( const tidyLocaleMapItem *  item)

Given a tidyLocalMapItem, return the Windows name.

Parameters
itemAn instance of tidyLocalMapItem to query.
Returns
Returns a string with the Windows name of the mapping.
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.
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.
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.