Changeset 2294 for FCKeditor.Java/trunk

Show
Ignore:
Timestamp:
2008-07-25 23:26:17 (4 months ago)
Author:
mosipov
Message:

ASSIGNED - #2361: Provide interface for locale resolution

Location:
FCKeditor.Java/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/impl/AcceptLanguageHeaderResolver.java

    r2252 r2294  
    4747         * @see net.fckeditor.localization.LocaleResolver#resolveLocale(javax.servlet.http.HttpServletRequest) 
    4848         */ 
    49         public Locale resolveLocale(HttpServletRequest request) { 
     49        public Locale resolveLocale(final HttpServletRequest request) { 
    5050 
    5151                if (Utils.isNotEmpty(request.getHeader("Accept-Language"))) 
  • FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/impl/JstlResolver.java

    r2250 r2294  
    4545         * @see net.fckeditor.localization.LocaleResolver#resolveLocale(javax.servlet.http.HttpServletRequest) 
    4646         */ 
    47         public Locale resolveLocale(HttpServletRequest request) { 
     47        public Locale resolveLocale(final HttpServletRequest request) { 
    4848 
    4949                return (Locale) Config.get(request.getSession(), Config.FMT_LOCALE); 
  • FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/localization/LocaleResolver.java

    r2248 r2294  
    4141         *         cannot be resolved 
    4242         */ 
    43         public Locale resolveLocale(HttpServletRequest request); 
     43        public Locale resolveLocale(final HttpServletRequest request); 
    4444 
    4545} 
  • FCKeditor.Java/trunk/src/site/apt/i18n.apt

    r2293 r2294  
    2424Internationalization 
    2525 
    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: 
    2936   
    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. 
    3140 
    32   [[1]] <<The interface>> 
     41  [] 
    3342 
    34         We provide an interface to resolve the user locale in order to retrieve 
    35         the corresponding strings.\ 
     43** Choosing an implemenation 
    3644 
    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. 
    3847 
    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.*>>> 
    4077 
    4178        dfdfdf