svn commit: r668103 - in /lenya/trunk/src: pubs/default/lenya/resources/i18n/cmsui.xml pubs/default/lenya/resources/i18n/cmsui_de.xml pubs/default/xslt/page2xhtml.xsl webapp/lenya/xslt/util/string-functions.xsl

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Jun 16 03:23:20 2008
New Revision: 668103

URL: http://svn.apache.org/viewvc?rev=668103&view=rev
Log:
Use publication ID in publication title.

Modified:
    lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml
    lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml
    lenya/trunk/src/pubs/default/xslt/page2xhtml.xsl
    lenya/trunk/src/webapp/lenya/xslt/util/string-functions.xsl

Modified: lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml?rev=668103&r1=668102&r2=668103&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml (original)
+++ lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui.xml Mon Jun 16 03:23:20 2008
@@ -24,7 +24,7 @@
 
 <catalogue xml:lang="en" xmlns="http://apache.org/cocoon/i18n/2.1">
   
-  <message key="publication-title">Welcome to the Default Publication from {0}!</message>
+  <message key="publication-title">Welcome to the {0} Publication from {1}!</message>
  
   <message key="default.createdoc.idtaken">The ID you've entered is already taken. Please choose another one.</message>
  

Modified: lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml?rev=668103&r1=668102&r2=668103&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml (original)
+++ lenya/trunk/src/pubs/default/lenya/resources/i18n/cmsui_de.xml Mon Jun 16 03:23:20 2008
@@ -24,7 +24,7 @@
 
 <catalogue xml:lang="de" xmlns="http://apache.org/cocoon/i18n/2.1">
 
-  <message key="publication-title">Willkommen zur Default-Publikation von {0}!</message>
+  <message key="publication-title">Willkommen zur {0}-Publikation von {1}!</message>
   
   <message key="default.doc.create.idtaken">Die eingebene ID ist schon vergeben. Bitte wählen Sie eine andere ID.</message>
 

Modified: lenya/trunk/src/pubs/default/xslt/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/xslt/page2xhtml.xsl?rev=668103&r1=668102&r2=668103&view=diff
==============================================================================
--- lenya/trunk/src/pubs/default/xslt/page2xhtml.xsl (original)
+++ lenya/trunk/src/pubs/default/xslt/page2xhtml.xsl Mon Jun 16 03:23:20 2008
@@ -28,6 +28,8 @@
   exclude-result-prefixes="xhtml lenya"
   >
   
+  <xsl:import href="context://lenya/xslt/util/string-functions.xsl"/>
+  
   <xsl:param name="publication-id"/>
   <xsl:param name="area"/>
   <xsl:param name="uuid"/>
@@ -72,8 +74,14 @@
           <table width="100%" cellpadding="0" cellspacing="0" border="0">
             <tr>
               <td id="publication-title">
+                <xsl:variable name="pubTitle">
+                  <xsl:call-template name="capitalize">
+                    <xsl:with-param name="text" select="$publication-id"/>
+                  </xsl:call-template>
+                </xsl:variable>
                 <i18n:translate>
                   <i18n:text>publication-title</i18n:text>
+                  <i18n:param><xsl:value-of select="$pubTitle"/></i18n:param>
                   <i18n:param><xsl:value-of select="$author"/></i18n:param>
                 </i18n:translate>
               </td>

Modified: lenya/trunk/src/webapp/lenya/xslt/util/string-functions.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/xslt/util/string-functions.xsl?rev=668103&r1=668102&r2=668103&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/util/string-functions.xsl (original)
+++ lenya/trunk/src/webapp/lenya/xslt/util/string-functions.xsl Mon Jun 16 03:23:20 2008
@@ -30,5 +30,18 @@
   </xsl:choose>
   
 </xsl:template>
+  
+  <!--
+    Transform the first letter of a string to uppercase. Works only with latin characters.
+  -->
+  <xsl:template name="capitalize">
+    <xsl:param name="text"/>
+    <xsl:if test="string-length($text) &gt; 0">
+      <xsl:variable name="firstLetter" select="substring($text, 1, 1)"/>
+      <xsl:value-of select="translate($firstLetter, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
+      <xsl:text/>
+      <xsl:value-of select="substring($text, 2)"/>
+    </xsl:if>
+  </xsl:template>
 
 </xsl:stylesheet>
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.