cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject cvs commit: xml-cocoon2/src/documentation/xdocs/howto howto-i18n-xmlform.xml
Date Fri, 01 Nov 2002 13:11:58 GMT
shannon     2002/11/01 05:11:58

  Modified:    src/documentation/xdocs/howto Tag: cocoon_2_0_3_branch
                        howto-i18n-xmlform.xml
  Log:
  General edits for grammar and
  readability.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +97 -71    xml-cocoon2/src/documentation/xdocs/howto/Attic/howto-i18n-xmlform.xml
  
  Index: howto-i18n-xmlform.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/howto/Attic/howto-i18n-xmlform.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- howto-i18n-xmlform.xml	1 Nov 2002 13:08:08 -0000	1.1.2.1
  +++ howto-i18n-xmlform.xml	1 Nov 2002 13:11:58 -0000	1.1.2.2
  @@ -2,7 +2,7 @@
   <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../dtd/document-v10.dtd">
   <document>
    <header>
  -  <title>How to Use i18n Transformer with XMLForm Framework</title>
  +  <title>i18n within the XMLForm Framework</title>
     <authors>
      <person name="Mohamed El-Refaey" email="m.refaey@imkenberg.de"/>
     </authors>
  @@ -12,29 +12,28 @@
   
   <s1 title="Overview">
   <p>
  -This How-To shows you how to use the i18n for web site Internationalization with XMLForm
Framework.
  -It requires prior knowledge of Cocoon XMLForm,XSLT,Schematron and i18n.
  +This How-To shows you how to use the i18n for web site internationalization with the XMLForm
Framework.
  +It requires prior knowledge of Cocoon XMLForm, XSLT, Schematron, and i18n.
   </p>
   </s1>
   
   <s1 title="Purpose">
   <p>
  -You will learn how to build a simple Login XMLForm and use i18n to make it multiLanguage-enabeled.
  -this How-To teaches you how to build this Form by yourself. Thus, you will get a better
feel
  -of how Cocoon XMLForm really works with i18n.
  +You will learn how to build a simple Login XMLForm and use i18n to make it multi-language
enabled.
  +This How-To teaches you how to build this form. Thus, you will get a better feel
  +for how Cocoon XMLForm really works with i18n.
   </p>
   </s1>
   
   <s1 title="Intended Audience">
   <p>
  -Cocoon users who want to learn how to use the i18n for web site Internationalization with
XMLForm Framework .
  +Cocoon users who want to learn how to use the i18n for web site internationalization with
the XMLForm Framework.
   </p>
   </s1>
   
   <s1 title="Prerequisites">
   
  -<p>Here's what you need:</p>
  -<p>Cocoon must be running on your system. The steps below have been tested with Cocoon
2.1-dev .</p>
  +<p>Cocoon must be running on your system. The steps below have been tested with Cocoon
2.1-dev.</p>
        <p>You will need the following:</p>
   
         <ul>
  @@ -48,9 +47,10 @@
   
         <source>build -Dinclude.webapp.libs=true webapp</source>
   
  -      <p>You will need to understand and be familiar with  XSL,i18n,XForms, XPath,
Schematron. If you
  +      <p>You will need to understand and be familiar with XSL, i18n, XForms, XPath,
and Schematron. If you
         are unfamiliar with these technologies, it is advised that you learn
  -      such concepts first.</p>
  +      these related concepts first. If you are unfamiliar with XMLForm, check out the <link
href="xmlform-wizard/howto-xmlform-wizard.html">
  +XMLForm Wizard How-To</link> first.</p>
   
   
   </s1>
  @@ -95,36 +95,35 @@
   
   <s2 title="2. Create the Schematron file" >
   <p>
  -Create the Schematron validation file <strong>general-schema.xml</strong> and
insert the following validation Pattern for the Login XMLForm</p>
  +Create the Schematron validation file <strong>general-schema.xml</strong> and
insert the following validation pattern for the Login XMLForm.</p>
   <p>
  -Below is a snippt code of this Pattern:</p>
  +Here is a snippet of this pattern:</p>
    <source><![CDATA[
   <pattern name="Login Info Validation Pattern" id="login">
  -	<rule context="/email">
  -		<assert test="contains( string(.),'@')">
  -            Email format is invalid.
  -        </assert>
  -	</rule>
  -    <rule context="/password">
  -		<assert test="string-length(.) &gt; 7">
  -            The Password Should be @ least 8 character.
  -        </assert>
  -	</rule>
  +  <rule context="/email">
  +    <assert test="contains( string(.),'@')">
  +      Email format is invalid.
  +    </assert>
  +  </rule>
  +  <rule context="/password">
  +    <assert test="string-length(.) &gt; 7">
  +      The Password Should be @ least 8 characters.
  +    </assert>
  +  </rule>
   </pattern>
           ]]></source>
   </s2>
   
  -<s2 title="3. Create a simple XSLT file for the Validation Error Messages " >
  +<s2 title="3. Create a simple XSLT file for the validation error messages " >
   <p>
  -create a simple XSLT stylesheet file to match the Violation tag in the XMLForm file and
put it in the sitemap after the XMLForm Transformer.
  -    the code of this stylesheet is as follow :
  +Create a simple XSLT stylesheet file to match the violation element in the XMLForm file,
and place it in the sitemap after the XMLForm Transformer. The code of this stylesheet is
as follows:
   </p>
          <source><![CDATA[
   <?xml version="1.0"?>
   <xsl:stylesheet version="1.0"
  -               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  -               xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002"
  -               xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
  +    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  +    xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002"
  +    xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
   
   <xsl:template match="document">
        <document>
  @@ -149,36 +148,41 @@
   </xsl:stylesheet>
   ]]></source>
   <note>       
  -Basically this snippet is matching the Violation tag on the form file and apply the i18n
translation on the
  -resulting error messages if there is any violation on the entered data.
  +Basically this snippet is matching the violation element on the form file. If any violations
on the entered data occur, it applies the i18n translation on the resulting error messages.
   </note>
   
   </s2>
   
  -<s2 title="4. Create the Cataloge messages file" >
  +<s2 title="4. Create the catalog messages file" >
   <p>
  -create the Cataloge file that contain your error messages and all what you want to be translated.
  -    a code snippet of the catalog file is as follow:
  +Create the catalog file that contains your error messages and all what you want to be translated.
Here is a snippet from the catalog file:
   </p>
  +
         <source><![CDATA[
   <?xml version="1.0" encoding="UTF-8"?>
   
   <!-- Default English message catalogue file for cocoon2 sample webapp -->
   
   <catalogue xml:lang="en">
  -    <!-- the Login Form keywords -->
  -    <message key="Email Address">Email Address</message>
  -    <message key="Password">Password</message>
  -    <message key="Login">Login</message>
  -
  -    <!-- Validation error messages for Login XMLform -->
  -    <message key="Email format is invalid.">Email format is invalid.</message>
  -    <message key="The Password Should be @ least 8 character.">The Password Should
be at least 8 character.</message>
  +  <!-- the Login Form keywords -->
  +  <message key="Email Address">Email Address</message>
  +  <message key="Password">Password</message>
  +  <message key="Login">Login</message>
  +
  +  <!-- Validation error messages for Login XMLform -->
  +  <message key="Email format is invalid.">
  +    Email format is invalid.
  +  </message>
  +  <message key="The Password Should be @ least 8 characters.">
  +    The Password Should be at least 8 characters.
  +  </message>
   </catalogue>
   
           ]]></source>
   
  -<p>also the second language Cataloge file is as follow (for e.g German) :</p>
  +<p>Here is a snippet from a second catalog language file, in this case, for German:</p>
  +
  +<fixme author="ds">Do we need an entity for the character in the German translation
of invalid?</fixme>
       <source><![CDATA[
   <?xml version="1.0" encoding="UTF-8"?>
   
  @@ -191,46 +195,52 @@
       <message key="Login">Login</message>
   
       <!-- Validation error messages for Login Form Xform-->
  -    <message key="Email format is invalid.">Email-format ist ungültig.</message>
  -    <message key="The Password Should be @ least 8 character.">Das Passwort sollte
wenigsten 8 Zeichen haben.[translated message]</message>
  +    <message key="Email format is invalid.">
  +      Email-format ist ungültig.
  +    </message>
  +    <message key="The Password Should be @ least 8 characters.">
  +      Das Passwort sollte wenigsten 8 Zeichen haben.[translated message]
  +    </message>
   </catalogue>
   
           ]]></source>
   </s2>
   
  -<s2 title="5. Sitemap" >
  +<s2 title="5. Create a Sitemap match element" >
   <p>
  -Here we reach to the end of this How To by putting the sitemap snippet of this sample:
  +Now we reach to the end of this How-To by showing the sitemap snippet for this sample:
   </p>
   
       <source><![CDATA[
   <map:match pattern="do-login">
  -    <map:act type="LoginAction">
  -        <map:parameter name="xmlform-validator-schema-ns" value="http://www.ascc.net/xml/schematron"/>
  -        <map:parameter name="xmlform-validator-schema" value="xforms/schematron/general-schema.xml"/>
  -        <map:parameter name="xmlform-id" value="form-login"/>
  -        <map:parameter name="xmlform-scope" value="session"/>
  -        <map:parameter name="xmlform-model" value="com.imkenberg.webshop.xforms.LoginBean"/>
  -        <map:generate src="xforms/xmlforms/login/{page}.xml"/>
  -        <map:transform type="xmlform" label="xml"/>
  -        <map:transform src="xforms/stylesheets/translate.xsl"/>
  -            <map:act type="locale">
  -                <map:transform type="i18n">
  -                <map:parameter name="locale" value="{locale}"/>
  -                </map:transform>
  -            </map:act>
  -        <map:transform src="xforms/stylesheets/wizard2html.xsl"/>
  -        <map:transform src="xforms/stylesheets/xmlform2html.xsl"/>
  -            <map:act type="locale">
  -                <map:transform type="i18n">
  -                    <map:parameter name="locale" value="{locale}"/>
  -                </map:transform>
  -            </map:act>
  +  <map:act type="LoginAction">
  +    <map:parameter name="xmlform-validator-schema-ns" 
  +      value="http://www.ascc.net/xml/schematron"/>
  +    <map:parameter name="xmlform-validator-schema" 
  +      value="xforms/schematron/general-schema.xml"/>
  +    <map:parameter name="xmlform-id" value="form-login"/>
  +    <map:parameter name="xmlform-scope" value="session"/>
  +    <map:parameter name="xmlform-model" 
  +      value="com.imkenberg.webshop.xforms.LoginBean"/>
  +    <map:generate src="xforms/xmlforms/login/{page}.xml"/>
  +    <map:transform type="xmlform" label="xml"/>
  +    <map:transform src="xforms/stylesheets/translate.xsl"/>
  +	<map:act type="locale">
  +      <map:transform type="i18n">
  +        <map:parameter name="locale" value="{locale}"/>
  +      </map:transform>
       </map:act>
  +	<map:transform src="xforms/stylesheets/wizard2html.xsl"/>
  +	<map:transform src="xforms/stylesheets/xmlform2html.xsl"/>
  +	<map:act type="locale">
  +      <map:transform type="i18n">
  +		<map:parameter name="locale" value="{locale}"/>
  +      </map:transform>
  +	</map:act>
  +  </map:act>
     <map:serialize type="html"/>
   </map:match>
               ]]></source>
  -
   </s2>
   
   
  @@ -238,8 +248,8 @@
   
   <s1 title="Summary">
   <p>
  -This How To now enable you to use i18n Transformer and XMLForm Framewrok and also the Translation
of the Violation Error messages resulted from the Shematron Validation.
  -I hope you're beginning to see that you find this How To simple and easy to follow.
  +This How-To enables you to use i18n Transformer and XMLForm Framework as well as to translate
any violation error messages resulting from Shematron validation.
  +I hope you have found this How-To easy to follow.
   </p>
   
   </s1>
  @@ -274,6 +284,22 @@
   <link href="mailto:m.refaey@imkenberg.de">Mohamed El-Refaey</link>.
   </p>
   </s1>
  +
  +  <s1 title="Revisions">
  +  <p>
  +10-30-02: First version contributed by Mohamed El-Refaey. 
  +  </p>
  +  <p>
  +10-31-02: "Real" German translations added by Michael Enke. 
  +  </p>
  +  <p>
  +10-31-02: Revised by Mohamed El-Refaey to clarify examples. 
  +  </p>
  +  <p>
  +11-01-02: Edited by Diana Shannon.
  +  </p>
  +  </s1>
  +
   
   </body>
   </document>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message