Internationalization

Slides:



Advertisements
Similar presentations
Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD.
Advertisements

9 Copyright © 2005, Oracle. All rights reserved. Modularizing JavaServer Pages Development with Tags.
JSP and web applications
Apache Struts Technology
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Internationalization of Java Platform Presenter: Ataru Nakazawa Advisor: Xiaoping Jia Date: January 23, 2004.
Apache Struts Technology A MVC Framework for Java Web Applications.
Internationalization and the Java Stack Part 2 Matt Wheeler.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
UNIT-V The MVC architecture and Struts Framework.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
JSP Standard Tag Library
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Java Beans.
Java Programming: Advanced Topics 1 Collections and Wealth of Utilities.
Sakai: Localization & Internationalization Beth Kirschner University of Michigan
Internationalization and the Java Stack Part 1 Matt Wheeler.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Internationalization and the Java Stack Matt Wheeler.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
Introduction to Java Server Pages (JSPs) Robert Thornton.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
Chapter 8 Script-free pages. Problem with scripting in JSP When you use scripting (declaration, scriplet, expressions) in your JSP, you actually put Java.
Internationalization in the Java Stack Matt Wheeler.
8/15/2003System Specialists Corporation How to implement BC4J with the Struts Framework Eugene Sicat Technical Architect/Project Manager System Specialists.
Internationalization in the Java Stack Matt Wheeler.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 26 Internationalization.
WEB BASED DATA TRANSFORMATION USING XML, JAVA Group members: Darius Balarashti & Matt Smith.
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
Freemarker ● Introduction ● Core features ● Java part example ● Template example ● Expressions ● Builtins ● Assigning value ● Conditions ● Loops ● Macros.
EXist Indexing Using the right index for you data Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Forms with Spring MVC Handling Form.
WAM and the Java Stack. Disclaimer Please ask questions There are hands on labs Prerequisites: – Basic Java knowledge – Basic Spring knowledge – LDS Account.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Views Rendering custom views.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Chapter 20 Internationalization. 2 Objectives F To describe Java's internationalization features (§ 20.1). F To construct a locale with language, country,
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Internationalization and the Java Stack Part 2 Matt Wheeler.
Apache Struts Technology A MVC Framework for Java Web Applications.
CHAPTER 9 File Storage Shared Preferences SQLite.
WAM and the Java Stack. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
Model View Controller. MVC is the separation of model, view and controller. It's simply a paradigm; an ideal that you should have in the back of your.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
CSC 222: Object-Oriented Programming
J2EE Lecture 6: Spring – IoC and Dependency Injection
Passing from design to implementation
Metropolia 2013 C# programming and .NET framework
CSC 222: Object-Oriented Programming
SAP Hybris Online Training SAP Hybris Online Training
Knowledge Byte In this section, you will learn about:
An Overview of MPEG-21 Cory McKay.
EPIC INFOTECH CONSULTING GROUP
Evaluating Compuware OptimalJ as an MDA tool
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Chapter 35 Internationalization
Dependency Injection Mechanism
Presentation transcript:

Internationalization Matt Wheeler

This is a training NOT a presentation Please ask questions Notes This is a training NOT a presentation Please ask questions Prerequisites Introduction to Java Stack Basic Java and XML skills Installed LdsTech IDE (or other equivalent – good luck there ;) A few disclaimers to get things started

Internationalization in general Overview Internationalization in general Java Internationalization (ResourceBundle) Spring Internationalization (MessageSource) MessageSource vs. ResourceBundle Spring Helpers Locale change interceptor Locale resolver JSP tags

Internationalization in General (I18n) "Internationalization, in relation to computer programming, is the process of designing and writing an application so that it can be used in a global or multinational context. An internationalized program is capable of supporting different languages, as well as date, time, currency, and other values, without software modification.“

Internationalization (continued) "Internationalization is the process of designing software so that it can be adapted (localized) to various languages and regions easily, cost-effectively, and in particular without engineering changes to the software. This generally involves isolating the parts of a program that are dependent on language and culture. For example, the text of error messages must be kept separate from program source code because they must be translated during localization.“ http://www.ibm.com/developerworks/java/tutorials/j-i18n/section2.html

Localization (L10n) "Localization is the process of adapting a program for use in a specific locale. A locale is a geographic or political region that shares the same language and customs. Localization includes the translation of text such as user interface labels, error messages, and online help. It also includes the culture-specific formatting of data items such as monetary values, times, dates, and numbers."

Localization (continued) "Localization is the process of designing and writing an application capable of dealing with a specific regional, country, language, cultural, business, or political context. In a sense, every application written for a specific area is localized, although most of these effectively support only one locale. Usually, though, true localization is achieved by core code that accesses locale, location, political, or other specific components and modules, along with translating text as appropriate for the audience. A properly internationalized program facilitates and provides a foundation for localization.“ http://www.ibm.com/developerworks/java/tutorials/j-i18n/section2.html

First Step of Internationalization Extract translatable text from code Load resources for a specific locale Inject locale specific resources into the application

Java Internationalization (ResourceBundle) ResourceBundle is the basis of Java internationalization Backed by different data stores Property files Java source code Represents a collection of key/value pairs for a given location For example: ResourceBundle.getBundle("bundle").getString("abc") ResourceBundle.getBundle("bundle", Locale.ITALIAN).getString("abc")

DEMO Java-i18n-demo

Spring Internationalization (MessageSource) MessageSource is the root of Spring internationalization MessageSource interface And abstraction to the actual text store of translated files Data store can be properties files, database, MarkLogic, … Implement the interface for the given resource store Implementation of MessageSource can use resource bundles as in native Java

MessageSource Example Place resource bundles in src/main/bundles Configure the message source as follows: <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>classpath:messages</value> <value>classpath:otherbundle</value> </list> </property> </bean>

Utilize the MessageSource Inject MessageSource Utilize the MessageSource @Inject private MessageSource messageSource; @RequestMapping(value="/", method=RequestMethod.GET) public void getAStringInCode(ModelMap model) { String message = messageSource.getMessage("abc", null, "default", Locale.US); //do something with message return; }

MessageSource vs. ResourceBundle MessageSource allows all resources to be conglomerated together MessageSource does parameter replacement automatically MessageSource allows for a default (in case message is not found)

Spring MessageSource taglib http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/spring.tld.html#spring.tld.message <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> <spring:message code=“messsage.key"/>

MessageSource Expression Resolver Provide message resolver can be utilized in EL http://code.lds.org/maven-sites/stack/module.html?module=web-spring/#El_Message_Source <%@ taglib prefix="web-spring" uri="http://code.lds.org/web/spring" %> <!-- This makes the internationalized properties of the default MessageSource available as a map in the specified scope--> <web-spring:message-source var="messages" scope="request"/> <!- Referecence the messages in EL by key --> ${messages['abc.def.ghi']}

Spring MessageSource taglib

Lab 1: Internationalize a page https://tech.lds.org/wiki/Introduction_to_Spring#Lab_2_Dependency_Injection

Credit where credit is due http://www.ibm.com/developerworks/java/tutorials/j-i18n/section2.html