Internationalization and the Java Stack Part 2 Matt Wheeler.

Slides:



Advertisements
Similar presentations
JavaScript and AJAX Jonathan Foss University of Warwick
Advertisements

TECH 2018 (Week 16) Topic: JavaScript Parminder Kang Home: Phones Off Please.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Intermediate Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
The Web Warrior Guide to Web Design Technologies
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.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
Introduction to the Java Stack Michael Youngstrom.
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.
Engineering Fellow, Intuit
Maven and Stack Starter Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack.
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.
8th Sakai Conference4-7 December 2007 Newport Beach Internationalization in Sakai Raúl Mengod López Universidad Politécnica de Valencia.
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.
L10n and I18n in the Real World Dan Moore Moore Consulting June 9, 2005.
Internationalization and the Java Stack Matt Wheeler.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Introduction to Java Server Pages (JSPs) Robert Thornton.
Company Confidential 1 This presentation is solely for the use of Patni personnel. No part of it may be circulated, quoted, or reproduced for distribution.
Internationalization in the Java Stack Matt Wheeler.
Creating With Code.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
Internationalization in the Java Stack Matt Wheeler.
Chapter 10 Overview of JSP Technology. Understanding the need for JSP JSP technology enables to mix regular, static HTML with dynamically generated content.
The DSpace Course Module - Language Customisation.
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.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
Computers and Scientific Thinking David Reed, Creighton University Functions and Libraries 1.
Introducing JavaScript. Goals By the end of this lecture you should … Be able to describe the differences among object methods, object properties and.
WAM and the Java Stack. Disclaimer Please ask questions There are hands on labs Prerequisites: – Basic Java knowledge – Basic Spring knowledge – LDS Account.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Internationalizing Sakai Raúl Mengod Universidad Politécnica de Valencia (Spain)
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.
© 2000 – All Rights Reserved - Page 1 Introduction to JavaScript Programming Part One.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
Introduction to Servlets Allen Day. Notes This is a training NOT a presentation Please ask questions Prerequisites.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
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.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Intermediate JSP Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic Java.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Internationalization and the Java Stack Part 2 Matt Wheeler.
JSP Directive and Objects. JSP Directives As discussed before There are 3 types of elements in JSP Directive Elements Scripting Elements Standard Action.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Lecture Transforming Data: Using Apache Xalan to apply XSLT transformations Marc Dumontier Blueprint Initiative Samuel Lunenfeld Research Institute.
Development Environment
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
Internationalization
JavaScript.
Introducing JavaScript
Presentation transcript:

Internationalization and the Java Stack Part 2 Matt Wheeler

Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Introduction to Spring – Basic Java and XML skills – Internationalization and the Java Stack Part 1 – Installed LdsTech IDE (or other equivalent)

Overview Stack provided internationalization tools Message source expression language resolver JS Message Source RequireJS Message Source Internationalization best practices Internationalization testing Dynamic pseudo translation

Expression Language Resolver Provided message resolver can be utilized in EL sites/stack/module.html?module=web- spring/#El_Message_Source ${messages['abc.def.ghi']}

JavaScript MessageSource Configuration classpath:messages messageSourceController

MessageSource with JS Usage in a JSP page var msgs = { "index.welcome":"Welcome", "accessDenied.accessdenied":"Access Denied", "def":"{0} asdfa asdfasd {1} asdfasd asdf ", "index.mainpage":"Main page - {0}“ }; alert(msgs['index.welcome']);

RequireJS MessageSource Configuration classpath:messages

MessageSource with RequireJS Usage define([ 'tmpl!example/templates/list', 'i18n!nls/messages' ], function (listTemplate, messages) { alert(messages['createExample_loading']); }; define({"root": { "createExample_loading":"Carga…", "createExample_form_label_data":"Datos:", "createExample_form_label_name":"Nombre:", "createExample_form_message_success":"Ejemplo \" \" se ha …" "createExample_form_button_save":"Cree Ejemplo“ } });

DEMO

Some I18n Best Practices Externalize ALL translatable text Do not concatenate translations Create duplicate / separate resources Avoid text in images Introduce pseudo-translation tool

Externalize ALL Text Example – Name: – Notice that we have concatenated the : with the translated name label "Name:" including the colon should be externalized – Concatenation itself is a best practice violation – : and associated formatting can be different – It might also be in a different order #messages.properties name.label=Name #JSP page ${messages['name.label']}: #messages.properties name.label=Name: #JSP page ${messages['name.label']}

Do NOT Concatenate Translations For example: Attempted usage: #messages.properties key1=Someone named key2=likes hiking. #JSP Page ${messages['key1']} Billy ${messages['key2']}

More Correct Way Create a single string with replaceable parameters Sentence maintains context – Parameters can be moved around to accommodate language grammar For example: And then it will be used as follows: key=Someone named {0} likes hiking.

Create Separate Resources Counter-intuitive to code reuse concept Same English strings should not be shared Within the same application, or even the same page Create a separate key value pair for each occurrence Words change based on context Concept of masculine and/or feminine, age classes, … Or usage Similar English words may not be similar in another language

DEMO

Avoid Placing Text in Images An image that contains text will require a new image for each language It will also require a custom way to load the image Impose the text over the image, using.css or other ingenious alternative – Then the text can be stored in the resource bundles with all other strings – And it won’t require a new image for each language

DEMO

I18n Testing (Dynamic Pseudo Translation) Configured to translate for specified locales Simplifies testing – Expansion – Special characters – Completeness – zz locale sites/stack/module.html?module=web- spring/#Pseudo_Translation_Message_Source_Faca de

Dynamic Pseudo Translation The trick (delegate) <bean id="delegatingMessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> classpath:messages

Example

DEMO

Credit where credit is due iple_meanings

Lab 1: Internationalize a page the_Java_Stack_- _Part_2#Lab_1_Pseudo_Translator