Changeset 2294 for FCKeditor.Java/trunk
- Timestamp:
- 2008-07-25 23:26:17 (4 months ago)
- Location:
- FCKeditor.Java/trunk
- Files:
-
- 4 modified
-
java-core/src/main/java/net/fckeditor/localization/impl/AcceptLanguageHeaderResolver.java (modified) (1 diff)
-
java-core/src/main/java/net/fckeditor/localization/impl/JstlResolver.java (modified) (1 diff)
-
java-core/src/main/java/net/fckeditor/localization/LocaleResolver.java (modified) (1 diff)
-
src/site/apt/i18n.apt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/impl/AcceptLanguageHeaderResolver.java
r2252 r2294 47 47 * @see net.fckeditor.localization.LocaleResolver#resolveLocale(javax.servlet.http.HttpServletRequest) 48 48 */ 49 public Locale resolveLocale( HttpServletRequest request) {49 public Locale resolveLocale(final HttpServletRequest request) { 50 50 51 51 if (Utils.isNotEmpty(request.getHeader("Accept-Language"))) -
FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/impl/JstlResolver.java
r2250 r2294 45 45 * @see net.fckeditor.localization.LocaleResolver#resolveLocale(javax.servlet.http.HttpServletRequest) 46 46 */ 47 public Locale resolveLocale( HttpServletRequest request) {47 public Locale resolveLocale(final HttpServletRequest request) { 48 48 49 49 return (Locale) Config.get(request.getSession(), Config.FMT_LOCALE); -
FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/LocaleResolver.java
r2248 r2294 41 41 * cannot be resolved 42 42 */ 43 public Locale resolveLocale( HttpServletRequest request);43 public Locale resolveLocale(final HttpServletRequest request); 44 44 45 45 } -
FCKeditor.Java/trunk/src/site/apt/i18n.apt
r2293 r2294 24 24 Internationalization 25 25 26 The interation pack offers you the possibility to localize any string responded to the user 27 on a global basis and on a per locale basis and independently from the deployed 28 framework/system (JSTL, Struts, Request, and other). 26 The interation pack offers you the capability to localize any string responded 27 to the user on a global basis and on a per locale basis and independently from 28 the deployed framework/system (JSTL, Struts, Request, and other). 29 30 Read on to see how you can customize the system to your needs: 31 32 * The interface 33 34 The interface {{{java-core/apidocs/net/fckeditor/localization/LocaleResolver.html}<<<net.fckeditor.localization.LocaleResolver>>>}} 35 contains only one method: 29 36 30 It takes two steps to respond localized strings it: 37 * <<<Locale resolveLocale(final HttpServletRequest)>>>: It will be passed the 38 current request instance on every request. It resolves the user locale according 39 to the underlying system or returns <<<null>>> if it can't resolve the locale. 31 40 32 [ [1]] <<The interface>>41 [] 33 42 34 We provide an interface to resolve the user locale in order to retrieve 35 the corresponding strings.\ 43 ** Choosing an implemenation 36 44 37 {{{java-core/apidocs/net/fckeditor/localization/LocaleResolver.html}<<<net.fckeditor.localization.impl.LocaleResolver>>>}} 45 [Hint:] If you do not (want to) choose an implementation, the default one 46 will be used. 38 47 39 [[2]] <<The strings>> 48 You have to choose an inplemenation, either an existing or a custom one. If no 49 existing implemention suits your need, create your own. Implement the interface 50 and resolve the locale the way you want. 51 52 Existing, ready-to-go implementations: 53 54 * {{{java-core/apidocs/net/fckeditor/localization/impl/AcceptLanguageHeaderResolver.html}<<<net.fckeditor.localization.impl.AcceptLanguageHeaderResolver>>>}} (default): 55 It retrieves the first locale in the HTTP <<<Accept-Language>>> header, if 56 availabe. 57 58 * {{{java-core/apidocs/net/fckeditor/localization/impl/JstlResolver.html}<<<net.fckeditor.localization.impl.JstlResolver>>>}}: 59 The user locale will be retrieved from the session set by JSTL's <<<fmt>>> 60 tag or similar. 61 62 [] 63 64 ** Binding an implementation 65 66 After your have chosen your desired implemenation, you have to bind it to the 67 system. Put the fully-qualified class name of the implementation in the 68 <<<fckeditor.properies>>>: 69 70 +------------------------------------------------------------------------------+ 71 localization.localeResolverImpl=<desired implementation> 72 +------------------------------------------------------------------------------+ 73 74 * The Strings 75 76 [[2]] <<The strings>>: <<<message.*>>> 40 77 41 78 dfdfdf