- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 17 Sep 2011 06:02:30 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/util In directory hutz:/tmp/cvs-serv24491/css/util Modified Files: ApplContext.java CssProfile.java CssVersion.java InvalidParamException.java Messages.java Messages.properties.bg Messages.properties.cs Messages.properties.de Messages.properties.el Messages.properties.en Messages.properties.es Messages.properties.fa Messages.properties.fr Messages.properties.hi Messages.properties.hu Messages.properties.it Messages.properties.ja Messages.properties.ko Messages.properties.nl Messages.properties.pl-PL Messages.properties.pt-BR Messages.properties.ro Messages.properties.ru Messages.properties.sv Messages.properties.uk Messages.properties.zh-cn Warning.java Log Message: better handling of versions and profile, error/warning processing now replacing all %s, error reporting do no longer have duplicate values Index: Messages.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Messages.java 6 Sep 2011 09:32:48 -0000 1.42 +++ Messages.java 17 Sep 2011 06:02:27 -0000 1.43 @@ -192,7 +192,7 @@ if ((params == null) || params.size() == 0) { return getString(message); } - String[] msg_parts = getString(message).split("%s"); + String[] msg_parts = getString(message).split("%s", -1); Iterator<String> param_it = params.iterator(); StringBuilder sb = new StringBuilder(msg_parts[0]); for (int i = 1; i < msg_parts.length; i++) { Index: Messages.properties.el =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.el,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Messages.properties.el 6 Sep 2011 16:37:29 -0000 1.2 +++ Messages.properties.el 17 Sep 2011 06:02:27 -0000 1.3 @@ -13,7 +13,7 @@ css2: Επίπεδο 2 CSS css21: Επίπεδο 2.1 CSS css3: Επίπεδο 3 CSS -SVG: SVG +svg: SVG svgbasic: Βασικό SVG svgtiny: μικρό SVG mobile: Κινητό Index: Messages.properties.en =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.en,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Messages.properties.en 11 Apr 2011 09:32:46 -0000 1.46 +++ Messages.properties.en 17 Sep 2011 06:02:27 -0000 1.47 @@ -14,7 +14,7 @@ css2: CSS level 2 css21: CSS level 2.1 css3: CSS level 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile Index: Messages.properties.pl-PL =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.pl-PL,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Messages.properties.pl-PL 22 Oct 2009 21:37:36 -0000 1.26 +++ Messages.properties.pl-PL 17 Sep 2011 06:02:27 -0000 1.27 @@ -14,7 +14,7 @@ css2: CSS wersja 2 css21: CSS wersja 2.1 css3: CSS wersja 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: mobilny Index: Messages.properties.cs =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Messages.properties.cs 17 Aug 2010 16:48:27 -0000 1.3 +++ Messages.properties.cs 17 Sep 2011 06:02:27 -0000 1.4 @@ -13,7 +13,7 @@ css2: CSS level 2 css21: CSS level 2.1 css3: CSS level 3 -SVG: SVG +svg: SVG svgbasic: SVG základní svgtiny: SVG malý mobile: Mobil Index: Messages.properties.zh-cn =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.zh-cn,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Messages.properties.zh-cn 22 Oct 2009 21:28:31 -0000 1.38 +++ Messages.properties.zh-cn 17 Sep 2011 06:02:28 -0000 1.39 @@ -14,7 +14,7 @@ css2: CSS 版本 2 css21: CSS 版本 2.1 css3: CSS 版本 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG Tiny mobile: Mobile Index: Messages.properties.ja =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.ja,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- Messages.properties.ja 3 Mar 2009 15:37:05 -0000 1.46 +++ Messages.properties.ja 17 Sep 2011 06:02:27 -0000 1.47 @@ -14,7 +14,7 @@ css2: CSS レベル 2 css21: CSS レベル 2.1 css3: CSS レベル 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile Index: Messages.properties.hi =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.hi,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Messages.properties.hi 7 Sep 2011 16:39:57 -0000 1.3 +++ Messages.properties.hi 17 Sep 2011 06:02:27 -0000 1.4 @@ -13,7 +13,7 @@ css2: CSS स्तर 2 css21: CSS स्तर 2.1 css3: CSS स्तर 3 -SVG: SVG +svg: SVG svgbasic: SVG बुनियादी svgtiny: SVG छोटे mobile: मोबाइल Index: Messages.properties.sv =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.sv,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Messages.properties.sv 13 Jul 2011 13:42:43 -0000 1.21 +++ Messages.properties.sv 17 Sep 2011 06:02:28 -0000 1.22 @@ -14,11 +14,9 @@ css2: CSS nivå 2 css21: CSS nivå 2.1 css3: CSS nivå 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG Tiny -SVG_basic: SVG Basic -SVG_tiny: SVG Tiny mobile: Mobil ATSC_TV_profile: ATSC TV-profil TV_profile: TV-profil Index: Messages.properties.nl =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.nl,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- Messages.properties.nl 13 Jul 2011 13:44:23 -0000 1.43 +++ Messages.properties.nl 17 Sep 2011 06:02:27 -0000 1.44 @@ -14,7 +14,7 @@ css2: CSS versie 2 css21: CSS versie 2.1 css3: CSS versie 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile Index: Messages.properties.pt-BR =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.pt-BR,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Messages.properties.pt-BR 17 Jan 2011 14:57:12 -0000 1.16 +++ Messages.properties.pt-BR 17 Sep 2011 06:02:27 -0000 1.17 @@ -14,7 +14,7 @@ css2: CSS nível 2 css21: CSS nível 2.1 css3: CSS nível 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic SVG_basic: SVG Basic svgtiny: SVG Tiny Index: Messages.properties.uk =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.uk,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Messages.properties.uk 17 Jan 2011 14:25:08 -0000 1.9 +++ Messages.properties.uk 17 Sep 2011 06:02:28 -0000 1.10 @@ -12,7 +12,7 @@ css2: CSS2 css21: CSS2.1 css3: CSS3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Мобільний Index: InvalidParamException.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/InvalidParamException.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- InvalidParamException.java 8 Jan 2010 21:38:01 -0000 1.11 +++ InvalidParamException.java 17 Sep 2011 06:02:27 -0000 1.12 @@ -41,6 +41,16 @@ } /** + * Create a new InvalidParamException with an error message class. + * + * @param error the error message class. + * @param args a string array of messages to add + */ + public InvalidParamException(String error, String[] args, ApplContext ac) { + super(processError(error, args, ac)); + } + + /** * Create a new InvalidParamException. * * @param error the error message class @@ -55,38 +65,8 @@ ac)); } - private static String processError(String error, Object args, ApplContext ac) { - if (args instanceof String[]) { - String[] s_args = (String[]) args; - StringBuilder sb = new StringBuilder(); - String str = null; - - if (error != null) { - str = ac.getMsg().getErrorString(error); - } - if (str == null) { - return "can't find the error message for " + error; - } else { - // replace all parameters - String[] msg_parts = str.split("%s"); - int j = 0; - sb.append(msg_parts[0]); - for (int i = 1; i < msg_parts.length; i++) { - if (j < s_args.length) { - sb.append(s_args[j++]); - } - sb.append(msg_parts[i]); - } - return sb.toString(); - } - } else { - return processError(error, args.toString(), "", ac); - } - } - - - private static String processError(String error, String arg1, - String arg2, ApplContext ac) { + private static String processError(String error, String[] args, ApplContext ac) { + StringBuilder sb = new StringBuilder(); String str = null; if (error != null) { @@ -94,17 +74,29 @@ } if (str == null) { return "can't find the error message for " + error; - } else { - // replace all parameters - int i; - while ((i = str.indexOf("%s")) >= 0) { - StringBuilder sb = new StringBuilder(str.substring(0, i)); - sb.append(arg1).append(str.substring(i + 2)); - str = sb.toString(); - arg1 = arg2; + } + // replace all parameters + String[] msg_parts = str.split("%s", -1); + int j = 0; + sb.append(msg_parts[0]); + for (int i = 1; i < msg_parts.length; i++) { + if (j < args.length) { + sb.append(args[j++]); } - return str; + sb.append(msg_parts[i]); } + return sb.toString(); + } + + private static String processError(String error, Object args, ApplContext ac) { + String sa[] = {args.toString()}; + return processError(error, sa, ac); + } + + private static String processError(String error, String arg1, + String arg2, ApplContext ac) { + String sa[] = {arg1, arg2}; + return processError(error, sa, ac); } } // InvalidParamException Index: Messages.properties.hu =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.hu,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Messages.properties.hu 3 Mar 2010 18:38:27 -0000 1.1 +++ Messages.properties.hu 17 Sep 2011 06:02:27 -0000 1.2 @@ -14,7 +14,7 @@ css2: CSS level 2 css21: CSS level 2.1 css3: CSS level 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobil Index: Messages.properties.fa =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.fa,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Messages.properties.fa 30 Mar 2009 19:00:26 -0000 1.4 +++ Messages.properties.fa 17 Sep 2011 06:02:27 -0000 1.5 @@ -12,7 +12,7 @@ css2: سطح 2 CSS css21: سطح 2.1 CSS css3: سطح 3 CSS -SVG: SVG +svg: SVG svgbasic: بیسیک SVG svgtiny: SVG tiny mobile: موبایل Index: Warning.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Warning.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Warning.java 29 Aug 2011 12:36:55 -0000 1.14 +++ Warning.java 17 Sep 2011 06:02:28 -0000 1.15 @@ -224,23 +224,21 @@ if (args != null) { StringBuilder sb = new StringBuilder(); int idx = 0; - int start = 0; - for (String subst : args) { - idx = str.indexOf("%s", idx); - if (idx < 0) { - // TODO report error + String[] msg_parts = str.split("%s", -1); + + sb.append(msg_parts[0]); + for (int i = 1; i < msg_parts.length; i++) { + if (idx < args.length) { + sb.append(args[idx++]); + } else { + // TODO report error System.err.println("*** WARNING ISSUE: "+warning); System.err.println("*** WARNING ISSUE: "+ac.getMsg().getWarningString(warning)); System.err.println("*** WARNING ISSUE: got "+args.length+" args entries"); - break; } - sb.append(str.substring(start, idx)); - sb.append(subst); - idx+=2; - start=idx; + sb.append(msg_parts[i]); } // and add the last part - sb.append(str.substring(start)); return sb.toString(); } return str; Index: Messages.properties.de =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.de,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- Messages.properties.de 26 Jul 2011 21:21:02 -0000 1.51 +++ Messages.properties.de 17 Sep 2011 06:02:27 -0000 1.52 @@ -14,7 +14,7 @@ css2: CSS level 2 css21: CSS level 2.1 css3: CSS level 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile @@ -372,4 +372,4 @@ parser.invalid_id_selector: Ungültiger ID-Selektor parser.import_not_allowed: @import-Regeln sind nach jeglichen gültigen Ausdrücken außer @charset und weiteren @import-Regeln verboten -error.bg_order: Gemäß der CSS3 Definition für Hintergründe muss 'bg_position' vor 'bg_size' gesetzt werden sofern beide Eigenschaften verwendet werden. \ No newline at end of file +error.bg_order: Gemäß der CSS3 Definition für Hintergründe muss 'bg_position' vor 'bg_size' gesetzt werden sofern beide Eigenschaften verwendet werden. Index: Messages.properties.bg =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.bg,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Messages.properties.bg 3 Aug 2011 10:15:36 -0000 1.12 +++ Messages.properties.bg 17 Sep 2011 06:02:27 -0000 1.13 @@ -13,7 +13,7 @@ css2: CSS level 2 css21: CSS level 2.1 css3: CSS level 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile @@ -385,4 +385,4 @@ warning.vendor-extension: Свойството %s е непознато разширение от разработчик vext_errors: Грешки vext_warnings: Предупреждения -vext_default: По подразбиране \ No newline at end of file +vext_default: По подразбиране Index: CssVersion.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/CssVersion.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssVersion.java 14 Sep 2011 16:31:50 -0000 1.1 +++ CssVersion.java 17 Sep 2011 06:02:27 -0000 1.2 @@ -17,7 +17,7 @@ return version; } - static CssVersion resolve(ApplContext ac, String s) + public static CssVersion resolve(ApplContext ac, String s) // throws InvalidParamException { { for (CssVersion v : CssVersion.values()) { @@ -31,7 +31,7 @@ } // get the default version of CSS - static public CssVersion getDefault() { + public static CssVersion getDefault() { return CSS21; } } Index: Messages.properties.fr =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.fr,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- Messages.properties.fr 6 Sep 2011 16:43:41 -0000 1.52 +++ Messages.properties.fr 17 Sep 2011 06:02:27 -0000 1.53 @@ -14,7 +14,7 @@ css2: CSS niveau 2 css21: CSS niveau 2.1 css3: CSS niveau 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile Index: CssProfile.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/CssProfile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssProfile.java 14 Sep 2011 16:31:50 -0000 1.1 +++ CssProfile.java 17 Sep 2011 06:02:27 -0000 1.2 @@ -6,7 +6,7 @@ package org.w3c.css.util; public enum CssProfile { - NONE("none"), SVG("svg"), SVGBASIC("svgbasic"), SVGTINY("svgtiny"), + EMPTY(""), NONE("none"), SVG("svg"), SVGBASIC("svgbasic"), SVGTINY("svgtiny"), MOBILE("mobile"), TV("tv"), ATSCTV("atsc-tv"); private final String profile; @@ -18,7 +18,7 @@ return profile; } - static CssProfile resolve(ApplContext ac, String s) + public static CssProfile resolve(ApplContext ac, String s) // throws InvalidParamException { { for (CssProfile p : CssProfile.values()) { @@ -28,7 +28,7 @@ } // TODO this or get the default ??? // throw new InvalidParamException("invalid-level", s, ac); - return NONE; + return EMPTY; } } Index: Messages.properties.ru =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.ru,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Messages.properties.ru 17 Jan 2011 14:17:19 -0000 1.14 +++ Messages.properties.ru 17 Sep 2011 06:02:28 -0000 1.15 @@ -14,9 +14,7 @@ css2: CSS2 css21: CSS2.1 css3: CSS3 -SVG: SVG -SVG_basic: SVG Basic -SVG_tiny: SVG tiny +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Мобильный Index: Messages.properties.ko =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.ko,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Messages.properties.ko 13 Jul 2011 13:46:37 -0000 1.19 +++ Messages.properties.ko 17 Sep 2011 06:02:27 -0000 1.20 @@ -14,7 +14,7 @@ css2: CSS 레벨 2 css21: CSS 레벨 2.1 css3: CSS 레벨 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG Tiny SVG_basic: <!-- SVG Basic , deprecated as per master language file --> Index: Messages.properties.es =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.es,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Messages.properties.es 25 Mar 2009 19:46:17 -0000 1.34 +++ Messages.properties.es 17 Sep 2011 06:02:27 -0000 1.35 @@ -14,7 +14,7 @@ css2: CSS versión 2 css21: CSS versión 2.1 css3: CSS versión 3 -SVG: SVG +svg: SVG svgbasic: SVG Básico svgtiny: SVG Reducido mobile: Móvil Index: Messages.properties.ro =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.ro,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Messages.properties.ro 7 Apr 2011 15:26:38 -0000 1.8 +++ Messages.properties.ro 17 Sep 2011 06:02:28 -0000 1.9 @@ -13,7 +13,7 @@ css2: CSS nivel 2 css21: CSS nivel 2.1 css3: CSS nivel 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG mic mobile: Mobile Index: Messages.properties.it =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/Messages.properties.it,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Messages.properties.it 16 Nov 2009 14:11:52 -0000 1.31 +++ Messages.properties.it 17 Sep 2011 06:02:27 -0000 1.32 @@ -14,7 +14,7 @@ css2: CSS versione 2 css21: CSS versione 2.1 css3: CSS versione 3 -SVG: SVG +svg: SVG svgbasic: SVG Basic svgtiny: SVG tiny mobile: Mobile Index: ApplContext.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/util/ApplContext.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ApplContext.java 14 Sep 2011 16:31:50 -0000 1.20 +++ ApplContext.java 17 Sep 2011 06:02:27 -0000 1.21 @@ -159,6 +159,10 @@ version = CssVersion.resolve(this, cssversion); } + public void setCssVersion(CssVersion version) { + this.version = version; + } + public String getCssVersionString() { return version.toString(); } @@ -171,6 +175,16 @@ this.profile = CssProfile.resolve(this, profile); } + /** + * get the String used to fetch the relevant property file + */ + public String getPropertyKey() { + if (profile != CssProfile.EMPTY && profile != CssProfile.NONE) { + return profile.toString(); + } + return version.toString(); + } + public CssProfile getCssProfile() { return profile; }
Received on Saturday, 17 September 2011 06:02:34 UTC