dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20839
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9696: i18n for dhis-web-mobile, also added interceptor for adding i18n var for /mobile servlet (we shou...
------------------------------------------------------------
revno: 9696
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-02-03 15:35:03 +0700
message:
i18n for dhis-web-mobile, also added interceptor for adding i18n var for /mobile servlet (we should probably create a commons-mvc or start adding mvc related stuff in commons..). Added strings to global and a few to local module.
removed:
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/base.vm
added:
dhis-2/dhis-web/dhis-web-mobile/src/main/java/org/hisp/dhis/web/mobile/interceptors/
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/resources/org/
dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/
dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/
dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/
dhis-2/dhis-web/dhis-web-mobile/src/main/resources/org/hisp/dhis/web/mobile/
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/webapp/WEB-INF/dhis-web-mobile-velocity/layout.vm
modified:
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/resources/i18n_global.properties
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/resources/META-INF/dhis/mobile.xml
dhis-2/dhis-web/dhis-web-mobile/src/main/resources/dhis-mobile-manifest.appcache
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/index.vm
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/messages.vm
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/user-account.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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 <mortenoh@xxxxxxxxx>
+ */
+@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 @@
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
+ 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
+ ">
<context:component-scan base-package="org.hisp.dhis.web.mobile" />
@@ -18,4 +21,8 @@
<property name="order" value="0" />
</bean>
+ <mvc:interceptors>
+ <ref bean="i18nInterceptor" />
+ </mvc:interceptors>
+
</beans>
=== 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 @@
-<!DOCTYPE html>
-<html manifest="$contextPath/mobile/app-cache">
-<!-- <html> -->
-
-<head>
- <title>DHIS 2</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta charset="UTF-8">
-
- <link rel="stylesheet" href="$contextPath/dhis-web-mobile-resources/css/jquery.mobile.min.css?v=1.2.0" />
-
- <script src="$contextPath/dhis-web-commons/javascripts/jQuery/jquery.min.js?v=1.8.2"></script>
- <script src="$contextPath/dhis-web-commons/javascripts/dhis2/dhis2.util.js"></script>
- <script src="$contextPath/dhis-web-commons/javascripts/dhis2/dhis2.array.js"></script>
- <script src="$contextPath/dhis-web-commons/javascripts/underscore.min.js?v=1.4.3"></script>
- <script src="$contextPath/dhis-web-mobile-resources/js/jquery.mobile.min.js?v=1.2.0"></script>
- <script src="$contextPath/dhis-web-mobile-resources/js/dhis2.storage.js"></script>
-
- <script>
- $(document).bind('pageinit',function(){
- $.mobile.ajaxEnabled = false;
- });
- </script>
-</head>
-<body>
-
-#if( !$page )
- <p>$i18n.getString( "no_page_specified" )</p>
-#else
- #parse( $page )
-#end
-
-</body>
-</html>
=== 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: '<h1>Tried changing to invalid page</h1>',
+ html: '<h1>$i18n.getString("change_to_invalid_page")</h1>',
textVisible: true
});
}
@@ -272,7 +272,7 @@
<li><a href="#data-sets-page" data-id="<%= organisationUnit.id %>"><%= organisationUnit.label %></a></li>
<% }); %>
<% } else { %>
- <li>No organisation units available for data entry</li>
+ <li>$i18n.getString("no_organisation_units_for_data_entry").</li>
<% } %>
</ul>
</script>
@@ -287,8 +287,8 @@
<script id="period-template" type="text/template">
<div data-role="controlgroup" data-type="horizontal">
- <button id="previous_year" data-icon="arrow-l">Year</button>
- <button id="next_year" data-icon="arrow-r" data-iconpos="right">Year</button>
+ <button id="previous_year" data-icon="arrow-l">$i18n.getString("year")</button>
+ <button id="next_year" data-icon="arrow-r" data-iconpos="right">$i18n.getString("year")</button>
</div>
<ul id="period-list" data-role="listview" data-inset="true">
<% _( periods ).each( function(period, idx) { %>
@@ -324,9 +324,9 @@
<input type="date" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
<% } else if( field.type == 'BOOLEAN' ) { %>
<select type="" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255">
- <option value="">[ None selected ]</option>
- <option value="true" <% if( value == "true" ) { %> selected="selected" <% } %>>Yes</option>
- <option value="false" <% if( value == "false" ) { %> selected="selected" <% } %>>No</option>
+ <option value="">[ $i18n.getString("none_selected") ]</option>
+ <option value="true" <% if( value == "true" ) { %> selected="selected" <% } %>>$i18n.getString("yes")</option>
+ <option value="false" <% if( value == "false" ) { %> selected="selected" <% } %>>$i18n.getString("no")</option>
</select>
<% } else if( field.type == 'INTEGER' ) { %>
<input type="number" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
@@ -342,7 +342,7 @@
<% }); %>
- <li><input type="button" id="send_button" value="Send" /></li>
+ <li><input type="button" id="send_button" value="$i18n.getString("send")" /></li>
</ul>
</form>
</script>
@@ -351,7 +351,7 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="index" data-icon="back">Back</a>
+ <a href="index" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
@@ -367,7 +367,7 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="#organisation-units-page" data-icon="back">Back</a>
+ <a href="#organisation-units-page" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
@@ -383,7 +383,7 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="#data-sets-page" data-icon="back">Back</a>
+ <a href="#data-sets-page" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
@@ -399,7 +399,7 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="#period-page" data-icon="back">Back</a>
+ <a href="#period-page" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
=== 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 @@
<h3></h3>
<% if( dvsSize == 0 ) { %>
- <p>No data is stored.</p>
+ <p>$i18n.getString( "no_data_is_stored" ).</p>
<% } else { %>
<% if( dvsSize == 1 ) { %>
- <p>You have <strong><%= dvsSize %></strong> form stored.</p>
+ <p>$i18n.getString("you_have") <strong><%= dvsSize %></strong> $i18n.getString("form_stored").</p>
<% } else { %>
- <p>You have <strong><%= dvsSize %></strong> forms stored.</p>
+ <p>$i18n.getString("you_have") <strong><%= dvsSize %></strong> $i18n.getString("forms_stored").</p>
<% } %>
<% } %>
<% if( online ) { %>
- <p class="ui-li-aside">Status: <strong>Online</strong></p>
+ <p class="ui-li-aside">$i18n.getString("status"): <strong>$i18n.getString("online")</strong></p>
<% } else { %>
- <p class="ui-li-aside">Status: <strong>Offline</strong></p>
+ <p class="ui-li-aside">$i18n.getString("status"): <strong>$i18n.getString("offline")</strong></p>
<% } %>
</script>
@@ -130,9 +130,9 @@
<section data-role="content">
<ul data-role="listview" data-inset="true">
- <li id="data-entry"><a href="data-entry">Aggregate Reporting</a></li>
- <li id="messages"><a href="messages">Messages</a></li>
- <li id="user-account"><a href="user-account">User Account</a></li>
+ <li id="data-entry"><a href="data-entry">$i18n.getString("aggregate_reporting")</a></li>
+ <li id="messages"><a href="messages">$i18n.getString("messages")</a></li>
+ <li id="user-account"><a href="user-account">$i18n.getString("user_account")</a></li>
<li id="offline-status">
<h3></h3>
<p> </p>
=== 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 @@
+<!DOCTYPE html>
+<html manifest="$contextPath/mobile/app-cache">
+<!-- <html> -->
+
+<head>
+ <title>$i18n.getString( "DHIS2" )</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta charset="UTF-8">
+
+ <link rel="stylesheet" href="$contextPath/dhis-web-mobile-resources/css/jquery.mobile.min.css?v=1.2.0" />
+
+ <script src="$contextPath/dhis-web-commons/javascripts/jQuery/jquery.min.js?v=1.8.2"></script>
+ <script src="$contextPath/dhis-web-commons/javascripts/dhis2/dhis2.util.js"></script>
+ <script src="$contextPath/dhis-web-commons/javascripts/dhis2/dhis2.array.js"></script>
+ <script src="$contextPath/dhis-web-commons/javascripts/underscore.min.js?v=1.4.3"></script>
+ <script src="$contextPath/dhis-web-mobile-resources/js/jquery.mobile.min.js?v=1.2.0"></script>
+ <script src="$contextPath/dhis-web-mobile-resources/js/dhis2.storage.js"></script>
+
+ <script>
+ $(document).bind('pageinit',function(){
+ $.mobile.ajaxEnabled = false;
+ });
+ </script>
+</head>
+<body>
+
+#if( !$page )
+ <p>$i18n.getString( "no_page_specified" )</p>
+#else
+ #parse( $page )
+#end
+
+</body>
+</html>
=== 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: '<h1>Unable to send reply, please try again later</h1>',
+ html: '<h1>$i18n.getString("unable_to_send_reply")</h1>',
textVisible: true
});
@@ -60,7 +60,7 @@
bindSubmitHandler();
}).error(function () {
$.mobile.loading( 'show', {
- html: '<h1>Unable to load message, please try again later</h1>',
+ html: '<h1>$i18n.getString("unable_to_send_reply")</h1>',
textVisible: true
});
@@ -85,7 +85,7 @@
<li>
<form id='reply-form'>
<textarea id='reply-text'></textarea>
- <input type="submit" value="Reply" />
+ <input type="submit" value="$i18n.getString("reply")" />
</form>
</li>
<% } %>
@@ -97,7 +97,7 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="../messages" data-icon="back">Back</a>
+ <a href="../messages" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
=== 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('<li>No messages</li>');
+ $('#messageList').append('<li>$i18n.getString("no_messages")</li>');
}
}).error(function() {
$.mobile.loading( 'show', {
- html: '<h1>Unable to get inbox, please try again later</h1>',
+ html: '<h1>$i18n.getString("unable_to_get_inbox")</h1>',
textVisible: true
});
@@ -38,13 +38,13 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="index" data-icon="back">Back</a>
- <a href="messages/new-message" data-icon="plus">New</a>
+ <a href="index" data-icon="back">$i18n.getString("back")</a>
+ <a href="messages/new-message" data-icon="plus">$i18n.getString("new")</a>
</header>
<section data-role="content">
<ul id="messageList" data-role="listview" data-inset="true" data-count-theme="b">
- <li data-role="list-divider">Messages</li>
+ <li data-role="list-divider">$i18n.getString("messages")</li>
</ul>
</section>
=== 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 @@
<header data-role="header" data-theme="b">
<h1 align="center"><img src="$contextPath/dhis-web-commons/css/light_blue/logo_banner.png" /></h1>
- <a href="index" data-icon="back">Back</a>
+ <a href="index" data-icon="back">$i18n.getString("back")</a>
</header>
<section data-role="content">
@@ -70,52 +70,52 @@
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">User Account</li>
<li>
- <label for="firstNameInput">First Name:</label>
+ <label for="firstNameInput">$i18n.getString("first_name"):</label>
<input id="firstNameInput" name="firstName" type="text" placeholder="First name.." />
- <label for="surnameInput">Surname:</label>
+ <label for="surnameInput">$i18n.getString("surname"):</label>
<input id="surnameInput" name="surname" type="text" placeholder="Surname.." />
- <label for="emailInput">E-mail:</label>
+ <label for="emailInput">$i18n.getString("email"):</label>
<input id="emailInput" name="email" type="text" placeholder="E-mail.." />
- <label for="phoneNumberInput">Phone Number:</label>
+ <label for="phoneNumberInput">$i18n.getString("phone_number"):</label>
<input id="phoneNumberInput" name="phoneNumber" type="text" placeholder="Phone number.." />
</li>
- <li data-role="list-divider">Profile</li>
+ <li data-role="list-divider">$i18n.getString("profile")</li>
<li>
- <label for="introductionInput">Introduction</label>
+ <label for="introductionInput">$i18n.getString("introduction")</label>
<textarea id="introductionInput" name="introduction"></textarea>
- <label for="jobTitleInput">Job Title:</label>
+ <label for="jobTitleInput">$i18n.getString("job_title"):</label>
<input id="jobTitleInput" name="jobTitle" type="text" placeholder="Job Title.." />
- <label for="genderInput">Gender:</label>
+ <label for="genderInput">$i18n.getString("gender"):</label>
<select id="genderInput" name="gender">
- <option value="gender_male">Male</option>
- <option value="gender_female">Female</option>
- <option value="gender_other">Other</option>
+ <option value="gender_male">$i18n.getString("male")</option>
+ <option value="gender_female">$i18n.getString("female")</option>
+ <option value="gender_other">$i18n.getString("other")</option>
</select>
- <label for="birthdayInput">Birthday:</label>
+ <label for="birthdayInput">$i18n.getString("birthday"):</label>
<input id="birthdayInput" name="birthday" type="text" placeholder="yyyy-mm-dd (e.g. 1980-04-02)" />
- <label for="nationalityInput">Nationality:</label>
+ <label for="nationalityInput">$i18n.getString("nationality"):</label>
<input id="nationalityInput" name="nationality" type="text" placeholder="Nationality.." />
- <label for="employerInput">Employer:</label>
+ <label for="employerInput">$i18n.getString("employer"):</label>
<input id="employerInput" name="employer" type="text" placeholder="Employer.." />
- <label for="educationInput">Education:</label>
+ <label for="educationInput">$i18n.getString("education"):</label>
<textarea id="educationInput" name="education"></textarea>
- <label for="interestsInput">Interests:</label>
+ <label for="interestsInput">$i18n.getString("interests"):</label>
<textarea id="interestsInput" name="interests"></textarea>
- <label for="languagesInput">Languages:</label>
+ <label for="languagesInput">$i18n.getString("languages"):</label>
<textarea id="languagesInput" name="languages"></textarea>
- <input type="submit" value="Save" />
+ <input type="submit" value="$i18n.getString("save")" />
</li>
</ul>
</form>