cesarhernandezgt commented on a change in pull request #435: TOMEE-2381 Add
README.adoc to deltaspike-i18n/
URL: https://github.com/apache/tomee/pull/435#discussion_r262610493
##########
File path: examples/deltaspike-i18n/README.adoc
##########
@@ -0,0 +1,109 @@
+:index-group: Unrevised
+:jbake-type: page
+:jbake-status: status=published
+= Apache DeltaSpike I18n Demo
+
+This example shows how to use DeltaSpike I18n.
+
+== Intro of Apache DeltaSpike I18n
+
+The Apache DeltaSpike I18n is a module of Apache DeltaSpike project that
enables the use of type-safe messages and internationalization.
+
+== Code sample
+
+=== @MessageBundle interface
+Create an interface with a method for each type-safe message. The interface
should be annotated with `@MessageBundle` and for each message it is needed to
annotaated with `@MessageTemplate`:
+
+....
+@MessageBundle
+public interface MessageHelper {
+
+ @MessageTemplate("{openejb.and.deltaspike}")
+ String openejbAndDeltaspike();
+}
+....
+
+=== MessageHelper property file
+It will lookup for the string "openejb.and.deltaspik" (without the curly
brackets "{}") in a property file with the same name of the interface but with
the extension .properties instead of .java or .class.
+
+MessageHelper.properties
+
+....
+openejb.and.deltaspike = OpenEJB and DeltaSpike are cool products!
+....
+
+=== Using the type safe messages
+Now you can inject the interface and retrieve the type-safe message:
+
+....
+ @Inject
+ private MessageHelper msg;
+
+ @Test
+ public void check() {
+ assertEquals("OpenEJB and DeltaSpike are cool products!",
msg.openejbAndDeltaspike());
+ }
+}
+....
+
+== Running
+
+Running the example is fairly simple. In the ``deltaspike-i18n'' directory
Review comment:
I would suggest:
Running the example is fairly simple. In the
`/tomee/examples/deltaspike-i18n` directory
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services