SlideShare a Scribd company logo
i18n of JavaScript
Junichi Shinohara @ HDE
Agenda
・What's i18n?
・How to support i18n in Server Side
・How to support i18n in Client Side
・Introduce AngularJS
・Introduce angular-gettext
What’s i18n?
What’s i18n
・i18n = Internationalization
・One system supports multiple languages
How to Support i18n
in Server Side
How to Support i18n in Server Side
・Server Side = Python, PHP, Erlang and etc.
・GNU gettext generally is used
How to use gettext
1. Modify source code
2. Extract texts from source code(.pot)
3. Translate texts(.po)
4. Convert translated texts into binary
translated texts(.mo)
5. Load binary translated texts on server
・Use template engine like Mako
・Use _ method of gettext.py
How to use gettext
1. Modify Source Code
How to use gettext
2. Extract Texts from Source Code(.pot)
・Create .pot file with pybabel or xgettext
How to use gettext
3. Translate Texts(.po)
・Create .po file from .pot file with msgmerge
・Edit .po file with vim or Poedit
How to use gettext
4. Convert Translated Texts into Binary Translated Texts(.mo)
・Create .mo file with msgfmt
・Load .mo file on Tornado of Python
How to use gettext
5. Load Binary Translated Texts on Server
・Separate translating from developing
 ・Translators edit po files
 ・Developers edit source codes
・Useful PO file editor like Poedit
 
Good Points of gettext
How to Support i18n
in Client Side
How to support i18n in Client Side
・Client Side = JavaScript
・GNU gettext Generally is NOT used
How to support i18n in Client Side
with jQuery UI or jQuery Globalize
・Use GNU gettext Object or JSON
・We have to set texts into HTML
How to support i18n in Client Side
with Server’s Template
・Use GNU gettext
・But, JavaScript depends on Server Framework
Introduce
AngularJS
What’s AngularJS?
・JavaScript MVC Framework in Client Side
・Developed by Google
・Home Page:
https://angularjs.org/
・Examples:
http://www.angularjshub.com/examples/
What’s AngularJS?
Concepts of AngularJS
・2 Way Data Binding
 ・Change Value in Model = Change Value in View $(‘#hoge’).value(‘fuga’)
・Model
 ・Resource like REST API with $http, $q, and $resource
 ・Factory like Session Storage or Local Storage
・Directive / Filter / Template
 ・Behaviour as HTML
<div ng-model=”items” ng-repeat=”item in items | lowercase”><a>{{item}}</div>
・Controller
 ・Scope in HTML
<div ng-controller=”abcCtrl”></div><div ng-controller=”xyzCtrl”></div>
・Router
 ・Ajax Frendly URL with $router or angular-ui plugin
http://www.example.com/blog/#/page/1
 ・pushState / popState with HTML5 Mode
Introduce
angular-gettext
What’s angular-gettext?
・Support gettext on AngularJS
・Extract text from AngularJS codes
・Convert .po file into JSON or Object
・Home Page:
http://angular-gettext.rocketeer.be/
・Examples:
https://github.com/rubenv/angular-gettext-example
How to use angular-gettext
1. Modify source code
2. Extract texts from source code(.pot)
3. Translate texts(.po)
4. Convert translated texts into JSON(.json)
5. Load JSON on AngularJS or Server
・Use translate directive on View
・Use gettext function on Controller
How to use angular-gettext
1. Modify Source Code
How to use angular-gettext
2. Extract Texts from Source Code(.pot)
・Create .pot file with Grunt and grunt-angular-gettext
・We can merge other .pot file which is created by pybael
 with msguniq
How to use angular-gettext
3. Translate Texts(.po)
・Create .po file from .pot file with msgmerge
・Edit .po file with vim or Poedit
How to use angular-gettext
4. Convert translated texts into JSON(.json)
・Create .json file with Grunt and grunt-angular-gettext
・Load JSON on AngularJS
How to use angular-gettext
5. Load JSON on AngularJS
・translate directive
 ・We do NOT have to set translated texts into HTML
 ・JavaScript does NOT depend on Server Framework
・gettext
 ・Use a de fact standard
 ・Use the same as .po file of server side
・Translated texts is JSON format
 ・3rd party tool like jQuery Globalize use the JSON
Good Points of angular-gettext
Thank you for your attention!

More Related Content

PDF
REST in AngularJS
PDF
Optimizing AngularJS Application
PPTX
Jekyll, static websites generator
PDF
Angularjs & REST
PDF
Jekyll Presentation Slides
ODP
Introduction to blogging with Jekyll
PPTX
Jekyll demo - Refresh Hilo
PPT
Using RESTFUL APIs in ANGULARJS
REST in AngularJS
Optimizing AngularJS Application
Jekyll, static websites generator
Angularjs & REST
Jekyll Presentation Slides
Introduction to blogging with Jekyll
Jekyll demo - Refresh Hilo
Using RESTFUL APIs in ANGULARJS

What's hot (20)

PPTX
React basic by Yoav Amit, Wix
PPTX
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
PPT
Meetup uikit programming
PDF
Custom elements - An alternate Render API for decoupled Drupal
PPT
Backbone.js
KEY
I18n
PDF
Python for AngularJS
KEY
CMS for Cloud by Ruby
PDF
Building an API with Django and Django REST Framework
PDF
Going Multi-Tenant with dotCMS
PDF
Introduction to Backbone.js
PDF
Django rest framework tips and tricks
PDF
AngularJS performance & production tips
PPTX
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
PDF
PDF
Aleact
PDF
Apache Sling as an OSGi-powered REST middleware
PDF
Building the Front End with AngularJS
PPTX
Getting started with node.js
PDF
Wordpress as a Backend
React basic by Yoav Amit, Wix
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Meetup uikit programming
Custom elements - An alternate Render API for decoupled Drupal
Backbone.js
I18n
Python for AngularJS
CMS for Cloud by Ruby
Building an API with Django and Django REST Framework
Going Multi-Tenant with dotCMS
Introduction to Backbone.js
Django rest framework tips and tricks
AngularJS performance & production tips
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
Aleact
Apache Sling as an OSGi-powered REST middleware
Building the Front End with AngularJS
Getting started with node.js
Wordpress as a Backend
Ad

Viewers also liked (20)

PPTX
Implementation of gui framework part1
PDF
First impressions of Go
PDF
DockerCon 14
PDF
Studying Abroad in Cebu
PPTX
The language barrier.
PPTX
Implementation of gui framework part2
PDF
Authentication
PPTX
Ui testing with splinter - Fri, 30 May 2014
PPTX
Jun.27 fukutomi
PPTX
A brief introduction to CentOS 7
PPTX
How to study english
PPTX
Implementation of GUI Framework part3
PDF
Overview pcidss
PDF
Self Created Load Balancer for MTA on AWS
PDF
Hello pivotal tracker
PDF
Introducing chrome apps (ogura)
PDF
Do not rm_log_files
PPTX
Introduction to bioinformatics
PPTX
Implement server push in flask framework
PDF
Introduction to systemd
Implementation of gui framework part1
First impressions of Go
DockerCon 14
Studying Abroad in Cebu
The language barrier.
Implementation of gui framework part2
Authentication
Ui testing with splinter - Fri, 30 May 2014
Jun.27 fukutomi
A brief introduction to CentOS 7
How to study english
Implementation of GUI Framework part3
Overview pcidss
Self Created Load Balancer for MTA on AWS
Hello pivotal tracker
Introducing chrome apps (ogura)
Do not rm_log_files
Introduction to bioinformatics
Implement server push in flask framework
Introduction to systemd
Ad

Similar to I18n of java script (20)

PDF
EuroPython 2013 - Python3 TurboGears Training
PDF
Front End Development for Back End Developers - UberConf 2017
DOCX
Akash rajguru project report sem v
PDF
Create responsive websites with Django, REST and AngularJS
PDF
ODP
Web Development in Django
PDF
PDF
Front End Development for Back End Developers - vJUG24 2017
PPTX
WRStmlDSQUmUrZpQ0tFJ4Q_a36bc57fe1a24dd8bc5ba549736e406f_C2-Week2.pptx
PPTX
Modern javascript localization with c-3po and the good old gettext
ODP
Angular 4 The new Http Client Module
PDF
Headless approach for offloading heavy tasks in Magento
PPTX
Django course
KEY
Psgi Plack Sfpm
KEY
Psgi Plack Sfpm
PPTX
Nick Taylor - A Full Stack Web Framework for Deno
PDF
Google app-engine-with-python
PDF
Angular.js for beginners
PDF
Apigility introduction v2 (glasgow php)
KEY
Plack at OSCON 2010
EuroPython 2013 - Python3 TurboGears Training
Front End Development for Back End Developers - UberConf 2017
Akash rajguru project report sem v
Create responsive websites with Django, REST and AngularJS
Web Development in Django
Front End Development for Back End Developers - vJUG24 2017
WRStmlDSQUmUrZpQ0tFJ4Q_a36bc57fe1a24dd8bc5ba549736e406f_C2-Week2.pptx
Modern javascript localization with c-3po and the good old gettext
Angular 4 The new Http Client Module
Headless approach for offloading heavy tasks in Magento
Django course
Psgi Plack Sfpm
Psgi Plack Sfpm
Nick Taylor - A Full Stack Web Framework for Deno
Google app-engine-with-python
Angular.js for beginners
Apigility introduction v2 (glasgow php)
Plack at OSCON 2010

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mushroom cultivation and it's methods.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Empathic Computing: Creating Shared Understanding
PPT
Teaching material agriculture food technology
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
Mushroom cultivation and it's methods.pdf
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TLE Review Electricity (Electricity).pptx
Empathic Computing: Creating Shared Understanding
Teaching material agriculture food technology
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Unlocking AI with Model Context Protocol (MCP)
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

I18n of java script

  • 1. i18n of JavaScript Junichi Shinohara @ HDE
  • 2. Agenda ・What's i18n? ・How to support i18n in Server Side ・How to support i18n in Client Side ・Introduce AngularJS ・Introduce angular-gettext
  • 4. What’s i18n ・i18n = Internationalization ・One system supports multiple languages
  • 5. How to Support i18n in Server Side
  • 6. How to Support i18n in Server Side ・Server Side = Python, PHP, Erlang and etc. ・GNU gettext generally is used
  • 7. How to use gettext 1. Modify source code 2. Extract texts from source code(.pot) 3. Translate texts(.po) 4. Convert translated texts into binary translated texts(.mo) 5. Load binary translated texts on server
  • 8. ・Use template engine like Mako ・Use _ method of gettext.py How to use gettext 1. Modify Source Code
  • 9. How to use gettext 2. Extract Texts from Source Code(.pot) ・Create .pot file with pybabel or xgettext
  • 10. How to use gettext 3. Translate Texts(.po) ・Create .po file from .pot file with msgmerge ・Edit .po file with vim or Poedit
  • 11. How to use gettext 4. Convert Translated Texts into Binary Translated Texts(.mo) ・Create .mo file with msgfmt
  • 12. ・Load .mo file on Tornado of Python How to use gettext 5. Load Binary Translated Texts on Server
  • 13. ・Separate translating from developing  ・Translators edit po files  ・Developers edit source codes ・Useful PO file editor like Poedit   Good Points of gettext
  • 14. How to Support i18n in Client Side
  • 15. How to support i18n in Client Side ・Client Side = JavaScript ・GNU gettext Generally is NOT used
  • 16. How to support i18n in Client Side with jQuery UI or jQuery Globalize ・Use GNU gettext Object or JSON ・We have to set texts into HTML
  • 17. How to support i18n in Client Side with Server’s Template ・Use GNU gettext ・But, JavaScript depends on Server Framework
  • 19. What’s AngularJS? ・JavaScript MVC Framework in Client Side ・Developed by Google ・Home Page: https://angularjs.org/ ・Examples: http://www.angularjshub.com/examples/
  • 20. What’s AngularJS? Concepts of AngularJS ・2 Way Data Binding  ・Change Value in Model = Change Value in View $(‘#hoge’).value(‘fuga’) ・Model  ・Resource like REST API with $http, $q, and $resource  ・Factory like Session Storage or Local Storage ・Directive / Filter / Template  ・Behaviour as HTML <div ng-model=”items” ng-repeat=”item in items | lowercase”><a>{{item}}</div> ・Controller  ・Scope in HTML <div ng-controller=”abcCtrl”></div><div ng-controller=”xyzCtrl”></div> ・Router  ・Ajax Frendly URL with $router or angular-ui plugin http://www.example.com/blog/#/page/1  ・pushState / popState with HTML5 Mode
  • 22. What’s angular-gettext? ・Support gettext on AngularJS ・Extract text from AngularJS codes ・Convert .po file into JSON or Object ・Home Page: http://angular-gettext.rocketeer.be/ ・Examples: https://github.com/rubenv/angular-gettext-example
  • 23. How to use angular-gettext 1. Modify source code 2. Extract texts from source code(.pot) 3. Translate texts(.po) 4. Convert translated texts into JSON(.json) 5. Load JSON on AngularJS or Server
  • 24. ・Use translate directive on View ・Use gettext function on Controller How to use angular-gettext 1. Modify Source Code
  • 25. How to use angular-gettext 2. Extract Texts from Source Code(.pot) ・Create .pot file with Grunt and grunt-angular-gettext ・We can merge other .pot file which is created by pybael  with msguniq
  • 26. How to use angular-gettext 3. Translate Texts(.po) ・Create .po file from .pot file with msgmerge ・Edit .po file with vim or Poedit
  • 27. How to use angular-gettext 4. Convert translated texts into JSON(.json) ・Create .json file with Grunt and grunt-angular-gettext
  • 28. ・Load JSON on AngularJS How to use angular-gettext 5. Load JSON on AngularJS
  • 29. ・translate directive  ・We do NOT have to set translated texts into HTML  ・JavaScript does NOT depend on Server Framework ・gettext  ・Use a de fact standard  ・Use the same as .po file of server side ・Translated texts is JSON format  ・3rd party tool like jQuery Globalize use the JSON Good Points of angular-gettext
  • 30. Thank you for your attention!