Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" 
for change notification.

The following page has been changed by AndreasBulling:
http://wiki.apache.org/jakarta-tapestry/CustomTagsInShell

The comment on the change is:
Added check for locale

------------------------------------------------------------------------------
  An example ShellDelegate bean could look like:
  
  {{{
+ import java.util.Locale;
+ 
+ import org.apache.tapestry.IMarkupWriter;
+ import org.apache.tapestry.IRender;
+ import org.apache.tapestry.IRequestCycle;
+ 
  public class ShellDelegate implements IRender
  {
        public void render(IMarkupWriter writer, IRequestCycle cycle)
@@ -33, +39 @@

                addMetaTag(writer, "author", "YOUR_NAME");
                addMetaTag(writer, "robots", "Index,Follow");
                
+               Locale locale = cycle.getEngine().getLocale();
+               if (locale.getLanguage().equals(new Locale("de", "", 
"").getLanguage()))
+               {
-               addMetaTag(writer, "description", "DESCRIPTION");
+                       addMetaTag(writer, "description", "DESCRIPTION");
-               addMetaTag(writer, "keywords", "KEYWORDS" );
+                       addMetaTag(writer, "keywords", "KEYWORDS" );
+               }
        }
  
        private void addMetaTag(IMarkupWriter writer, String key, String value)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to