Skip to content

Options categories #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions console/tidy.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ static Bool hasPickList( TidyOption topt )
return tidyOptGetNextPick( topt, &pos ) != NULL;
}

/** Returns the configuration category name for the specified configuration
/** Returns the configuration category id for the specified configuration
** category id. This will be used as an XML class attribute value.
** @param id The TidyConfigCategory for which to lookup the category name.
** @result Returns the configuration category, such as "diagnostics".
*/
static ctmbstr ConfigCategoryName( TidyConfigCategory id )
static ctmbstr ConfigCategoryId( TidyConfigCategory id )
{
if (id >= TidyMarkup && id <= TidyInternalCategory)
return tidyLocalizedString(id);
if (id >= TidyDiagnostics && id <= TidyInternalCategory)
return tidyErrorCodeAsKey( id );

fprintf(stderr, tidyLocalizedString(TC_STRING_FATAL_ERROR), (int)id);
fprintf(stderr, "\n");
Expand Down Expand Up @@ -538,7 +538,7 @@ static void GetOption(TidyDoc tdoc, /**< The tidy document. */
TidyOptionType optTyp = tidyOptGetType( topt );

d->name = tidyOptGetName( topt );
d->cat = ConfigCategoryName( tidyOptGetCategory( topt ) );
d->cat = ConfigCategoryId( tidyOptGetCategory( topt ) );
d->catid = tidyOptGetCategory( topt );
d->vals = NULL;
d->def = NULL;
Expand Down
16 changes: 11 additions & 5 deletions include/tidyenum.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,18 @@ extern "C" {

/** Codes for populating TidyConfigCategory enumeration. */
#define FOREACH_TIDYCONFIGCATEGORY(FN) \
FN(TidyMarkup) /**< Markup options: (X)HTML version, etc */ \
FN(TidyDiagnostics) /**< Diagnostics */ \
FN(TidyPrettyPrint) /**< Output layout */ \
FN(TidyEncoding) /**< Character encodings */ \
FN(TidyMiscellaneous) /**< File handling, message format, etc. */ \
FN(TidyInternalCategory) /**< Option is internal only. */
FN(TidyDisplay) /**< Affecting screen display */ \
FN(TidyDocumentIO) /**< Pertaining to document I/O */ \
FN(TidyEncoding) /**< Relating to encoding */ \
FN(TidyFileIO) /**< Pertaining to file I/O */ \
FN(TidyMarkupCleanup) /**< Cleanup related options */ \
FN(TidyMarkupEntities) /**< Entity related options */ \
FN(TidyMarkupRepair) /**< Document repair related options */ \
FN(TidyMarkupTeach) /**< Teach tidy new things */ \
FN(TidyMarkupXForm) /**< Transform HTML one way or another */ \
FN(TidyPrettyPrint) /**< Pretty printing options */ \
FN(TidyInternalCategory) /**< Option is internal only. */ \


/** These message codes comprise every possible message that can be output by
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_en_gb.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -1755,34 +1755,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr ""

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr ""

msgctxt "TidyMarkup"
msgid "markup"
msgstr ""

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr ""

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr ""

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_es.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -1703,34 +1703,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr ""

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr ""

msgctxt "TidyMarkup"
msgid "markup"
msgstr ""

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr ""

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr ""

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_es_mx.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -1698,34 +1698,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr ""

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr ""

msgctxt "TidyMarkup"
msgid "markup"
msgstr ""

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr ""

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr ""

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -2017,34 +2017,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr "catégorie inconnue!"

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr "encodage"

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr "interne (privée)"

msgctxt "TidyMarkup"
msgid "markup"
msgstr "structure de balises"

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr "divers"

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr "affichage"

msgctxt "TidyInfo"
msgid "Info: "
msgstr "Info:"
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_pt_br.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -2097,34 +2097,6 @@ msgstr ""
"Esta opção especifica se o Tidy deve mover todas as tags de estilo para o "
"cabeçalho do documento. "

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr "categoria desconhecida!"

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr "diagnósticos"

msgctxt "TidyEncoding"
msgid "encoding"
msgstr "codificação"

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr "interna (privada)"

msgctxt "TidyMarkup"
msgid "markup"
msgstr "marcação"

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr "miscelânea"

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr "impressão"

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/language_zh_cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"PO-Revision-Date: 2017-10-05 15:06:28\n"
"PO-Revision-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -1698,34 +1698,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr ""

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr ""

msgctxt "TidyMarkup"
msgid "markup"
msgstr ""

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr ""

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr ""

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
30 changes: 1 addition & 29 deletions localize/translations/tidy.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"POT-Creation-Date: 2017-10-05 15:06:28\n"
"POT-Creation-Date: 2017-10-05 15:13:40\n"
"Last-Translator: jderry\n"
"Language-Team: \n"

Expand Down Expand Up @@ -1698,34 +1698,6 @@ msgid ""
"head of the document. "
msgstr ""

msgctxt "TidyUnknownCategory"
msgid "unknown category!"
msgstr ""

msgctxt "TidyDiagnostics"
msgid "diagnostics"
msgstr ""

msgctxt "TidyEncoding"
msgid "encoding"
msgstr ""

msgctxt "TidyInternalCategory"
msgid "internal (private)"
msgstr ""

msgctxt "TidyMarkup"
msgid "markup"
msgstr ""

msgctxt "TidyMiscellaneous"
msgid "misc"
msgstr ""

msgctxt "TidyPrettyPrint"
msgid "print"
msgstr ""

msgctxt "TidyInfo"
msgid "Info: "
msgstr ""
Expand Down
Loading