diff options
author | Peter Bernard West <pbwest@apache.org> | 2004-05-29 19:25:59 +0000 |
---|---|---|
committer | Peter Bernard West <pbwest@apache.org> | 2004-05-29 19:25:59 +0000 |
commit | 533115e15a26564b13f2d90015812109bafd7837 (patch) | |
tree | 11eb21c7f7e34556d8d22d4e6c4c9c7da09239c3 | |
parent | d0f4ff0cad002c245b6f197458e83ad060e69157 (diff) | |
download | xmlgraphics-fop-533115e15a26564b13f2d90015812109bafd7837.tar.gz xmlgraphics-fop-533115e15a26564b13f2d90015812109bafd7837.zip |
Added ISO 639-1 2-letter language code support.
Note: there has been a change in the draft Recommendation,
such that <language> is now defined as either an ISO 639-2
3-letter code or an ISO 639-1 2-letter code. As RFC 3066,
to which xml:lang values are supposed to conform, expresses
a preference for ISO 639-1, and Java Locales are built from
the 2-letter codes, this was necessary.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197659 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/datatypes/LanguageType.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/datatypes/LanguageType.java b/src/java/org/apache/fop/datatypes/LanguageType.java index b95ef7d78..be437794c 100644 --- a/src/java/org/apache/fop/datatypes/LanguageType.java +++ b/src/java/org/apache/fop/datatypes/LanguageType.java @@ -39,6 +39,8 @@ public class LanguageType extends NCName { private static final String tag = "$Name$"; private static final String revision = "$Revision$"; + private String iso639_1Code = null; + public LanguageType(int property, String languageCode) throws PropertyException { @@ -50,6 +52,7 @@ public class LanguageType extends NCName { throw new PropertyException ("Invalid language code: " + languageCode); setString(code); + iso639_1Code = CountryLanguageScript.canonical639_1Code(code); } public LanguageType(String propertyName, String languageCode) @@ -66,10 +69,14 @@ public class LanguageType extends NCName { } /** - * @return the <tt>String</tt> language code. + * Gets the ISO 639-2T language code + * @return the code. */ public String getLanguage() { return string; } + public String getISO639_1Language() { + return iso639_1Code; + } } |