Changeset 26409

Show
Ignore:
Timestamp:
30.10.2012 15:05:04 (7 years ago)
Author:
kjdon
Message:

got the language swap javascript out of the properties file and into the xsl file. No translator wants to see that stuff\!

Location:
main/trunk/model-cols/niupepa
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/model-cols/niupepa/resources/niupepa.properties

    r26388 r26409  
    1717 
    1818simple.query=Search {0-subcolllist} for {1-some/all} of the words {2-query box} 
    19  
    20 about.languageswap=<div style="text-align:right;"><small><a id="replaceLink" title="View the collection in Māori">Māori</a></small></div>\ 
    21 <script type="text/javascript">\ 
    22     <xsl:text disable-output-escaping="yes">\ 
    23         $(window).ready(function()\ 
    24         {\ 
    25             var url = document.URL;\ 
    26             if(url.indexOf("?") != -1)\ 
    27             {\ 
    28                 if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)\ 
    29                 {\ 
    30                     url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1l=mi");\ 
    31                     $("#replaceLink").attr("href", url);\ 
    32                 }\ 
    33                 else\ 
    34                 {\ 
    35                     $("#replaceLink").attr("href", url + "&amp;l=mi");\ 
    36                 }\ 
    37             }\ 
    38             else\ 
    39             {\ 
    40                 $("#replaceLink").attr("href", url + "?l=mi");\ 
    41             }\ 
    42         });\ 
    43     </xsl:text>\ 
    44 </script> 
    45  
     19about.changelangtofrommaori=View the collection in Māori 
    4620about.textxwelcome=<h2>Welcome to the Māori Niupepa Collection</h2> 
    4721about.textxwelcome2=<p>Here we have a collection of historic newspapers published primarily for a Māori audience between 1842 and 1932. The newspapers can be <gsf:link type="query"><b>searched</b></gsf:link> (full text), <gsf:link type="classifier" nodeID="CL1"><b>browsed</b></gsf:link> (by series) or accessed by <gsf:link type="classifier" nodeID="CL2"><b>date</b></gsf:link>. This collection has been made available by the <a href="http://www.nzdl.org">New Zealand Digital Library Project</a>, at the <a href="http://www.cs.waikato.ac.nz/cs/">Department of Computer Science</a>, <a href="http://www.waikato.ac.nz">University of Waikato</a>.</p> 
  • main/trunk/model-cols/niupepa/resources/niupepa_mi.properties

    r26365 r26409  
    1616 
    1717simple.query=Tirohia ki {0-subcolllist} mō {1-some/all} o ngā kupu {2-query box} 
    18  
    19 about.languageswap=<div style="text-align:right;"><small><a id="replaceLink" title="View the collection in English">English</a></small></div>\ 
    20 <script type="text/javascript">\ 
    21     <xsl:text disable-output-escaping="yes">\ 
    22         $(window).ready(function()\ 
    23         {\ 
    24             var url = document.URL;\ 
    25             if(url.indexOf("?") != -1)\ 
    26             {\ 
    27                 if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)\ 
    28                 {\ 
    29                     url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1l=en");\ 
    30                     $("#replaceLink").attr("href", url);\ 
    31                 }\ 
    32                 else\ 
    33                 {\ 
    34                     $("#replaceLink").attr("href", url + "&amp;l=en");\ 
    35                 }\ 
    36             }\ 
    37             else\ 
    38             {\ 
    39                 $("#replaceLink").attr("href", url + "?l=en");\ 
    40             }\ 
    41         });\ 
    42     </xsl:text>\ 
    43 </script> 
    44  
     18about.changelangtofrommaori=View the collection in English 
    4519about.textxwelcome=<h2>Nau mai ki te Kohikohinga Niupepa Māori</h2> 
    4620about.textxwelcome2=<p>Kua whakaemitia mai ki konei he kohikohinga niupepa i tāngia mō ngā kaipānui Māori o ngā tau 1842-1932. E taea te pānui niupepa mā te <gsf:link type="query">rapu kupu</gsf:link>, i te <gsf:link type="classifier" nodeID="CL1">rārangi taitara</gsf:link>, me te rārangi <gsf:link type="classifier" nodeID="CL2">wātaka</gsf:link> hoki. He mea i whakatÅ«ria e te kaupapa <a href="http://www.nzdl.org">New Zealand Digital Library</a>, i te <a href="http://www.cs.waikato.ac.nz/cs/">Tari Rorohiko</a>, o te <a href="http://www.waikato.ac.nz">Whare Wānanga o Waikato</a>.</p> 
  • main/trunk/model-cols/niupepa/transform/pages/about.xsl

    r26348 r26409  
    2020    <!-- the page content --> 
    2121    <xsl:template match="/page"> 
    22         <gsf:collectionText name="about.languageswap"/> 
     22        <xsl:call-template name="languageswap"/> 
    2323        <gsf:collectionText name="about.textxwelcome"/> 
    2424        <gsf:collectionText name="about.textxwelcome2"/> 
     
    3838        <gsf:collectionText name="about.textxsupporgs2"/> 
    3939    </xsl:template>  
     40 
     41<xsl:template name="languageswap"> 
     42    <xsl:variable name="swaplangname"><xsl:choose><xsl:when test="/page/@lang = 'mi'">English</xsl:when><xsl:otherwise>Māori</xsl:otherwise></xsl:choose></xsl:variable> 
     43<div style="text-align:right;"><small><a id="replaceLink"><xsl:attribute name="title"><gsf:collectionText name="about.changelangtofrommaori"/></xsl:attribute><xsl:value-of select="$swaplangname"/></a></small></div> 
     44    <xsl:variable name="langcgiarg"><xsl:choose><xsl:when test="/page/@lang = 'mi'">l=en</xsl:when><xsl:otherwise>l=mi</xsl:otherwise></xsl:choose></xsl:variable> 
     45<script type="text/javascript"> 
     46    <xsl:text disable-output-escaping="yes"> 
     47        $(window).ready(function() 
     48        { 
     49            var url = document.URL; 
     50            if(url.indexOf("?") != -1) 
     51            { 
     52                if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1) 
     53                { 
     54                    url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">"); 
     55                    $("#replaceLink").attr("href", url); 
     56                } 
     57                else 
     58                { 
     59                    $("#replaceLink").attr("href", url + "&amp;</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">"); 
     60                } 
     61            } 
     62            else 
     63            { 
     64                $("#replaceLink").attr("href", url + "?</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">"); 
     65            } 
     66        }); 
     67    </xsl:text> 
     68</script> 
     69 
     70</xsl:template> 
    4071</xsl:stylesheet>   
    4172