Picklist enums should all start at zero for external LibTidy user compatibility.

Restore the new custom-tags enum to this state, and add separate string keys.
Updated PO's to reflect; no change to headers.
This commit is contained in:
Jim Derry 2017-03-20 12:20:51 -04:00
parent 0be7ed8e33
commit 929575afb4
9 changed files with 59 additions and 38 deletions

View file

@ -199,11 +199,12 @@ typedef enum
/** Integer values used by ParseUseCustomTags. These are used throughout /** Integer values used by ParseUseCustomTags. These are used throughout
* LibTidy to indicate the how Tidy treats custom tags, and also have * LibTidy to indicate the how Tidy treats custom tags, and also have
* associated localized strings to describe them. * associated localized strings to describe them in tidyMessagesMisc in
* the form MEMBER_STRING, e.g., TIDYCUSTOMBLOCKLEVEL_STRING
*/ */
typedef enum typedef enum
{ {
TidyCustomNo = 300, TidyCustomNo,
TidyCustomBlocklevel, TidyCustomBlocklevel,
TidyCustomEmpty, TidyCustomEmpty,
TidyCustomInline, TidyCustomInline,
@ -983,7 +984,12 @@ typedef enum
FN(STRING_HTML_PROPRIETARY) /* `HTML Proprietary`/ */ \ FN(STRING_HTML_PROPRIETARY) /* `HTML Proprietary`/ */ \
FN(STRING_MISSING_MALFORMED) /* For `missing or malformed argument for option: %s`. */ \ FN(STRING_MISSING_MALFORMED) /* For `missing or malformed argument for option: %s`. */ \
FN(STRING_NO_SYSID) /* `No system identifier in emitted doctype`. */ \ FN(STRING_NO_SYSID) /* `No system identifier in emitted doctype`. */ \
FN(STRING_UNKNOWN_OPTION) /* For retrieving a string `unknown option: %s`. */ FN(STRING_UNKNOWN_OPTION) /* For retrieving a string `unknown option: %s`. */ \
FN(TIDYCUSTOMNO_STRING) \
FN(TIDYCUSTOMBLOCKLEVEL_STRING) \
FN(TIDYCUSTOMEMPTY_STRING) \
FN(TIDYCUSTOMINLINE_STRING) \
FN(TIDYCUSTOMPRE_STRING) \
/* accessibility module contributions */ /* accessibility module contributions */
#define FOREACH_MSG_ACCESS(FN) \ #define FOREACH_MSG_ACCESS(FN) \

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"PO-Revision-Date: 2017-03-19 13:23:38\n" "PO-Revision-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -677,19 +677,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"PO-Revision-Date: 2017-03-19 13:23:38\n" "PO-Revision-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -673,19 +673,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"PO-Revision-Date: 2017-03-19 13:23:38\n" "PO-Revision-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -673,19 +673,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"PO-Revision-Date: 2017-03-19 13:23:38\n" "PO-Revision-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -810,19 +810,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"PO-Revision-Date: 2017-03-19 13:23:38\n" "PO-Revision-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -667,19 +667,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n" "X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2017-03-19 13:23:38\n" "POT-Creation-Date: 2017-03-20 12:20:02\n"
"Last-Translator: jderry\n" "Last-Translator: jderry\n"
"Language-Team: \n" "Language-Team: \n"
@ -669,19 +669,19 @@ msgctxt "CUSTOM_TAG_DETECTED"
msgid "detected autonomous custom tag %s; will treat as %s" msgid "detected autonomous custom tag %s; will treat as %s"
msgstr "" msgstr ""
msgctxt "TidyCustomBlocklevel" msgctxt "TIDYCUSTOMBLOCKLEVEL_STRING"
msgid "block level" msgid "block level"
msgstr "" msgstr ""
msgctxt "TidyCustomEmpty" msgctxt "TIDYCUSTOMEMPTY_STRING"
msgid "empty" msgid "empty"
msgstr "" msgstr ""
msgctxt "TidyCustomInline" msgctxt "TIDYCUSTOMINLINE_STRING"
msgid "inline" msgid "inline"
msgstr "" msgstr ""
msgctxt "TidyCustomPre" msgctxt "TIDYCUSTOMPRE_STRING"
msgid "pre" msgid "pre"
msgstr "" msgstr ""

View file

@ -386,10 +386,10 @@ static languageDefinition language_en = { whichPluralForm_en, {
{ TRIM_EMPTY_ELEMENT, 0, "trimming empty %s" }, /* Notice */ { TRIM_EMPTY_ELEMENT, 0, "trimming empty %s" }, /* Notice */
{ REPLACING_ELEMENT, 0, "replacing %s with %s" }, /* Notice */ { REPLACING_ELEMENT, 0, "replacing %s with %s" }, /* Notice */
{ CUSTOM_TAG_DETECTED, 0, "detected autonomous custom tag %s; will treat as %s" }, /* Notice */ { CUSTOM_TAG_DETECTED, 0, "detected autonomous custom tag %s; will treat as %s" }, /* Notice */
{ TidyCustomBlocklevel, 0, "block level" }, { TIDYCUSTOMBLOCKLEVEL_STRING, 0, "block level" },
{ TidyCustomEmpty, 0, "empty" }, { TIDYCUSTOMEMPTY_STRING, 0, "empty" },
{ TidyCustomInline, 0, "inline" }, { TIDYCUSTOMINLINE_STRING, 0, "inline" },
{ TidyCustomPre, 0, "pre" }, { TIDYCUSTOMPRE_STRING, 0, "pre" },
/* ReportError */ /* ReportError */
{ COERCE_TO_ENDTAG, 0, "<%s> is probably intended as </%s>" }, /* Error */ { COERCE_TO_ENDTAG, 0, "<%s> is probably intended as </%s>" }, /* Error */

View file

@ -230,7 +230,22 @@ void TY_(ReportNotice)(TidyDocImpl* doc, Node *element, Node *node, uint code)
case CUSTOM_TAG_DETECTED: case CUSTOM_TAG_DETECTED:
TagToString(element, elemdesc, sizeof(elemdesc)); TagToString(element, elemdesc, sizeof(elemdesc));
tagtype = tidyLocalizedString( cfg( doc, TidyUseCustomTags ) );
switch ( cfg( doc, TidyUseCustomTags ) )
{
case TidyCustomBlocklevel:
tagtype = tidyLocalizedString( TIDYCUSTOMBLOCKLEVEL_STRING );
break;
case TidyCustomEmpty:
tagtype = tidyLocalizedString( TIDYCUSTOMEMPTY_STRING );
break;
case TidyCustomInline:
tagtype = tidyLocalizedString( TIDYCUSTOMINLINE_STRING );
break;
case TidyCustomPre:
tagtype = tidyLocalizedString( TIDYCUSTOMPRE_STRING );
break;
}
message = TY_(tidyMessageCreateWithNode)(doc, element, code, TidyInfo, elemdesc, tagtype ); message = TY_(tidyMessageCreateWithNode)(doc, element, code, TidyInfo, elemdesc, tagtype );
break; break;
} }