SlideShare uma empresa Scribd logo
1 de 55
Baixar para ler offline
i35s
internationalization in ruby on rails


           2007-08-11
         Tatsuhiro Ujihisa

Ruby/Rails Kansai Workshop #18
Tatsuhiro Ujihisa
 •
 Osaka Univ. graduate student
 • love Haskell, Ruby, and
    other functional languages...
 • love Mac, vim, KeyNote,
    and cats
Tatsuhiro Ujihisa
  • blog: rubyneko
  Osaka Univ. graduate student
His
  • love Haskell, Ruby, and
http://ujihisa.nowa.jp/
      other functional languages...
  • love Mac, vim, KeyNote,
      and cats
Tatsuhiro Ujihisa
   • blog: rubyneko
    Osaka Univ. graduate student
 His
   • love Haskell, Ruby, and
 http://ujihisa.nowa.jp/
          other functional languages...
     • love Mac, vim, KeyNote,
 exponent of the word: MDD
          and cats
(Mascot Driven Development)
s
  35
i
zation
          ionali
   ternat
In
             n Rails
       uby o
  in R
       including s+
•
at Osaka International
University
•
at Ruby/Rails Kansai
Workshop#18
•
at Osaka International
University
•
at Ruby/Rails Kansai
Workshop#18
                 i18n
uda.la
i35s do
Backgrounds...
prevalent languages
1         Chinese     1.3 billion
2          Arabic    420 million
3           Hindi    366 million
4          English   341 million
...           ...         ...
          Japanese
9                    125 million
                     source: wikipedia
• Most Japanese start learning
 English at Junior High School
➡88% Japanese <- [En, Jp]
➡EnglishPeople.count #=> 451
• 451 / 125.0 #=> 3.608
• if Japanese -> English
 then YourWebService.profit
      #=> 3.6 times upper

 end
Your worktime
Your worktime



 8h
Your worktime
                2.2h

 8h
Your worktime
                2.2h

 8h
Set your default language,
         English!
That's all.
Thank you!
• Your app must support
 both English and Chinese
• One app, has_many langs
 ‣Hindi, etc...
   eg. English, Chinese, Arabian,
Ruby-GetText-Package
Ruby-GetText-Package
• phrase/keyword replacement
• author: Masao Mutoh
• install:
   sudo gem install gettext
• current ver. 1.10.0
Ruby-GetText-Package
• phrase/keyword replacement
• author: Masao Mutoh
• install:              now!

   sudo gem install gettext
• current ver. 1.10.0
• the basis of using
     Ruby-Ge Te                on Rails
              t   xt-Package




  • applied usage ->
     http://www.yotabanana.com/hiki/
     ja/ruby-gettext-howto-ror.html

sudo gem install gettext
README
Ruby-GetText-Package is a
Localization(L10n) library
and tools which modeled after
GNU gettext package.
This library provides to translate original messages to
localized messages properly using client-side locale information
(environment variable or CGI variable).
On Rails
1. vim config/environment.rb
2. vim app/controllers/application.rb   messy...
3. vim Rakefile
4. rake updatepo
5. (make po files from pot)
6. rake makemo
application
pot file
application
pot file
application
              po files
                 ja
                           de
                      pl
pot file
application
              po files
                 ja
                           de
                      pl
   mo file
demonstration


Mac OSX, zsh, vim, Shiira, rails-1.2.3.6653
checkpoints
checkpoints
•   vim config/environment.rb
•   vim app/controllers/application.rb
•   vim Rakefile
•   rake updatepo
•   (make po files from pot)
•   rake makemo
for edger
require 'gettext/rails'
module GetText
  module ErbParser
    @config = {
      :extnames => ['.rhtml', '.erb']
    }
  end
                config/environment.rb
end
weak points

✴   Bad Knowhow
✴   _('foo')
weak points
• lefty:
  write quot;gettextquot; now!

  rgettext     ;-(
applied theme

• singulars/plurals
• % notation
• setting locale
• edit po files on the web (Pootle)
That's all.
Thank you!
P.S.
On Lisp party #1
           • Paul Graham
           • 2007-08-19
           • welcome!

http://cotocoto.jp/event/1697
On Lisp party #1
           • Paul Graham
           • 2007-08-19
           • welcome!
                   entry now!


http://cotocoto.jp/event/1697
Language Dev Camp
           • make your lang!
           • 2007-09-**

  http://wiki.fdiary.net/ldev/
http://stack.nayutaya.jp/
Stack Stock Books
• Nayutaya
           • for your happy
             stacked books life!

 http://stack.nayutaya.jp/
Stack Stock Books
• Nayutaya
           • for your happy
             stacked books life!

 http://stack.nayutaya.jp/
Stack Stock Books
end
references
•   http://ja.wikipedia.org/wiki/%E8%A8%80%E8%AA%9E

•   http://geekphilosopher.com/MainPage/photos.htm

•   http://commons.wikimedia.org/wiki/Main_Page

Mais conteúdo relacionado

Mais procurados (7)

Rebol
RebolRebol
Rebol
 
Rebol brainwasher
Rebol brainwasherRebol brainwasher
Rebol brainwasher
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Metaprogramming in Ruby
Metaprogramming in RubyMetaprogramming in Ruby
Metaprogramming in Ruby
 
CoffeeScript presentation
CoffeeScript presentationCoffeeScript presentation
CoffeeScript presentation
 
N tier web applications
N tier web applicationsN tier web applications
N tier web applications
 
Javascriptbootcamp
JavascriptbootcampJavascriptbootcamp
Javascriptbootcamp
 

Destaque

HootSuite Dev 2
HootSuite Dev 2HootSuite Dev 2
HootSuite Dev 2
ujihisa
 
Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008
ujihisa
 
Ruby Kansai49
Ruby Kansai49Ruby Kansai49
Ruby Kansai49
ujihisa
 
Ruby Kansai #35 About RubyKaigi2009 ujihisa
Ruby Kansai #35 About RubyKaigi2009 ujihisaRuby Kansai #35 About RubyKaigi2009 ujihisa
Ruby Kansai #35 About RubyKaigi2009 ujihisa
ujihisa
 
Keynote ujihisa.vim#2
Keynote ujihisa.vim#2Keynote ujihisa.vim#2
Keynote ujihisa.vim#2
ujihisa
 
vimconf2013
vimconf2013vimconf2013
vimconf2013
ujihisa
 
進捗報告2007 11 09 15 31 39
進捗報告2007 11 09 15 31 39進捗報告2007 11 09 15 31 39
進捗報告2007 11 09 15 31 39
ujihisa
 
Itc2008 Ujihisa
Itc2008 UjihisaItc2008 Ujihisa
Itc2008 Ujihisa
ujihisa
 
Hootsuite dev 2011
Hootsuite dev 2011Hootsuite dev 2011
Hootsuite dev 2011
ujihisa
 

Destaque (9)

HootSuite Dev 2
HootSuite Dev 2HootSuite Dev 2
HootSuite Dev 2
 
Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008Agile Web Posting With Ruby / Ruby Kaigi2008
Agile Web Posting With Ruby / Ruby Kaigi2008
 
Ruby Kansai49
Ruby Kansai49Ruby Kansai49
Ruby Kansai49
 
Ruby Kansai #35 About RubyKaigi2009 ujihisa
Ruby Kansai #35 About RubyKaigi2009 ujihisaRuby Kansai #35 About RubyKaigi2009 ujihisa
Ruby Kansai #35 About RubyKaigi2009 ujihisa
 
Keynote ujihisa.vim#2
Keynote ujihisa.vim#2Keynote ujihisa.vim#2
Keynote ujihisa.vim#2
 
vimconf2013
vimconf2013vimconf2013
vimconf2013
 
進捗報告2007 11 09 15 31 39
進捗報告2007 11 09 15 31 39進捗報告2007 11 09 15 31 39
進捗報告2007 11 09 15 31 39
 
Itc2008 Ujihisa
Itc2008 UjihisaItc2008 Ujihisa
Itc2008 Ujihisa
 
Hootsuite dev 2011
Hootsuite dev 2011Hootsuite dev 2011
Hootsuite dev 2011
 

Semelhante a I35s

ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008
John Mettraux
 
Variables & Expressions
Variables & ExpressionsVariables & Expressions
Variables & Expressions
Rich Price
 
BNC Tech Forum 09: Lexcycle Stanza demo
BNC Tech Forum 09: Lexcycle Stanza demoBNC Tech Forum 09: Lexcycle Stanza demo
BNC Tech Forum 09: Lexcycle Stanza demo
BookNet Canada
 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
tomaspavelka
 
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
adunne
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
QConLondon2008
 

Semelhante a I35s (20)

Ruby
RubyRuby
Ruby
 
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPPFast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008
 
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 TokyoCorporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
Corporate Perl in Recruit, OpenSocial and Emoji‎ - YAPC::Asia 2009 Tokyo
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Variables & Expressions
Variables & ExpressionsVariables & Expressions
Variables & Expressions
 
Linked Data on Rails
Linked Data on RailsLinked Data on Rails
Linked Data on Rails
 
BNC Tech Forum 09: Lexcycle Stanza demo
BNC Tech Forum 09: Lexcycle Stanza demoBNC Tech Forum 09: Lexcycle Stanza demo
BNC Tech Forum 09: Lexcycle Stanza demo
 
Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
 
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
 
How To Build And Launch A Successful Globalized App From Day One Or All The ...
How To Build And Launch A Successful Globalized App From Day One  Or All The ...How To Build And Launch A Successful Globalized App From Day One  Or All The ...
How To Build And Launch A Successful Globalized App From Day One Or All The ...
 
開発環境と言語
開発環境と言語開発環境と言語
開発環境と言語
 
Living in a multiligual world: Internationalization for Web 2.0 Applications
Living in a multiligual world: Internationalization for Web 2.0 ApplicationsLiving in a multiligual world: Internationalization for Web 2.0 Applications
Living in a multiligual world: Internationalization for Web 2.0 Applications
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
Practical Groovy DSL
Practical Groovy DSLPractical Groovy DSL
Practical Groovy DSL
 
Till Vollmer Presentation
Till Vollmer PresentationTill Vollmer Presentation
Till Vollmer Presentation
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)
 

Mais de ujihisa

vimshell made other shells legacy
vimshell made other shells legacyvimshell made other shells legacy
vimshell made other shells legacy
ujihisa
 
CoffeeScript in hootsuite
CoffeeScript in hootsuiteCoffeeScript in hootsuite
CoffeeScript in hootsuite
ujihisa
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)
ujihisa
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisa
ujihisa
 
All About Metarw -- VimM#2
All About Metarw -- VimM#2All About Metarw -- VimM#2
All About Metarw -- VimM#2
ujihisa
 
From Java To Haskell P
From Java To Haskell PFrom Java To Haskell P
From Java To Haskell P
ujihisa
 
Ruby Monad
Ruby MonadRuby Monad
Ruby Monad
ujihisa
 
進捗報告2007-09-11
進捗報告2007-09-11進捗報告2007-09-11
進捗報告2007-09-11
ujihisa
 
言語開発合宿
言語開発合宿言語開発合宿
言語開発合宿
ujihisa
 

Mais de ujihisa (19)

KOF2013 Minecraft / Clojure
KOF2013 Minecraft / ClojureKOF2013 Minecraft / Clojure
KOF2013 Minecraft / Clojure
 
vimshell made other shells legacy
vimshell made other shells legacyvimshell made other shells legacy
vimshell made other shells legacy
 
From Ruby to Haskell (Kansai Yami RubyKaigi)
From Ruby to Haskell (Kansai Yami RubyKaigi)From Ruby to Haskell (Kansai Yami RubyKaigi)
From Ruby to Haskell (Kansai Yami RubyKaigi)
 
Text Manipulation with/without Parsec
Text Manipulation with/without ParsecText Manipulation with/without Parsec
Text Manipulation with/without Parsec
 
CoffeeScript in hootsuite
CoffeeScript in hootsuiteCoffeeScript in hootsuite
CoffeeScript in hootsuite
 
LLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, JapanLLVM Workshop Osaka Umeda, Japan
LLVM Workshop Osaka Umeda, Japan
 
RubyConf 2009 LT "Termtter"
RubyConf 2009 LT "Termtter"RubyConf 2009 LT "Termtter"
RubyConf 2009 LT "Termtter"
 
Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)Hacking parse.y (RubyConf 2009)
Hacking parse.y (RubyConf 2009)
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)
 
Hacking Parse.y with ujihisa
Hacking Parse.y with ujihisaHacking Parse.y with ujihisa
Hacking Parse.y with ujihisa
 
Kof2008 Itll
Kof2008 ItllKof2008 Itll
Kof2008 Itll
 
All About Metarw -- VimM#2
All About Metarw -- VimM#2All About Metarw -- VimM#2
All About Metarw -- VimM#2
 
Agile Web Posting with Ruby (lang:ja)
Agile Web Posting with Ruby (lang:ja)Agile Web Posting with Ruby (lang:ja)
Agile Web Posting with Ruby (lang:ja)
 
From Java To Haskell P
From Java To Haskell PFrom Java To Haskell P
From Java To Haskell P
 
Ruby Monad
Ruby MonadRuby Monad
Ruby Monad
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
How To Use Kagemusha
How To Use KagemushaHow To Use Kagemusha
How To Use Kagemusha
 
進捗報告2007-09-11
進捗報告2007-09-11進捗報告2007-09-11
進捗報告2007-09-11
 
言語開発合宿
言語開発合宿言語開発合宿
言語開発合宿
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

I35s