Issue Details (XML | Word | Printable)

Key: TAPESTRY-881
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jesse Kuhnert
Reporter: Matt Raible
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Tapestry

Allow global i18n bundle location to be customized

Created: 10/Mar/06 10:58 PM   Updated: 05/Mar/07 02:33 AM
Return to search
Component/s: Framework
Affects Version/s: 4.1.1
Fix Version/s: 4.1.2

Time Tracking:
Not Specified

Resolution Date: 05/Mar/07 02:33 AM


 Description  « Hide
The current mechanism for specifying a global i18n resource bundle is not very flexible.

http://jakarta.apache.org/tapestry/UsersGuide/localization.html#localization.namespace

It requires you to name your i18n bundles the same as your .application file. Furthermore, it requires that your bundles be places in the WEB-INF directory. Most other web frameworks (and Java applications in general) require you to have the ResourceBundle somewhere in your classpath (generally in the root - WEB-INF/classes).

1. I think the root of the classpath should be the default location - even if you're using the ".application name matches i18n name" mechanism.
2. It should be possible to customize the name of the file. Possibly something like the following in your .application file:

<property name="org.apache.tapestry.global-properties" value="ApplicationResources"/> -> points to WEB-INF/classes/ApplicationResources.properties (and others with _locale.properties
<property name="org.apache.tapestry.global-properties" value="com.myapplication.web.messages"/> - points to /WEB-INF/classes/com/myapplication/web/messages.properties

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #476615 Sat Nov 18 21:50:21 UTC 2006 jkuhnert Resolves TAPESTRY-881. Added ability to define alternate .properties file names on namespace specifications.

Also added behavior making ApplicationSpecificationInitializer look in the classpath as well as context
path for an app spec by default.
Files Changed
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/integration/JettyRunner.java
MODIFY /tapestry/tapestry4/trunk/pom.xml
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test/Fred.application
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n/WEB-INF/i18n.application
MODIFY /tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/workbench.application
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n/WEB-INF
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/integration/i18n/TestI18nResources.java
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestApplicationSpecificationInitializer.java
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n/WEB-INF/web.xml
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/pom.xml
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n/WEB-INF/random.properties
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/wml/Go.java
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test-data/i18n/Home.html
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/integration/i18n
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java

Repository Revision Date User Message
ASF #514527 Mon Mar 05 02:32:50 UTC 2007 jkuhnert Fixes TAPESTRY-881. Allow for more flexible resolution of properties bundles by searching / handling classpath versions
of the resources for those instances where the spec resource location only resolves to context relative paths.
Files Changed
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ClasspathResourceFactoryImpl.java
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/override.properties
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ApplicationSpecificationInitializer.java
DEL /tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Home.properties
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestNamespaceResources.java
ADD /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/impl/classpath.properties
MODIFY /tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/pom.xml
ADD /tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/main/resources/messages.properties
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java
MODIFY /tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/TestComponentMessages.java
MODIFY /tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application