Go to the source code of this file.
Data Structures | |
struct | languageDefinition |
Finally, a complete language definition. More... | |
struct | languageDictionaryEntry |
Describes a record for a localization string. More... | |
struct | tidyErrorFilterKeyItem |
The function getNextErrorCode() returns pointers to this type; it gives LibTidy implementors the ability to know what errors can be returned via TidyReportFilter3 . More... | |
struct | tidyLocaleMapItem |
The function getNextWindowsLanguage() returns pointers to this type; it gives LibTidy implementors the ability to determine how Windows locale names are mapped to POSIX language codes. More... | |
Functions | |
Localization Related Functions | |
tmbstr | tidySystemLocale (tmbstr result) |
Determines the current locale without affecting the C locale. More... | |
Bool | tidySetLanguage (ctmbstr languageCode) |
Tells Tidy to use a different language for output. More... | |
ctmbstr | tidyGetLanguage () |
Gets the current language used by Tidy. More... | |
ctmbstr | tidyLocalizedStringN (uint messageType, uint quantity) |
Provides a string given messageType in the current localization for quantity . More... | |
ctmbstr | tidyLocalizedString (uint messageType) |
Provides a string given messageType in the current localization for the single case. More... | |
Documentation Generation | |
ctmbstr | tidyDefaultString (uint messageType) |
Provides a string given messageType in the default localization (which is en ). More... | |
TidyIterator | getStringKeyList () |
uint | getNextStringKey (TidyIterator *iter) |
TidyIterator | getWindowsLanguageList () |
Initializes the TidyIterator to point to the first item in Tidy's structure of Windows<->POSIX local mapping. More... | |
const tidyLocaleMapItem * | getNextWindowsLanguage (TidyIterator *iter) |
Returns the next record of type localeMapItem in Tidy's structure of Windows<->POSIX local mapping. More... | |
TidyIterator | getInstalledLanguageList () |
Initializes the TidyIterator to point to the first item in Tidy's list of installed language codes. More... | |
ctmbstr | getNextInstalledLanguage (TidyIterator *iter) |
Returns the next installed language. More... | |
TidyIterator | getErrorCodeList () |
Initializes the TidyIterator to point to the first item in Tidy's list of error codes that can be return with TidyReportFilter3 . More... | |
const tidyErrorFilterKeyItem * | getNextErrorCode (TidyIterator *iter) |
Returns the next error code. More... | |
struct languageDictionaryEntry |
Describes a record for a localization string.
tidyMessageTypes
below)Data Fields | ||
---|---|---|
uint | key | |
uint | pluralForm | |
ctmbstr | value |
struct tidyErrorFilterKeyItem |
The function getNextErrorCode() returns pointers to this type; it gives LibTidy implementors the ability to know what errors can be returned via TidyReportFilter3
.
Provides the mapping for LibTidy users to map between an opaque key and an error message value. See tidyErrorFilterKeys[]
in language.c
. The key
string is guaranteed by the API (unless deleted entirely). The value
is suitable for use in looking up Tidy's strings, but its value is not guaranteed between releases.
Data Fields | ||
---|---|---|
ctmbstr | key | |
int | value |
struct tidyLocaleMapItem |
The function getNextWindowsLanguage() returns pointers to this type; it gives LibTidy implementors the ability to determine how Windows locale names are mapped to POSIX language codes.
Data Fields | ||
---|---|---|
ctmbstr | POSIXName | |
ctmbstr | winName |
typedef languageDictionaryEntry const languageDictionary[600] |
For now we'll just use an array to hold all of the dictionary entries.
In the future we can convert this to a hash structure which will make looking up strings faster.
enum tidyMessageTypes |
Defines all of the possible dictionary keys.
The starting value is arbitrary but must prevent overlaps with other enums that are used for retrieving strings. The comprehensive list of enums for which we provides strings is as follows:
tidyMessageTypes
in this file, start == 4096.tidyErrorCodes
from message.h
, start == 200.accessErrorCodes
from access.h
, start == CODES_TIDY_ERROR_LAST+1.tidyMessagesMisc
from message.h
, start == 2048.TidyOptionId
from tidyEnum.h
, start == 0 (important!).TidyReportLevelKeys
from tidyEnum.h
, start == 600.TidyIterator getErrorCodeList | ( | ) |
Initializes the TidyIterator to point to the first item in Tidy's list of error codes that can be return with TidyReportFilter3
.
Items can be retrieved with getNextErrorCode();
TidyIterator getInstalledLanguageList | ( | ) |
Initializes the TidyIterator to point to the first item in Tidy's list of installed language codes.
Items can be retrieved with getNextInstalledLanguage();
const tidyErrorFilterKeyItem* getNextErrorCode | ( | TidyIterator * | iter | ) |
Returns the next error code.
ctmbstr getNextInstalledLanguage | ( | TidyIterator * | iter | ) |
Returns the next installed language.
uint getNextStringKey | ( | TidyIterator * | iter | ) |
const tidyLocaleMapItem* getNextWindowsLanguage | ( | TidyIterator * | iter | ) |
Returns the next record of type localeMapItem
in Tidy's structure of Windows<->POSIX local mapping.
TidyIterator getStringKeyList | ( | ) |
TidyIterator getWindowsLanguageList | ( | ) |
Initializes the TidyIterator to point to the first item in Tidy's structure of Windows<->POSIX local mapping.
Items can be retrieved with getNextWindowsLanguage();
Provides a string given messageType
in the default localization (which is en
).
LibTidy users may want to use TidyReportFilter3
to enable their own localization lookup features.
Because Tidy's errors codes are enums the specific values can change over time. This function returns a string representing the enum value name that can be used as a lookup key independent of changing string values (TidyReportFiler2 is vulnerable to changing strings). TidyReportFilter3
will return this general string as the error message indicator.
ctmbstr tidyGetLanguage | ( | ) |
Gets the current language used by Tidy.
Provides a string given messageType
in the current localization for the single case.
Provides a string given messageType
in the current localization for quantity
.
Tells Tidy to use a different language for output.
languageCode | A Windows or POSIX language code, and must match a TIDY_LANGUAGE for an installed language. |
Determines the current locale without affecting the C locale.
Tidy has always used the default C locale, and at this point in its development we're not going to tamper with that.
result | The buffer to use to return the string. Returns NULL on failure. |