- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 27 Nov 2007 01:44:30 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/index In directory hutz:/tmp/cvs-serv8272/org/w3c/css/index Modified Files: TranslationTableGenerator.java translations.vm Log Message: sorted table with links for translation submission Index: TranslationTableGenerator.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/index/TranslationTableGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TranslationTableGenerator.java 26 Nov 2007 07:02:46 -0000 1.1 +++ TranslationTableGenerator.java 27 Nov 2007 01:44:28 -0000 1.2 @@ -21,6 +21,9 @@ import org.apache.commons.lang.StringEscapeUtils; import java.util.HashMap; import java.util.Iterator; +import java.util.Vector; +import java.util.Collections; +import java.util.Comparator; import org.w3c.css.util.ApplContext; import org.w3c.css.util.Messages; import org.w3c.css.util.Utf8Properties; @@ -31,6 +34,14 @@ * * */ +class AlphaComparator implements Comparator { + public int compare(Object o1, Object o2) { + String s1 = (String) o1; + String s2 = (String) o2; + return s1.toLowerCase().compareTo(s2.toLowerCase()); + } +} + public class TranslationTableGenerator { // the velocity context used to generate the index @@ -81,10 +92,15 @@ languages[i] = l; ApplContext ac_translated = new ApplContext(name); translations.put(name,ac_translated); - translations_table = translations_table + "<th scope=\"col\">"+l.get("real")+"</th>"; + if (!name.equals(default_lang)){ + translations_table = translations_table + "<th scope=\"col\">"+l.get("real")+"</th>"; + } } vc.put("languages", languages); - Iterator properties_iterator = ac_default.getMsg().properties.keySet().iterator(); + vc.put("num_languages", Messages.languages_name.size()); + Vector sorted_properties_keys = new Vector(ac_default.getMsg().properties.keySet()); + Collections.sort(sorted_properties_keys, new AlphaComparator()); + Iterator properties_iterator = sorted_properties_keys.iterator(); translations_table = translations_table + "</tr>"; while (properties_iterator.hasNext()) { String property_name = String.valueOf(properties_iterator.next()); @@ -97,15 +113,18 @@ if (language.get("name").equals(default_lang)) { vc.put(property_name, property_translated); } - if (property_translated == null) { - translations_table = translations_table + "<td class=\"table_translation_missing\">✘</td>"; - } - else if ( property_translated.matches(".*translation unavailable.*")){ - translations_table = translations_table + "<td class=\"table_translation_missing\"><span title=\""+StringEscapeUtils.escapeHtml(property_translated)+"\">✘</span></td>"; - } else { - translations_table = translations_table + "<td class=\"table_translation_ok\"><span title=\""+StringEscapeUtils.escapeHtml(property_translated)+"\">✔</span></td>"; - } + URI mail_translation = new URI("mailto", "w3c-translators@w3.org?Subject=["+property_name+"] CSS Validator Translation&body=Property:\n "+property_name+"\n\nText in English:\n "+ac_default.getMsg().getString(property_name)+"\n\nLanguage:\n "+language.get("name")+"\n\nTranslation:\n\n\n-- Help translate the CSS Validator:\nhttp://qa-dev.w3.org:8001/css-validator/translations.html", ""); + if (property_translated == null) { + translations_table = translations_table + "<td class=\"table_translation_missing\"><a title=\"submit a missing translation\" href=\""+StringEscapeUtils.escapeHtml(mail_translation.toASCIIString())+"\">✘</a></td>\n"; + } + else if ( property_translated.matches(".*translation unavailable.*")){ + translations_table = translations_table + "<td class=\"table_translation_missing\"><a title=\"submit a missing translation\" href=\""+StringEscapeUtils.escapeHtml(mail_translation.toASCIIString())+"\">✘</a></td>\n"; + } + else { + translations_table = translations_table + "<td class=\"table_translation_ok\"><span title=\""+StringEscapeUtils.escapeHtml(property_translated)+"\">✔</span></td>\n"; + } + } } translations_table = translations_table + "</tr>"; } Index: translations.vm =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/index/translations.vm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- translations.vm 26 Nov 2007 07:02:46 -0000 1.1 +++ translations.vm 27 Nov 2007 01:44:28 -0000 1.2 @@ -1,7 +1,10 @@ #parse("./header.vm") <div class="intro"> -<h2>W3C CSS Validator localization</h2><p>This table lists all the text strings used to translate the CSS validator in many languages.</p><p> Cells marked <span class='table_translation_missing'>✘</span> need a new or updated translation. Cells marked <span class='table_translation_ok'>✔</span> are translated and up-to-date.</p> -<p>Hover above each ✘ or ✔ to read the current translation for each string.</p> +<h2>Translation of the W3C CSS Validator</h2> +<p>The CSS Validation service is currently available in $num_languages languages. The table below lists all the text strings used to translate the CSS validator:</p> +<p>Cells marked <span class='table_translation_missing'><a title="Cross Mark">✘</a></span> need a new or updated translation. Click on the relevant ✘ to submit a translation by mail.</p> +<p>Cells marked <span class='table_translation_ok'>✔</span> are translated and up-to-date. Hover above ✔ to read the current translation for each string.</p> +<p>You can help fill the blanks and complete the translation in <strong>your</strong> language!</p> </div> $translations_table #parse("./footer.vm")
Received on Tuesday, 27 November 2007 01:44:39 UTC