Removed language as tidy config option; it is only CLI option.

This commit is contained in:
Jim Derry 2017-02-18 17:16:35 -05:00
parent cbb8354f74
commit edc548095c
6 changed files with 6 additions and 45 deletions

View file

@ -143,10 +143,8 @@ typedef enum
TidyEscapeCdata, /**< Replace <![CDATA[]]> sections with escaped text */ TidyEscapeCdata, /**< Replace <![CDATA[]]> sections with escaped text */
#if SUPPORT_ASIAN_ENCODINGS #if SUPPORT_ASIAN_ENCODINGS
TidyLanguage, /**< Language property: not used for anything yet */
TidyNCR, /**< Allow numeric character references */ TidyNCR, /**< Allow numeric character references */
#else #else
TidyLanguageNotUsed,
TidyNCRNotUsed, TidyNCRNotUsed,
#endif #endif
#if SUPPORT_UTF16_ENCODINGS #if SUPPORT_UTF16_ENCODINGS

View file

@ -296,7 +296,6 @@ static const TidyOptionImpl option_defs[] =
{ TidyJoinStyles, MU, "join-styles", BL, yes, ParseBool, boolPicks }, { TidyJoinStyles, MU, "join-styles", BL, yes, ParseBool, boolPicks },
{ TidyEscapeCdata, MU, "escape-cdata", BL, no, ParseBool, boolPicks }, { TidyEscapeCdata, MU, "escape-cdata", BL, no, ParseBool, boolPicks },
#if SUPPORT_ASIAN_ENCODINGS #if SUPPORT_ASIAN_ENCODINGS
{ TidyLanguage, CE, "language", ST, 0, ParseName, NULL },
{ TidyNCR, MU, "ncr", BL, yes, ParseBool, boolPicks }, { TidyNCR, MU, "ncr", BL, yes, ParseBool, boolPicks },
#endif #endif
#if SUPPORT_UTF16_ENCODINGS #if SUPPORT_UTF16_ENCODINGS

View file

@ -1752,20 +1752,6 @@ static languageDefinition language_en = { whichPluralForm_en, {
"This option specifies the character encoding Tidy uses for the input. See " "This option specifies the character encoding Tidy uses for the input. See "
"<code>char-encoding</code> for more info. " "<code>char-encoding</code> for more info. "
}, },
#if SUPPORT_ASIAN_ENCODINGS
{/* Important notes for translators:
- Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
<br/>.
- Entities, tags, attributes, etc., should be enclosed in <code></code>.
- Option values should be enclosed in <var></var>.
- It's very important that <br/> be self-closing!
- The strings "Tidy" and "HTML Tidy" are the program name and must not
be translated. */
TidyLanguage, 0,
"Currently not used, but this option specifies the language Tidy would use "
"if it were properly localized. For example: <var>en</var>. "
},
#endif
#if SUPPORT_UTF16_ENCODINGS #if SUPPORT_UTF16_ENCODINGS
{/* Important notes for translators: {/* Important notes for translators:
- Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and - Use only <code></code>, <var></var>, <em></em>, <strong></strong>, and
@ -2297,12 +2283,12 @@ static languageDefinition language_en = { whichPluralForm_en, {
- The strings "Tidy" and "HTML Tidy" are the program name and must not be translated. */ - The strings "Tidy" and "HTML Tidy" are the program name and must not be translated. */
TC_TXT_HELP_LANG_1, 0, TC_TXT_HELP_LANG_1, 0,
"\n" "\n"
"The --language (or --lang) option indicates which language Tidy \n" "The -language (or -lang) option indicates which language Tidy \n"
"should use to communicate its output. Please note that this is not \n" "should use to communicate its output. Please note that this is not \n"
"a document translation service, and only affects the messages that \n" "a document translation service, and only affects the messages that \n"
"Tidy communicates to you. \n" "Tidy communicates to you. \n"
"\n" "\n"
"When used from the command line the --language argument must \n" "When used from the command line the -language argument must \n"
"be used before any arguments that result in output, otherwise Tidy \n" "be used before any arguments that result in output, otherwise Tidy \n"
"will produce output before it knows which language to use. \n" "will produce output before it knows which language to use. \n"
"\n" "\n"

View file

@ -83,12 +83,12 @@ static languageDefinition language_es = { whichPluralForm_es, {
#if SUPPORT_CONSOLE_APP #if SUPPORT_CONSOLE_APP
{ TC_TXT_HELP_LANG_1, 0, { TC_TXT_HELP_LANG_1, 0,
"\n" "\n"
"La opción --language (o --lang) indica el lenguaje Tidy debe \n" "La opción -language (o -lang) indica el lenguaje Tidy debe \n"
"utilizar para comunicar su salida. Tenga en cuenta que esto no es \n" "utilizar para comunicar su salida. Tenga en cuenta que esto no es \n"
"un servicio de traducción de documentos, y sólo afecta a los mensajes \n" "un servicio de traducción de documentos, y sólo afecta a los mensajes \n"
"que Tidy comunica a usted. \n" "que Tidy comunica a usted. \n"
"\n" "\n"
"Cuando se utiliza la línea de comandos el argumento --language debe \n" "Cuando se utiliza la línea de comandos el argumento -language debe \n"
"utilizarse antes de cualquier argumento que dan lugar a la producción, \n" "utilizarse antes de cualquier argumento que dan lugar a la producción, \n"
"de lo contrario Tidy producirá la salida antes de que se conozca el \n" "de lo contrario Tidy producirá la salida antes de que se conozca el \n"
"idioma a utilizar. \n" "idioma a utilizar. \n"

View file

@ -521,13 +521,13 @@ static languageDefinition language_fr = { whichPluralForm_fr, {
{ TC_TXT_HELP_CONFIG_ALLW, 0, "Les valeurs autorisées" }, { TC_TXT_HELP_CONFIG_ALLW, 0, "Les valeurs autorisées" },
{ TC_TXT_HELP_LANG_1, 0, { TC_TXT_HELP_LANG_1, 0,
"\n" "\n"
"L'option --language (ou --lang) indique la langue Tidy\n" "L'option -language (ou -lang) indique la langue Tidy\n"
"doit utiliser pour communiquer sa sortie. S'il vous plaît noter que ce ne sont pas " "doit utiliser pour communiquer sa sortie. S'il vous plaît noter que ce ne sont pas "
"un service de traduction de documents, et affecte uniquement les messages qui Tidy " "un service de traduction de documents, et affecte uniquement les messages qui Tidy "
"communique à vous.\n" "communique à vous.\n"
"\n" "\n"
"Lorsqu'il est utilisé à partir de la ligne de commande de l'argument doit \n" "Lorsqu'il est utilisé à partir de la ligne de commande de l'argument doit \n"
"--language être utilisé avant des arguments qui résultent de la production, sinon " "-language être utilisé avant des arguments qui résultent de la production, sinon "
"Tidy\n" "Tidy\n"
"va produire une sortie avant qu'il connaît la langue à utiliser.\n" "va produire une sortie avant qu'il connaît la langue à utiliser.\n"
"\n" "\n"

View file

@ -72,28 +72,6 @@ void TY_(PPrintSpaces)(void)
#if SUPPORT_ASIAN_ENCODINGS #if SUPPORT_ASIAN_ENCODINGS
/* #431953 - start RJ Wraplen adjusted for smooth international ride */ /* #431953 - start RJ Wraplen adjusted for smooth international ride */
#if 0
uint CWrapLen( TidyDocImpl* doc, uint ind )
{
ctmbstr lang = cfgStr( doc, TidyLanguage );
uint wraplen = cfg( doc, TidyWrapLen );
if ( !TY_(tmbstrcasecmp)(lang, "zh") )
/* Chinese characters take two positions on a fixed-width screen */
/* It would be more accurate to keep a parallel linelen and wraphere
incremented by 2 for Chinese characters and 1 otherwise, but this
is way simpler.
*/
return (ind + (( wraplen - ind ) / 2)) ;
if ( !TY_(tmbstrcasecmp)(lang, "ja") )
/* average Japanese text is 30% kanji */
return (ind + ((( wraplen - ind ) * 7) / 10)) ;
return wraplen;
}
#endif
typedef enum typedef enum
{ {
UC00, /* None */ UC00, /* None */