| <?xml version="1.0"?> |
| <!-- |
| /* |
| * Copyright 2001-2004 The Apache Software Foundation. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| --> |
| |
| <document> |
| |
| <properties> |
| <title>Turbine Tools - Localization Pull Tool</title> |
| </properties> |
| |
| <body> |
| |
| <section name="Localization Tool"> |
| |
| <p> |
| This is a tool the provides access to the <a href="http://jakarta.apache.org/turbine/fulcrum/multiproject/fulcrum-localization/index.html">Fulcrum Localization</a> component. |
| This makes it easy to use the Localization Component. For more uses, you can also directly load up the component. See the LocalizationToolTest for |
| sample code. |
| </p> |
| |
| </section> |
| |
| <section name="Usage"> |
| |
| |
| <source><![CDATA[ |
| localizationTool = (LocalizationTool)context.get("l10n"); |
| localizationTool.getString("DISPLAYPROJECTS_TITLE"); |
| |
| ]]></source> |
| |
| <p> |
| This is an example of using the localization pull tool. |
| </p> |
| |
| <p> |
| This has the added effect of using the Accept-Language HTTP header to determine |
| which language to display based on what setting the user has defined in |
| the browser. Can you say Dynamic Localization? ;-) |
| </p> |
| |
| <p> |
| For creating the file where you get the value of the String, please |
| see the <em>java.util.ListResourceBundle</em> and |
| <em>java.util.ResourceBundle</em> classes for more information. |
| <a href="http://java.apache.org/jyve/">Jyve</a> also contains example usage |
| of this code because that was the first place where this code was originally |
| developed. |
| </p> |
| |
| </section> |
| |
| </body> |
| </document> |