Changeset 7576
- Timestamp:
- 03/12/07 19:36:41 (22 months ago)
- Location:
- trunk/buildscripts
- Files:
-
- 3 modified
-
build.xml (modified) (4 diffs)
-
cldrArrayInherit.js (modified) (3 diffs)
-
cldrCurrency.xsl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/build.xml
r7575 r7576 41 41 <property name="profile" value=""/> 42 42 <property name="locales" value="en-gb,en-us,de-de,es-es,fr-fr,it-it,pt-br,ko-kr,zh-tw,zh-cn,ja-jp"/> <!-- FIXME: where should this list come from? --> 43 <property name="currencies" value="GBP,USD,CAD,AUD,EUR,CHF,HKD,JPY"/> <!-- FIXME: arbitrary list. Can be altered or eliminated for all currencies --> 43 44 <property name="cldrIn" location="${root}/cldr"/> 44 45 <property name="cldrOut" location="${root}/${src}/i18n/cldr"/> … … 313 314 <saxon in="@{in}" style="${cldrIn}/ldml/main/cldrCalendar.xsl" destdir="@{destdir}"/> 314 315 <saxon in="@{in}" style="${cldrIn}/ldml/main/cldrNumber.xsl" destdir="@{destdir}"/> 316 <saxon in="@{in}" style="${cldrIn}/ldml/main/cldrCurrency.xsl" destdir="@{destdir}"/> 315 317 <echo level="info" message="Transformed @{in} to @{destDir}" taskName="cldr"/> 316 318 <removeEmptyOutput dir="@{destdir}" /> … … 339 341 <arg file="@{in}"/> 340 342 <arg file="@{style}"/> 343 <arg value="currencyList=${currencies}"/> 341 344 </java> 342 345 </sequential> … … 374 377 </copy> 375 378 376 <delete dir="${cldrOut}/nls" includeemptydirs="yes"/>379 <delete dir="${cldrOut}/nls" /> 377 380 <transformCldr destdir="${cldrOut}/nls"> 378 381 <fileset dir="${cldrIn}/ldml/main" includes="**/*.xml" /> -
trunk/buildscripts/cldrArrayInherit.js
r7213 r7576 41 41 dojo.require("dojo.lang.array"); 42 42 dojo.require("dojo.lang.common"); 43 dojo.require("dojo.i18n.loader"); 43 44 dojo.require("dojo.json"); 44 45 … … 57 58 if(locale=="nls"){continue;} // don't run on ROOT resource 58 59 var hasChanged = false; 59 60 dojo.hostenv.searchLocalePath(locale, true, function(variant) { 60 dojo.i18n._searchLocalePath(locale, true, function(variant){ 61 61 var isComplete = false; 62 62 var path = jsPath; … … 99 99 return isComplete; 100 100 }); 101 102 101 if(hasChanged){ 103 102 buildUtil.saveUtf8File(jsFileName, dojo.json.serialize(data)); -
trunk/buildscripts/cldrCurrency.xsl
r7204 r7576 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xsl:stylesheet xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">2 <xsl:stylesheet xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" extension-element-prefixes="saxon" version="2.0"> 3 3 <xsl:output method="text" indent="yes"/> 4 <xsl:strip-space elements="*"/> 5 4 <!-- list the data elements whose spaces should be preserved 5 it seems listing only the parent node doesn't work --> 6 <xsl:preserve-space elements="displayName symbol"/> 7 <xsl:strip-space elements="*"/> 8 9 <!-- currencyList is an external string property like "AUD|BEF|CAD|CHF|CNY|DEM|...|USD", 10 if it is provided, only those currencies in this list will be extracted, 11 otherwise all the currencies will be extracted by default--> 12 <xsl:param name="currencyList"></xsl:param> 13 <xsl:variable name="first" select="true()" saxon:assignable="yes"/> 14 6 15 <xsl:template match="/"> 7 16 <xsl:apply-templates/> 8 17 </xsl:template> 9 18 10 19 <!-- process ldml, numbers and currencies --> 11 20 <xsl:template name="top" match="/ldml"> … … 24 33 <xsl:choose> 25 34 <xsl:when test="name()='currencies'"> 26 <!-- currencies --> 27 <xsl:for-each select="currency"> 28 <xsl:value-of select="@type"></xsl:value-of> 29 <xsl:result-document href="{concat(@type,'.js')}" encoding="UTF-8">// generated from cldr/ldml/main/*.xml, xpath: ldml/numbers/currencies 30 ({<xsl:call-template name="currency"></xsl:call-template> 35 <xsl:result-document href="currency.js" encoding="UTF-8">// generated from cldr/ldml/main/*.xml, xpath: ldml/numbers/currencies 36 ({<xsl:choose><xsl:when test="string-length(string($currencyList))>0"> 37 <xsl:for-each select="currency"> 38 <xsl:if test="contains($currencyList,@type)"> 39 <xsl:call-template name="currency"></xsl:call-template> 40 </xsl:if> 41 </xsl:for-each> 42 </xsl:when> 43 <xsl:otherwise> 44 <xsl:for-each select="currency"> 45 <xsl:call-template name="currency"></xsl:call-template> 46 </xsl:for-each> 47 </xsl:otherwise> 48 </xsl:choose> 31 49 }) 32 </xsl:result-document> 33 </xsl:for-each> 50 </xsl:result-document> 34 51 </xsl:when> 35 52 <xsl:otherwise> 36 53 <xsl:if test="name()='ldml'"> 37 54 <!-- ldml --> 38 <xsl:for-each select="numbers"> 55 <xsl:for-each select="numbers"> 39 56 <xsl:call-template name="top"></xsl:call-template> 40 57 </xsl:for-each> … … 67 84 </xsl:when> 68 85 <xsl:otherwise> 69 <xsl:for-each select="*[not(@draft)] | *[@draft!='provisional' and @draft!='unconfirmed']"> 70 '<xsl:value-of select="name()"></xsl:value-of> 71 <xsl:text>': "</xsl:text> 72 <xsl:value-of select="replace(.,'"', '\\"')"></xsl:value-of> 73 <xsl:text>"</xsl:text> 74 <xsl:if test="count((following-sibling::node())[not(@draft)] 75 | *[@draft!='provisional' and @draft!='unconfirmed']) > 0 "> 76 <xsl:text>,</xsl:text> 77 </xsl:if> 78 </xsl:for-each> 86 <xsl:if test="count(./* [(not(@draft) or @draft!='provisional' and @draft!='unconfirmed')]) > 0"> 87 <xsl:call-template name="insert_comma"/> 88 <xsl:text> 89 </xsl:text> 90 <xsl:value-of select="@type"></xsl:value-of> 91 <xsl:text>:{</xsl:text> 92 <xsl:for-each select="*[not(@draft)] | *[@draft!='provisional' and @draft!='unconfirmed']"> 93 <xsl:value-of select="name()"></xsl:value-of> 94 <xsl:text>:"</xsl:text> 95 <xsl:value-of select="replace(.,'"', '\\"')"></xsl:value-of> 96 <xsl:text>"</xsl:text> 97 <xsl:if test="count((following-sibling::node())[not(@draft)] 98 | *[@draft!='provisional' and @draft!='unconfirmed']) > 0 "> 99 <xsl:text>, </xsl:text> 100 </xsl:if> 101 </xsl:for-each> 102 <xsl:text>}</xsl:text> 103 </xsl:if> 79 104 </xsl:otherwise> 80 105 </xsl:choose> … … 124 149 </xsl:template> 125 150 151 <xsl:template name="insert_comma"> 152 <xsl:choose> 153 <xsl:when test="$first"> 154 <saxon:assign name="first" select="false()"/> 155 </xsl:when> 156 <xsl:otherwise> 157 <xsl:text>,</xsl:text> 158 </xsl:otherwise> 159 </xsl:choose> 160 </xsl:template> 161 126 162 </xsl:stylesheet>