You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by mg...@apache.org on 2015/12/25 14:09:00 UTC
[45/50] isis git commit: ISIS-1093: updating the migration guide for
the new i18n support in Wicket viewer.
ISIS-1093: updating the migration guide for the new i18n support in Wicket viewer.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/e446af1e
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/e446af1e
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/e446af1e
Branch: refs/heads/ISIS-1223-upgrade-to-wicket-7
Commit: e446af1e42e00016d91c29fd9076fb79c3caf52b
Parents: ffb1e54
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Dec 23 15:08:15 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Dec 23 15:10:16 2015 +0000
----------------------------------------------------------------------
.../main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc | 11 +++++++++++
.../src/main/asciidoc/guides/_ugbtb_i18n.adoc | 7 ++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/e446af1e/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc b/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
index 5f02bee..1b31335 100644
--- a/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
+++ b/adocs/documentation/src/main/asciidoc/_migration-notes_1.10.0-to-1.11.0.adoc
@@ -81,3 +81,14 @@ There is also an HTML page to load the Swagger UI itself; this resides in `src/m
The text of the simple app's `about/index.html` has also changed (the `<li`> for the `/restful` URL has been replaced with a `/swagger-ui` URL). If you use link:https://github.com/apache/isis/blob/master/example/application/simpleapp/webapp/src/main/webapp/about/index.html[this file], then update it.
+
+== Wicket Viewer i18n
+
+The xref:guides/ugvw.adoc#[Wicket viewer] (its labels, buttons, messages etc) can now be internationalized using the
+xref:guides/rgsvc.adoc#_rgsvc_spi_TranslationService[`TranslationService`].
+
+To enable this, new ``msgId``s and corresponding translations must be added to the `translations.po` file. Full
+details of these ``msgId``s can be found in xref:guides/ugbtb.adoc#_ugbtb_i18n_wicket-viewer[i18n] section of the "beyond the basics" guide.
+
+If no translations are available, then the fallback is to use the previous mechanism, ie Wicket's original resource bundles.
+This feature can therefore be considered as optional.
http://git-wip-us.apache.org/repos/asf/isis/blob/e446af1e/adocs/documentation/src/main/asciidoc/guides/_ugbtb_i18n.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_i18n.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_i18n.adoc
index bc126c4..de14fe7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugbtb_i18n.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugbtb_i18n.adoc
@@ -14,7 +14,7 @@ It also supports translations of messages raised imperatively, by which we mean
Isis does not translate the values of your domain objects, though. So, if you have a domain concept such as `Country` whose name is intended to be localized according to the current user, you will need to model this yourself.
-
+[[_ugbtb_i18n_implementation-approach]]
== Implementation Approach
Most Java frameworks tackle i18n by using Java's own `ResourceBundle` API. However, there are some serious drawbacks in this approach, including:
@@ -50,6 +50,7 @@ In Apache Isis' implementation, if the translation is missing from the `.po` fil
+[[_ugbtb_i18n_translation-service]]
== `TranslationService`
The cornerstone of Apache Isis' support for i18n is the `TranslationService` service. This is defined in the applib with the following API:
@@ -101,6 +102,7 @@ When running in write mode the original text is returned to the caller untransla
+[[_ugbtb_i18n_imperative-messages]]
== Imperative messages
The `TranslationService` is used internally by Apache Isis when building up the metamodel; the name and description of every class, property, collection, action and action parameter is automatically translated. Thus the simple act of bootstrapping Apache Isis will cause most of the messages requiring translation (that is: those for the Apache Isis metamodel) to be captured by the `TranslationService`.
@@ -218,6 +220,7 @@ public interface TranslatableException {
+[[_ugbtb_i18n_wicket-viewer]]
== Wicket Viewer (`1.11.0-SNAPSHOT`)
(As of `1.11.0-SNAPSHOT`), the xref:ugvw.adoc#[Wicket viewer] (its labels and messages) is also internationalized using
@@ -471,6 +474,7 @@ msgstr "Username"
+[[_ugbtb_i18n_integration-testing]]
== Integration Testing
So much for the API; but as noted, it is also necessary to ensure that the required translations are recorded (by the `TranslationService`) into the `.pot` file.
@@ -554,6 +558,7 @@ public Integer getQuantity() { ... }
+[[_ugbtb_i18n_configuration]]
== Configuration
There are several different aspects of the translation service that can be configured.