SlideShare a Scribd company logo
1 of 92
TRANSLATING RUBY OSS

      Christopher Dell
          @tigrish
DISCLAIMER
                                         WOW!




I cofounded
    this




                                                Try it, it’s
                                                awesome!




              http://www.localeapp.com
SOME TRANSLATED PROJECTS
SOME TRANSLATED PROJECTS
      Gems


- rails

- devise

- will-paginate
SOME TRANSLATED PROJECTS
      Gems              Apps


- rails           - ChiliProject

- devise          - Spree

- will-paginate   - LocomotiveCMS
SOME TRANSLATED PROJECTS
      Gems              Apps             CLIs


- rails           - ChiliProject    - remarkable

- devise          - Spree           -?

- will-paginate   - LocomotiveCMS
SOME TRANSLATED PROJECTS
      Gems              Apps             CLIs


- rails           - ChiliProject    - remarkable

- devise          - Spree           -?

- will-paginate   - LocomotiveCMS



                     i18n gem
THE TERRIBLE TWO




    Terrance                                Phillip
“the translator”                      “the programmer”
THE PROGRAMMER
THE PROGRAMMER

is involved in internationalization
THE PROGRAMMER

is involved in internationalization



             i18n
THE TRANSLATOR
THE TRANSLATOR

 is involved in localization
THE TRANSLATOR

 is involved in localization



          l10n
FIGHT!
heart will go
                                  on edition




not a real project




                     celine-db
heart will go
                                   on edition




not a real project




                     celine-db-i18n
What should our default
    language be?
What should our default
    language be?




  ...probably English
✔
✔

    ✔
✔

    ✔

        ?
PROO00OOOOOT
All your base are belong
       to en-US
Colour         Colour
Localisation   Localization
Colour         Colour
Localisation   Localization


Jam            Jelly
Colour         Colour
Localisation   Localization


Jam            Jelly



Jelly          Jell-o
Colour         Colour
             Localisation   Localization


             Jam            Jelly



             Jelly          Jell-o



06/02/2012   6th Feb 2012   2nd Jun 2012
LANGUAGES ≠LOCALES
Let’s use YAML for storage
      and distribution
Let’s use YAML for storage
          and distribution




•   Ruby std lib
Let’s use YAML for storage
          and distribution




•   Ruby std lib

•   Used by i18n’s Simple Backend
Let’s use YAML for storage
          and distribution




•   Ruby std lib

•   Used by i18n’s Simple Backend

•   Text file, simple structure
/lib/ruby/1.9.2/psych.rb:148:in `parse': couldn't parse YAML
         at line 182 column 9 (Psych::SyntaxError)
I18N-SPEC
github.com/tigrish/i18n-spec
I18N-SPEC
                    github.com/tigrish/i18n-spec

describe "config/locales/en.yml" do
  it { should be_parseable }
  it { should have_valid_pluralization_keys }
  it { should have_one_top_level_namespace }
  it { should be_named_like_top_level_namespace }
  it { should_not have_legacy_interpolations }
end
I18N-SPEC
                    github.com/tigrish/i18n-spec

describe "config/locales/en.yml" do
  it { should be_parseable }
  it { should have_valid_pluralization_keys }
  it { should have_one_top_level_namespace }
  it { should be_named_like_top_level_namespace }
  it { should_not have_legacy_interpolations }
end


Dir.glob('config/locales/*.yml') do |locale_file|
  describe "a locale file" do
    it_behaves_like 'a valid locale file', locale_file
  end
end
I18N-SPEC
github.com/tigrish/i18n-spec
I18N-SPEC
                   github.com/tigrish/i18n-spec


describe "config/locales/fr.yml" do
  it { should be_a_subset_of ‘config/locales/en.yml’ }
end
I18N-SPEC
                   github.com/tigrish/i18n-spec


describe "config/locales/fr.yml" do
  it { should be_a_subset_of ‘config/locales/en.yml’ }
end




describe "config/locales/fr.yml" do
  it {
    should be_a_complete_translation_of ‘config/locales/en.yml’
  }
end
There’s a grammar
     error !
There’s a grammar
     error !



    In French, the phrase :

“1.2 regards fataux”
         should be :

 “1.2 regard fatal”
<?= t(:regard_fatal, :count => 1.2) ?>
<?= t(:regard_fatal, :count => 1.2) ?>




regard_fatal:
   one: 1 regard fatal
   other: %{count} regards fataux
<?= t(:regard_fatal, :count => 1.2) ?>
                                         WTF?




regard_fatal:
   one: 1 regard fatal
   other: %{count} regards fataux
CLDR
Unicode Common Locale Data Repository

            cldr.unicode.org
CLDR
Unicode Common Locale Data Repository

             cldr.unicode.org

     •   Dates, Times, Time Zones
     •   Numbers, Currencies
     •   Sorting
     •   Languages, Countries
     •   Pluralizations
     •   Charsets, Collations
     •   Transliterations
CLDR
CLDR
CLDR


XML
CLDR


XML


Java
RUBY-CLDR
github.com/svenfuchs/ruby-cldr
data/fr/plurals.rb


{
    :fr => {
      :i18n => {
        :plural => {
          :keys => [:one, :other],
          :rule => lambda { |n| n.between?(0, 2) && n != 2 :one : :other }
        }
      }
    }
}
if n % 10 == 1 && n % 100 != 11
     :one
elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100)
     :few
elsif n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100)
     :many
else
     :other
end
if n % 10 == 1 && n % 100 != 11
     :one
elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100)
     :few
elsif n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100)
     :many
else
     :other
end




0   :   many            10   :   many          20   :   many           30   : many
1   :   one             11   :   many          21   :   one            30.5 : other
2   :   few             12   :   many          22   :   few
3   :   few             13   :   many          23   :   few
4   :   few             14   :   many          24   :   few
5   :   many            15   :   many          25   :   many
6   :   many            16   :   many          26   :   many
7   :   many            17   :   many          27   :   many
8   :   many            18   :   many          28   :   many
9   :   many            19   :   many          29   :   many
kittens:
  zero: Sorry, no kittens
  other: %{count} kittens
<? if kittens.size > 0 ?>
                              <?= t :kittens,
kittens:
                                    :count => kittens.size ?%>
  zero: Sorry, no kittens
                            <? else ?>
  other: %{count} kittens
                              <?= t :no_kittens ?%>
                            <? end ?>
<? if kittens.size > 0 ?>
                              <?= t :kittens,
kittens:
                                    :count => kittens.size ?%>
  zero: Sorry, no kittens
                            <? else ?>
  other: %{count} kittens
                              <?= t :no_kittens ?%>
                            <? end ?>




kittens:
  one: One kitten
  other: %{count} kittens
<? if kittens.size > 0 ?>
                              <?= t :kittens,
kittens:
                                    :count => kittens.size ?%>
  zero: Sorry, no kittens
                            <? else ?>
  other: %{count} kittens
                              <?= t :no_kittens ?%>
                            <? end ?>




kittens:                    kittens:
  one: One kitten             one: %{count} kitten
  other: %{count} kittens     other: %{count} kittens
v1.0
v1.0


celine-db-i18n
MANUAL
MANUAL
✓   Only use what you need
MANUAL
✓   Only use what you need

✓   Good translation visibility
MANUAL
✓   Only use what you need         X   Need to repeat for each additional locale

✓   Good translation visibility
MANUAL
✓   Only use what you need         X   Need to repeat for each additional locale

✓   Good translation visibility    X   Need to repeat with each update
BUNDLER
BUNDLER
✓   All locales included
BUNDLER
✓   All locales included

✓   Easy updates
BUNDLER
✓   All locales included   X   Memory usage

✓   Easy updates
BUNDLER
✓   All locales included   X   Memory usage

✓   Easy updates           X   Load path issues
LOCALE
LOCALE
✓   Good translation visibility
LOCALE
✓   Good translation visibility

✓   Easy updates
LOCALE
✓   Good translation visibility   X   Small selection of libraries

✓   Easy updates
•   locale : http://www.localeapp.com/
•   i18n : https://github.com/svenfuchs/i18n
•   rails-i18n : https://github.com/svenfuchs/rails-i18n
•   i18n-spec : https://github.com/tigrish/i18n-spec
•   cldr : http://cldr.unicode.org/
•   ruby-cldr : https://github.com/svenfuchs/ruby-cldr
•   devise-i18n : https://github.com/tigrish/devise-i18n
•   will-paginate-i18n : https://github.com/tigrish/will-paginate-i18n

More Related Content

Viewers also liked

Anti slapp law of california
Anti slapp law of californiaAnti slapp law of california
Anti slapp law of californiaVogelDenise
 
041413 public notice (031113 fax to barack obama) - vietnamese
041413   public notice (031113 fax to barack obama) - vietnamese041413   public notice (031113 fax to barack obama) - vietnamese
041413 public notice (031113 fax to barack obama) - vietnameseVogelDenise
 
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - JapaneseVogelDenise
 
060812 EEOC Response (BENGALI)
060812  EEOC Response (BENGALI)060812  EEOC Response (BENGALI)
060812 EEOC Response (BENGALI)VogelDenise
 
United States of America – IMMIGRATION REFORM - HINDI
United States of America – IMMIGRATION REFORM - HINDIUnited States of America – IMMIGRATION REFORM - HINDI
United States of America – IMMIGRATION REFORM - HINDIVogelDenise
 
Interpol bringing the united states to justice (icelandic)
Interpol   bringing the united states to justice (icelandic)Interpol   bringing the united states to justice (icelandic)
Interpol bringing the united states to justice (icelandic)VogelDenise
 
Slavery In America
Slavery In AmericaSlavery In America
Slavery In AmericaRachelCoop3
 
021013 adecco email (japanese)
021013   adecco email (japanese)021013   adecco email (japanese)
021013 adecco email (japanese)VogelDenise
 
George zimmerman's re enactment (swedish)
George zimmerman's re enactment (swedish)George zimmerman's re enactment (swedish)
George zimmerman's re enactment (swedish)VogelDenise
 
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)VogelDenise
 
United States of America – IMMIGRATION REFORM - SLOVENIAN
United States of America – IMMIGRATION REFORM - SLOVENIANUnited States of America – IMMIGRATION REFORM - SLOVENIAN
United States of America – IMMIGRATION REFORM - SLOVENIANVogelDenise
 
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...Mike Arnesen
 
Obama read my lips -obama fraudgate (kannada)
Obama   read my lips -obama fraudgate (kannada)Obama   read my lips -obama fraudgate (kannada)
Obama read my lips -obama fraudgate (kannada)VogelDenise
 
Foreign ai dppoint
Foreign ai dppointForeign ai dppoint
Foreign ai dppointmhaine22
 

Viewers also liked (17)

Anti slapp law of california
Anti slapp law of californiaAnti slapp law of california
Anti slapp law of california
 
041413 public notice (031113 fax to barack obama) - vietnamese
041413   public notice (031113 fax to barack obama) - vietnamese041413   public notice (031113 fax to barack obama) - vietnamese
041413 public notice (031113 fax to barack obama) - vietnamese
 
Panduan perbaikan
Panduan perbaikanPanduan perbaikan
Panduan perbaikan
 
langar
langarlangar
langar
 
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese
030215 - REQUEST TO REOPEN EEOC CHARGE - 1st Heritage Credit - Japanese
 
060812 EEOC Response (BENGALI)
060812  EEOC Response (BENGALI)060812  EEOC Response (BENGALI)
060812 EEOC Response (BENGALI)
 
United States of America – IMMIGRATION REFORM - HINDI
United States of America – IMMIGRATION REFORM - HINDIUnited States of America – IMMIGRATION REFORM - HINDI
United States of America – IMMIGRATION REFORM - HINDI
 
Doc1
Doc1Doc1
Doc1
 
Interpol bringing the united states to justice (icelandic)
Interpol   bringing the united states to justice (icelandic)Interpol   bringing the united states to justice (icelandic)
Interpol bringing the united states to justice (icelandic)
 
Slavery In America
Slavery In AmericaSlavery In America
Slavery In America
 
021013 adecco email (japanese)
021013   adecco email (japanese)021013   adecco email (japanese)
021013 adecco email (japanese)
 
George zimmerman's re enactment (swedish)
George zimmerman's re enactment (swedish)George zimmerman's re enactment (swedish)
George zimmerman's re enactment (swedish)
 
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)
BAKER DONELSON - Attorney Layoffs The SINKING OF A TERRORIST REGIME (CZECH)
 
United States of America – IMMIGRATION REFORM - SLOVENIAN
United States of America – IMMIGRATION REFORM - SLOVENIANUnited States of America – IMMIGRATION REFORM - SLOVENIAN
United States of America – IMMIGRATION REFORM - SLOVENIAN
 
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...
SwellPath Presents: Responsive Design, Mobile SEO, and the Future of Search M...
 
Obama read my lips -obama fraudgate (kannada)
Obama   read my lips -obama fraudgate (kannada)Obama   read my lips -obama fraudgate (kannada)
Obama read my lips -obama fraudgate (kannada)
 
Foreign ai dppoint
Foreign ai dppointForeign ai dppoint
Foreign ai dppoint
 

Similar to Translating ruby OSS

ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...Puppet
 
Shipping your product overseas!
Shipping your product overseas!Shipping your product overseas!
Shipping your product overseas!Diogo Busanello
 
TDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageTDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageLuciano Sabença
 
WCRI 2015 I18N L10N
WCRI 2015 I18N L10NWCRI 2015 I18N L10N
WCRI 2015 I18N L10NDave McHale
 
Consul ou comment bien tirer sur l’élastique
 Consul ou comment bien tirer sur l’élastique Consul ou comment bien tirer sur l’élastique
Consul ou comment bien tirer sur l’élastiqueNicolas Ledez
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceJesse Vincent
 
Hadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With PythonHadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With PythonJoe Stein
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceJesse Vincent
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion ApplicationsLuca Pradovera
 
Lambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional LanguageLambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional LanguageAccenture | SolutionsIQ
 
BILL Hour: Try something new! (like Sass or Compass)
BILL Hour: Try something new! (like Sass or Compass)BILL Hour: Try something new! (like Sass or Compass)
BILL Hour: Try something new! (like Sass or Compass)Reusser Design, LLC
 
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...Aslak Hellesøy
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Jan Wedekind
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible ProgramsC4Media
 
Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Elliott Kember
 
Finding Translations: Localization and Internationalization in Rails
Finding Translations: Localization and Internationalization in RailsFinding Translations: Localization and Internationalization in Rails
Finding Translations: Localization and Internationalization in RailsValerie Woolard
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applicationsaccount inactive
 

Similar to Translating ruby OSS (20)

ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
ManagingPuppetConf 2017: Multiple Configuration Management Tools- Sally Lehma...
 
Shipping your product overseas!
Shipping your product overseas!Shipping your product overseas!
Shipping your product overseas!
 
TDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageTDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-Language
 
WCRI 2015 I18N L10N
WCRI 2015 I18N L10NWCRI 2015 I18N L10N
WCRI 2015 I18N L10N
 
Consul ou comment bien tirer sur l’élastique
 Consul ou comment bien tirer sur l’élastique Consul ou comment bien tirer sur l’élastique
Consul ou comment bien tirer sur l’élastique
 
Sylius, the good choice
Sylius, the good choiceSylius, the good choice
Sylius, the good choice
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Hadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With PythonHadoop Streaming Tutorial With Python
Hadoop Streaming Tutorial With Python
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 
Lambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional LanguageLambda The Extreme: Test-Driving a Functional Language
Lambda The Extreme: Test-Driving a Functional Language
 
BILL Hour: Try something new! (like Sass or Compass)
BILL Hour: Try something new! (like Sass or Compass)BILL Hour: Try something new! (like Sass or Compass)
BILL Hour: Try something new! (like Sass or Compass)
 
Practical Groovy DSL
Practical Groovy DSLPractical Groovy DSL
Practical Groovy DSL
 
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...
Executable Requirements with Behaviour-Driven Development and Cucumber - Euro...
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)
 
Impossible Programs
Impossible ProgramsImpossible Programs
Impossible Programs
 
Twiggy - let's get our widget on!
Twiggy - let's get our widget on!Twiggy - let's get our widget on!
Twiggy - let's get our widget on!
 
Finding Translations: Localization and Internationalization in Rails
Finding Translations: Localization and Internationalization in RailsFinding Translations: Localization and Internationalization in Rails
Finding Translations: Localization and Internationalization in Rails
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applications
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Translating ruby OSS

  • 1. TRANSLATING RUBY OSS Christopher Dell @tigrish
  • 2. DISCLAIMER WOW! I cofounded this Try it, it’s awesome! http://www.localeapp.com
  • 4. SOME TRANSLATED PROJECTS Gems - rails - devise - will-paginate
  • 5. SOME TRANSLATED PROJECTS Gems Apps - rails - ChiliProject - devise - Spree - will-paginate - LocomotiveCMS
  • 6. SOME TRANSLATED PROJECTS Gems Apps CLIs - rails - ChiliProject - remarkable - devise - Spree -? - will-paginate - LocomotiveCMS
  • 7. SOME TRANSLATED PROJECTS Gems Apps CLIs - rails - ChiliProject - remarkable - devise - Spree -? - will-paginate - LocomotiveCMS i18n gem
  • 8. THE TERRIBLE TWO Terrance Phillip “the translator” “the programmer”
  • 9.
  • 11. THE PROGRAMMER is involved in internationalization
  • 12. THE PROGRAMMER is involved in internationalization i18n
  • 13.
  • 15. THE TRANSLATOR is involved in localization
  • 16. THE TRANSLATOR is involved in localization l10n
  • 17.
  • 19.
  • 20. heart will go on edition not a real project celine-db
  • 21. heart will go on edition not a real project celine-db-i18n
  • 22.
  • 23. What should our default language be?
  • 24. What should our default language be? ...probably English
  • 25.
  • 26.
  • 27.
  • 28. ✔ ?
  • 29.
  • 31.
  • 32. All your base are belong to en-US
  • 33.
  • 34. Colour Colour Localisation Localization
  • 35. Colour Colour Localisation Localization Jam Jelly
  • 36. Colour Colour Localisation Localization Jam Jelly Jelly Jell-o
  • 37. Colour Colour Localisation Localization Jam Jelly Jelly Jell-o 06/02/2012 6th Feb 2012 2nd Jun 2012
  • 39.
  • 40. Let’s use YAML for storage and distribution
  • 41. Let’s use YAML for storage and distribution • Ruby std lib
  • 42. Let’s use YAML for storage and distribution • Ruby std lib • Used by i18n’s Simple Backend
  • 43. Let’s use YAML for storage and distribution • Ruby std lib • Used by i18n’s Simple Backend • Text file, simple structure
  • 44.
  • 45.
  • 46. /lib/ruby/1.9.2/psych.rb:148:in `parse': couldn't parse YAML at line 182 column 9 (Psych::SyntaxError)
  • 47.
  • 49. I18N-SPEC github.com/tigrish/i18n-spec describe "config/locales/en.yml" do it { should be_parseable } it { should have_valid_pluralization_keys } it { should have_one_top_level_namespace } it { should be_named_like_top_level_namespace } it { should_not have_legacy_interpolations } end
  • 50. I18N-SPEC github.com/tigrish/i18n-spec describe "config/locales/en.yml" do it { should be_parseable } it { should have_valid_pluralization_keys } it { should have_one_top_level_namespace } it { should be_named_like_top_level_namespace } it { should_not have_legacy_interpolations } end Dir.glob('config/locales/*.yml') do |locale_file| describe "a locale file" do it_behaves_like 'a valid locale file', locale_file end end
  • 52. I18N-SPEC github.com/tigrish/i18n-spec describe "config/locales/fr.yml" do it { should be_a_subset_of ‘config/locales/en.yml’ } end
  • 53. I18N-SPEC github.com/tigrish/i18n-spec describe "config/locales/fr.yml" do it { should be_a_subset_of ‘config/locales/en.yml’ } end describe "config/locales/fr.yml" do it { should be_a_complete_translation_of ‘config/locales/en.yml’ } end
  • 54.
  • 56. There’s a grammar error ! In French, the phrase : “1.2 regards fataux” should be : “1.2 regard fatal”
  • 57.
  • 59. <?= t(:regard_fatal, :count => 1.2) ?> regard_fatal: one: 1 regard fatal other: %{count} regards fataux
  • 60. <?= t(:regard_fatal, :count => 1.2) ?> WTF? regard_fatal: one: 1 regard fatal other: %{count} regards fataux
  • 61. CLDR Unicode Common Locale Data Repository cldr.unicode.org
  • 62. CLDR Unicode Common Locale Data Repository cldr.unicode.org • Dates, Times, Time Zones • Numbers, Currencies • Sorting • Languages, Countries • Pluralizations • Charsets, Collations • Transliterations
  • 63. CLDR
  • 64. CLDR
  • 67.
  • 69. data/fr/plurals.rb { :fr => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n.between?(0, 2) && n != 2 :one : :other } } } } }
  • 70. if n % 10 == 1 && n % 100 != 11 :one elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) :few elsif n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) :many else :other end
  • 71. if n % 10 == 1 && n % 100 != 11 :one elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) :few elsif n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) :many else :other end 0 : many 10 : many 20 : many 30 : many 1 : one 11 : many 21 : one 30.5 : other 2 : few 12 : many 22 : few 3 : few 13 : many 23 : few 4 : few 14 : many 24 : few 5 : many 15 : many 25 : many 6 : many 16 : many 26 : many 7 : many 17 : many 27 : many 8 : many 18 : many 28 : many 9 : many 19 : many 29 : many
  • 72. kittens: zero: Sorry, no kittens other: %{count} kittens
  • 73. <? if kittens.size > 0 ?> <?= t :kittens, kittens: :count => kittens.size ?%> zero: Sorry, no kittens <? else ?> other: %{count} kittens <?= t :no_kittens ?%> <? end ?>
  • 74. <? if kittens.size > 0 ?> <?= t :kittens, kittens: :count => kittens.size ?%> zero: Sorry, no kittens <? else ?> other: %{count} kittens <?= t :no_kittens ?%> <? end ?> kittens: one: One kitten other: %{count} kittens
  • 75. <? if kittens.size > 0 ?> <?= t :kittens, kittens: :count => kittens.size ?%> zero: Sorry, no kittens <? else ?> other: %{count} kittens <?= t :no_kittens ?%> <? end ?> kittens: kittens: one: One kitten one: %{count} kitten other: %{count} kittens other: %{count} kittens
  • 76. v1.0
  • 79. MANUAL ✓ Only use what you need
  • 80. MANUAL ✓ Only use what you need ✓ Good translation visibility
  • 81. MANUAL ✓ Only use what you need X Need to repeat for each additional locale ✓ Good translation visibility
  • 82. MANUAL ✓ Only use what you need X Need to repeat for each additional locale ✓ Good translation visibility X Need to repeat with each update
  • 84. BUNDLER ✓ All locales included
  • 85. BUNDLER ✓ All locales included ✓ Easy updates
  • 86. BUNDLER ✓ All locales included X Memory usage ✓ Easy updates
  • 87. BUNDLER ✓ All locales included X Memory usage ✓ Easy updates X Load path issues
  • 89. LOCALE ✓ Good translation visibility
  • 90. LOCALE ✓ Good translation visibility ✓ Easy updates
  • 91. LOCALE ✓ Good translation visibility X Small selection of libraries ✓ Easy updates
  • 92. locale : http://www.localeapp.com/ • i18n : https://github.com/svenfuchs/i18n • rails-i18n : https://github.com/svenfuchs/rails-i18n • i18n-spec : https://github.com/tigrish/i18n-spec • cldr : http://cldr.unicode.org/ • ruby-cldr : https://github.com/svenfuchs/ruby-cldr • devise-i18n : https://github.com/tigrish/devise-i18n • will-paginate-i18n : https://github.com/tigrish/will-paginate-i18n

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. - Anecdote sur le dessin\n- Here presented as two different people, but are often just 1 person\n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. - I18n Project Vs. In project app\n
  20. - I18n Project Vs. In project app\n
  21. - I18n Project Vs. In project app\n
  22. - I18n Project Vs. In project app\n
  23. - I18n Project Vs. In project app\n
  24. - Why do we need a default locale in the first place?\n - It&amp;#x2019;s the base that all translations are created from\n
  25. - Why do we need a default locale in the first place?\n - It&amp;#x2019;s the base that all translations are created from\n
  26. English is the universal language\n
  27. English is the universal language\n
  28. English is the universal language\n
  29. NOthing is purer? right? WRONG!!\n
  30. NOthing is purer? right? WRONG!!\n
  31. - Rails says en even though it is really en-US.\n- Change happend end of 2008, at the time i18n didn&amp;#x2019;t support language fallbacks\n- rails-i18n marks the different englishes\n- use whatever locale for your own projects, but en-US for OSS\n
  32. \n
  33. \n
  34. \n
  35. \n
  36. A locale has a cultural or territorial component\nBrazilian portuguese, canadian french, swiss!\n
  37. - There are of course a load of other backends\n- Implement your own by writing a get/set\n
  38. - There are of course a load of other backends\n- Implement your own by writing a get/set\n
  39. - There are of course a load of other backends\n- Implement your own by writing a get/set\n
  40. - There are of course a load of other backends\n- Implement your own by writing a get/set\n
  41. - Might have seen this upgrading to 1.9.2\n- Psych included in 1.9.2 and default\n- Conforms to YAML 1.0\n- Syck to be removed from 1.9.3\n
  42. - Might have seen this upgrading to 1.9.2\n- Psych included in 1.9.2 and default\n- Conforms to YAML 1.0\n- Syck to be removed from 1.9.3\n
  43. - rails-i18n is generated with Locale \n- is compatible since it&amp;#x2019;s the output from Psych\n\n- it would be nice to be able to foresee these file problems\n- Syntax errors aren&amp;#x2019;t the only problem (ex: indentation)\n
  44. - rspec shared examples\n
  45. - rspec shared examples\n
  46. - Advantage is that I don&amp;#x2019;t need to be able to read the locale file to know it&amp;#x2019;s valid\n- It&amp;#x2019;s integrated into my regular development workflow\n- autotest, guard, travis-ci\n
  47. - Advantage is that I don&amp;#x2019;t need to be able to read the locale file to know it&amp;#x2019;s valid\n- It&amp;#x2019;s integrated into my regular development workflow\n- autotest, guard, travis-ci\n
  48. \n
  49. \n
  50. Looks i18n doesn&amp;#x2019;t understand the proper grammer\n
  51. Looks i18n doesn&amp;#x2019;t understand the proper grammer\n
  52. Looks i18n doesn&amp;#x2019;t understand the proper grammer\n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. You build the project and it creates ruby / yaml\n
  60. You build the project and it creates ruby / yaml\n
  61. - ruby-cldr formats for i18n\n- By inserting this into config/locales we get proper pluralization rules\n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n