=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/I18nInterceptor.java' --- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/I18nInterceptor.java 2012-01-22 04:20:13 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/I18nInterceptor.java 2013-02-03 08:35:03 +0000 @@ -27,21 +27,19 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - +import com.opensymphony.xwork2.Action; +import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.interceptor.Interceptor; import ognl.NoSuchPropertyException; import ognl.Ognl; - import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.i18n.I18nManager; import org.hisp.dhis.i18n.locale.LocaleManager; -import com.opensymphony.xwork2.Action; -import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.interceptor.Interceptor; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; /** * @author Nguyen Dang Quang @@ -64,7 +62,7 @@ { i18nManager = manager; } - + private LocaleManager localeManager; public void setLocaleManager( LocaleManager localeManager ) @@ -77,7 +75,7 @@ // ------------------------------------------------------------------------- public void destroy() - { + { } public void init() @@ -114,7 +112,7 @@ { Ognl.setValue( KEY_I18N, contextMap, action, i18n ); } - catch ( NoSuchPropertyException e ) + catch ( NoSuchPropertyException ignored ) { } @@ -122,7 +120,7 @@ { Ognl.setValue( KEY_I18N_FORMAT, contextMap, action, i18nFormat ); } - catch ( NoSuchPropertyException e ) + catch ( NoSuchPropertyException ignored ) { } @@ -130,10 +128,10 @@ { Ognl.setValue( KEY_LOCALE, contextMap, action, locale ); } - catch ( NoSuchPropertyException e ) + catch ( NoSuchPropertyException ignored ) { } - + return invocation.invoke(); } } === modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties' --- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-02-01 12:02:22 +0000 +++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties 2013-02-03 08:35:03 +0000 @@ -1,6 +1,7 @@ #-- Application name -----------------------------------------------------------# district_health_information_software=District Health Information Software 2 +dhis2=DHIS2 #-- dhis-wp --------------------------------------------------------------------# @@ -86,6 +87,9 @@ #-- Common ---------------------------------------------------------------------# +offline=Offline +online=Online +year=Year details=Details show_details=Show details hide_details=Hide details @@ -116,6 +120,7 @@ cancel=Cancel add=Add edit=Edit +reply=Reply update=Update delete=Delete close=Close @@ -286,6 +291,7 @@ send=Send help=Help send_feedback=Send feedback +status=Status system_status=System status feedback=Feedback intro=Intro @@ -525,7 +531,6 @@ opening_date=Opening date closed_date=Closed date active=Active -comment=Comment type=Type value_type=Value Type actual=Actual === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java' --- dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2012-12-20 09:49:00 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/controller/MobileController.java 2013-02-03 08:35:03 +0000 @@ -59,13 +59,13 @@ return "redirect:/mobile/index"; } - @RequestMapping(value = "/index") + @RequestMapping( value = "/index" ) public String index( Model model, HttpServletRequest request ) { populateContextPath( model, request ); model.addAttribute( "page", "index.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/messages") @@ -74,7 +74,7 @@ populateContextPath( model, request ); model.addAttribute( "page", "messages.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/messages/new-message") @@ -83,7 +83,7 @@ populateContextPath( model, request ); model.addAttribute( "page", "new-message.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/messages/{uid}") @@ -93,7 +93,7 @@ model.addAttribute( "page", "message.vm" ); model.addAttribute( "messageId", uid ); - return "base"; + return "layout"; } @RequestMapping(value = "/interpretations") @@ -102,7 +102,7 @@ populateContextPath( model, request ); model.addAttribute( "page", "interpretations.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/user-account") @@ -111,7 +111,7 @@ populateContextPath( model, request ); model.addAttribute( "page", "user-account.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/data-entry") @@ -120,7 +120,7 @@ populateContextPath( model, request ); model.addAttribute( "page", "data-entry.vm" ); - return "base"; + return "layout"; } @RequestMapping(value = "/app-cache") === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/interceptors' === added file 'dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/interceptors/I18nInterceptor.java' --- dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/interceptors/I18nInterceptor.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/interceptors/I18nInterceptor.java 2013-02-03 08:35:03 +0000 @@ -0,0 +1,58 @@ +package org.hisp.dhis.web.mobile.interceptors; + +/* + * Copyright (c) 2012, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import org.hisp.dhis.i18n.I18n; +import org.hisp.dhis.i18n.I18nManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Morten Olav Hansen + */ +@Component +public class I18nInterceptor extends HandlerInterceptorAdapter +{ + @Autowired + private I18nManager i18nManager; + + @Override + public void postHandle( HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView ) throws Exception + { + if ( modelAndView != null ) + { + I18n i18n = i18nManager.getI18n( "org.hisp.dhis.web.mobile" ); + modelAndView.addObject( "i18n", i18n ); + } + } +} === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/META-INF/dhis/mobile.xml' --- dhis-2/dhis-web/dhis-web-mobile/src/main/resources/META-INF/dhis/mobile.xml 2012-12-14 13:46:47 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/resources/META-INF/dhis/mobile.xml 2013-02-03 08:35:03 +0000 @@ -2,8 +2,11 @@ + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd + http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd + "> @@ -18,4 +21,8 @@ + + + + === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache' --- dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache 2013-01-15 13:48:01 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache 2013-02-03 08:35:03 +0000 @@ -1,5 +1,5 @@ CACHE MANIFEST -# Version: 2.11-SNAPSHOT V9 +# Version: 2.11-SNAPSHOT V10 CACHE: ../mobile/index === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org' === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp' === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis' === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web' === added directory 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile' === added file 'dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/i18n_module.properties 2013-02-03 08:35:03 +0000 @@ -0,0 +1,11 @@ +no_data_is_stored=No data is stored +you_have=You have +form_stored=form stored +forms_stored=forms stored +aggregate_reporting=Aggregate Reporting +unable_to_send_reply=Unable to send reply, please try again later +unable_to_get_inbox=Unable to get inbox, please try again later +no_messages=No messages +none_selected=None selected +no_organisation_units_for_data_entry=No organisation units available for data entry +change_to_invalid_page=Tried changing to invalid page === removed file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 2013-01-15 13:48:01 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm 1970-01-01 00:00:00 +0000 @@ -1,34 +0,0 @@ - - - - - - DHIS 2 - - - - - - - - - - - - - - - - -#if( !$page ) -

$i18n.getString( "no_page_specified" )

-#else - #parse( $page ) -#end - - - === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2012-12-19 11:22:35 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2013-02-03 08:35:03 +0000 @@ -258,7 +258,7 @@ pageLoaders[pageId].call(); } else { $.mobile.loading( 'show', { - html: '

Tried changing to invalid page

', + html: '

$i18n.getString("change_to_invalid_page")

', textVisible: true }); } @@ -272,7 +272,7 @@
  • <%= organisationUnit.label %>
  • <% }); %> <% } else { %> -
  • No organisation units available for data entry
  • +
  • $i18n.getString("no_organisation_units_for_data_entry").
  • <% } %> @@ -287,8 +287,8 @@ @@ -351,7 +351,7 @@

    - Back + $i18n.getString("back")
    @@ -367,7 +367,7 @@

    - Back + $i18n.getString("back")
    @@ -383,7 +383,7 @@

    - Back + $i18n.getString("back")
    @@ -399,7 +399,7 @@

    - Back + $i18n.getString("back")
    === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2012-12-20 11:51:02 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/index.vm 2013-02-03 08:35:03 +0000 @@ -106,19 +106,19 @@

    <% if( dvsSize == 0 ) { %> -

    No data is stored.

    +

    $i18n.getString( "no_data_is_stored" ).

    <% } else { %> <% if( dvsSize == 1 ) { %> -

    You have <%= dvsSize %> form stored.

    +

    $i18n.getString("you_have") <%= dvsSize %> $i18n.getString("form_stored").

    <% } else { %> -

    You have <%= dvsSize %> forms stored.

    +

    $i18n.getString("you_have") <%= dvsSize %> $i18n.getString("forms_stored").

    <% } %> <% } %> <% if( online ) { %> -

    Status: Online

    +

    $i18n.getString("status"): $i18n.getString("online")

    <% } else { %> -

    Status: Offline

    +

    $i18n.getString("status"): $i18n.getString("offline")

    <% } %> @@ -130,9 +130,9 @@
      -
    • Aggregate Reporting
    • -
    • Messages
    • -
    • User Account
    • +
    • $i18n.getString("aggregate_reporting")
    • +
    • $i18n.getString("messages")
    • +
    • $i18n.getString("user_account")
    •  

      === added file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/layout.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/layout.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/layout.vm 2013-02-03 08:35:03 +0000 @@ -0,0 +1,34 @@ + + + + + + $i18n.getString( "DHIS2" ) + + + + + + + + + + + + + + + + +#if( !$page ) +

      $i18n.getString( "no_page_specified" )

      +#else + #parse( $page ) +#end + + + === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm 2012-12-19 11:22:35 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm 2013-02-03 08:35:03 +0000 @@ -32,7 +32,7 @@ location.reload(true); }).error(function () { $.mobile.loading( 'show', { - html: '

      Unable to send reply, please try again later

      ', + html: '

      $i18n.getString("unable_to_send_reply")

      ', textVisible: true }); @@ -60,7 +60,7 @@ bindSubmitHandler(); }).error(function () { $.mobile.loading( 'show', { - html: '

      Unable to load message, please try again later

      ', + html: '

      $i18n.getString("unable_to_send_reply")

      ', textVisible: true }); @@ -85,7 +85,7 @@
    • - +
    • <% } %> @@ -97,7 +97,7 @@

      - Back + $i18n.getString("back")
      === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm 2012-12-19 11:22:35 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/messages.vm 2013-02-03 08:35:03 +0000 @@ -16,11 +16,11 @@ } }); } else { - $('#messageList').append('
    • No messages
    • '); + $('#messageList').append('
    • $i18n.getString("no_messages")
    • '); } }).error(function() { $.mobile.loading( 'show', { - html: '

      Unable to get inbox, please try again later

      ', + html: '

      $i18n.getString("unable_to_get_inbox")

      ', textVisible: true }); @@ -38,13 +38,13 @@

      - Back - New + $i18n.getString("back") + $i18n.getString("new")
        -
      • Messages
      • +
      • $i18n.getString("messages")
      === modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm' --- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2012-12-19 11:22:35 +0000 +++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm 2013-02-03 08:35:03 +0000 @@ -62,7 +62,7 @@

      - Back + $i18n.getString("back")
      @@ -70,52 +70,52 @@
      • User Account
      • - + - + - + - +
      • -
      • Profile
      • +
      • $i18n.getString("profile")
      • - + - + - + - + - + - + - + - + - + - +