tdawson 01/10/18 06:28:19
Modified: i18n/src/org/apache/taglibs/i18n BundleTag.java
LocaleTag.java
i18n/xml i18n.xml
Log:
added localeRef to LocaleTag and BundleTag
deprecated localeAttribute from BundleTag
Revision Changes Path
1.5 +14 -3 jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java
Index: BundleTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BundleTag.java 2001/10/16 04:05:46 1.4
+++ BundleTag.java 2001/10/18 13:28:18 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java,v 1.4
2001/10/16 04:05:46 tdawson Exp $
- * $Revision: 1.4 $
- * $Date: 2001/10/16 04:05:46 $
+ * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/BundleTag.java,v 1.5
2001/10/18 13:28:18 tdawson Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/10/18 13:28:18 $
*
* ====================================================================
*
@@ -134,8 +134,19 @@
* Provides a key to search the page context for in order to get the
* locale of the bundle that the MessageTags will use when retrieving
* keys for this page.
+ * @deprecated
*/
public void setLocaleAttribute(String value)
+ {
+ _localeAttribute = value;
+ }
+
+ /**
+ * Provides a key to search the page context for in order to get the
+ * locale of the bundle that the MessageTags will use when retrieving
+ * keys for this page.
+ */
+ public void setLocaleRef(String value)
{
_localeAttribute = value;
}
1.4 +12 -4 jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java
Index: LocaleTag.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LocaleTag.java 2001/10/14 22:05:22 1.3
+++ LocaleTag.java 2001/10/18 13:28:18 1.4
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java,v 1.3
2001/10/14 22:05:22 tdawson Exp $
- * $Revision: 1.3 $
- * $Date: 2001/10/14 22:05:22 $
+ * $Header:
/home/cvs/jakarta-taglibs/i18n/src/org/apache/taglibs/i18n/LocaleTag.java,v 1.4
2001/10/18 13:28:18 tdawson Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/10/18 13:28:18 $
*
* ====================================================================
*
@@ -86,7 +86,7 @@
is used.
*
* @author James Strachan
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class LocaleTag extends TagSupport
{
@@ -167,6 +167,14 @@
public void setLocale(Locale locale)
{
this.locale = locale;
+ }
+
+ /**
+ * Provides a key to retrieve a locale via findAttribute()
+ */
+ public void setLocaleRef(String value)
+ {
+ this.locale = (Locale)pageContext.findAttribute(value);
}
public String getLanguage()
1.4 +26 -2 jakarta-taglibs/i18n/xml/i18n.xml
Index: i18n.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/i18n/xml/i18n.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- i18n.xml 2001/10/16 03:56:35 1.3
+++ i18n.xml 2001/10/18 13:28:18 1.4
@@ -106,7 +106,7 @@
<restrictions>
This tag must be placed early in the page (before any HTML) in order
for the output stream's content type to be set from the selected locale.
- If a locale (or localeAttribute) is not provided, the "best" locale
+ If a locale (or localeRef) is not provided, the "best" locale
will be determined from the browser settings and available locales
for the requested bundle.
</restrictions>
@@ -178,6 +178,7 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
+ DEPRECATED - use localeRef
Allows the page developer to provide the name of an attribute
whose value is the user's preferred locale. This attribute may
exist in the page, request, session, or application scope.
@@ -186,6 +187,18 @@
</attribute>
<attribute>
+ <name>localeRef</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Allows the page developer to provide the name of an attribute
+ whose value is the user's preferred locale. This attribute may
+ exist in the page, request, session, or application scope.
+ </description>
+ <availability>1.0</availability>
+ </attribute>
+
+ <attribute>
<name>debug</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -248,7 +261,7 @@
</comment>
<code>
<![CDATA[<i18n:bundle baseName="org.apache.taglibs.i18n.i18n-test"
- localeAttribute="userLocale"/>]]>
+ localeRef="userLocale"/>]]>
</code>
</usage>
</example>
@@ -650,6 +663,17 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
+ </description>
+ <availability>1.0</availability>
+ </attribute>
+ <attribute>
+ <name>localeRef</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Allows the page developer to provide the name of an attribute
+ whose value is the user's preferred locale. This attribute may
+ exist in the page, request, session, or application scope.
</description>
<availability>1.0</availability>
</attribute>