You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: docs/source/i18n.rst
+36-4Lines changed: 36 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,35 @@ All of the default views are fully internationalized using a standard `Java Reso
9
9
10
10
#else
11
11
12
-
All of the |project| default views are fully internationalized using standard Spring ``MessageSource`` internationalization support. Spring Boot makes this even easier by supporting a default ``MessageSource`` as a ``messages`` resource bundle at the root of the classpath. For example, assuming a Maven/Gradle project layout:
12
+
All of the |project| default views are fully internationalized using standard Spring ``MessageSource`` internationalization support.
13
+
14
+
#if( $springboot)
15
+
16
+
Spring Boot makes this even easier by supporting a default ``MessageSource`` as a ``messages`` resource bundle at the root of the classpath.
17
+
18
+
#elseif( $spring )
19
+
20
+
You can support a default ``MessageSource`` as a ``messages`` resource bundle at the root of the classpath.
21
+
22
+
Create a configuration somewhere in your project like so:
Assuming a Maven/Gradle project layout, here's the structure for your internationalization properties files:
13
41
14
42
.. parsed-literal::
15
43
@@ -21,7 +49,6 @@ All of the |project| default views are fully internationalized using standard Sp
21
49
\|-- messages_de.properties
22
50
\|-- ... etc ...
23
51
24
-
25
52
#end
26
53
27
54
Languages
@@ -47,8 +74,13 @@ You can add other languages as follows:
47
74
48
75
#else
49
76
50
-
1. Create one or more ``messages_LOCALE.properties`` files to the root package (as shown above), for example ``messages_es.properties`` for Spanish (or even ``messages_es_ES.properties`` for Spain's dialect of Spanish and ``messages_es_MX.properties`` for Mexican dialect of Spanish, etc).
51
-
2. In each locale-specific file, re-define each Stormpath :ref:`i18n property <i18n-properties-file>` value in that language.
77
+
1. Create a ``messages.properties`` file in the root package (as shown above). Even if you do not put anything inside of it, other languages will not work unless the base file exists.
78
+
2. Create one or more ``messages_LOCALE.properties`` files to the root package (as shown above), for example ``messages_es.properties`` for Spanish (or even ``messages_es_ES.properties`` for Spain's dialect of Spanish and ``messages_es_MX.properties`` for Mexican dialect of Spanish, etc).
79
+
3. In each locale-specific file, re-define each Stormpath :ref:`i18n property <i18n-properties-file>` value in that language.
80
+
81
+
.. caution::
82
+
83
+
Even if there are no English properties you wish to override, you must have a ``messages.properties`` file (can be empty) if you intend to provide properties in other languages
0 commit comments