SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
An i18n Journey
Andy Waite
November 2013
notonthehighstreet.com
notonthehighstreet.de
Basics
Lots of extracting to t(…) and l(…)
rails-i18n gem helps a lot for supported languages.
Coverage of dates, times, numbers, error messages.
But doesn’t help for JavaScript-heavy sites
Single or Separate DBs?
Each site to have separate products and suppliers
Scoping everything by site - massive amount of work.
Site was MySQL so couldn’t use Postgres schemas for multi-
tenancy (Apartment gem).
Went with separate DBs for UK and German sites.
Schema migrations run on both sites to keep schemas the same.
But used primary key offsets so that we could potentially merge
back together in future.
Database State Values
Generally not i18n friendly
<%= order.status.titleize %>
Order.where(status: ‘shipped’)
Timezones
Changing timezone -> broken tests -> usually due to a badly
designed test
Zonebie gem (time zone randomization)
Time.parse -> Time.zone.parse
Time.now -> Time.zone.now
.to_time -> .to_time_in_current_zone
Use ISO8601 for APIs (“2012-03-16T14:55:33Z")
Credit Cards
Two-thirds of Germans don’t own a credit card
Second lowest credit card use in all of EU
‘debt’ == ‘guilt’ (Schuld)
Capitalization
German is the only language in the world that requires
the capitalization of ALL nouns.
der amerikanische Präsident
#titleize considered harmful
Crazy Pluralization
English / German: one, other
Icelandic:
one:	 1, 21, 31, 41, 51, 61, …, 0.1, 0.2, 0.3
other	 0, 2-20, 22-30, 32-40, …, 0.0, 2.0, 3.0, …
Arabic:
zero	 0, 0.0, …	
one	 1, 1.00, 1.0, …	
two	 2, 2.00, 2.00, 2.0, …	
few	 3-10, 103-110, 203-210, …, 3.00, 3.00, 4.00, …
many	 11-99, 111-199, 211-299, …, 11.00, 11.00, 12.00, …
other	 100-102, 200-202, 300-302, …, 0.1, 0.2, 0.3, …
http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
blog.andywaite.com
@andyw8
Lessons Learned
Stick to Rails conventions
Demo to native speakers as early as you can
Consider i18n-friendly-by-default approach:
Store all strings in YAML config
Wrap date/number/currency calls in l(…) in views

Mais conteúdo relacionado

Destaque

Sem Projects
Sem ProjectsSem Projects
Sem Projects
zacharys
 
karen-e-malone resume
karen-e-malone resumekaren-e-malone resume
karen-e-malone resume
Karen Malone
 

Destaque (13)

Internationalization (i18n) Primer
Internationalization (i18n) PrimerInternationalization (i18n) Primer
Internationalization (i18n) Primer
 
Sem Projects
Sem ProjectsSem Projects
Sem Projects
 
Virus y antivirus informáticas
Virus y antivirus informáticasVirus y antivirus informáticas
Virus y antivirus informáticas
 
ενοτητα 3η
ενοτητα 3ηενοτητα 3η
ενοτητα 3η
 
Virus y antivirus nelson vargas
Virus y antivirus nelson vargasVirus y antivirus nelson vargas
Virus y antivirus nelson vargas
 
Blog5
Blog5Blog5
Blog5
 
karen-e-malone resume
karen-e-malone resumekaren-e-malone resume
karen-e-malone resume
 
Localization
LocalizationLocalization
Localization
 
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
 
S ba0881 big-data-use-cases-pearson-edge2015-v7
S ba0881 big-data-use-cases-pearson-edge2015-v7S ba0881 big-data-use-cases-pearson-edge2015-v7
S ba0881 big-data-use-cases-pearson-edge2015-v7
 
La etologia del caballo 1
La etologia del caballo 1La etologia del caballo 1
La etologia del caballo 1
 
Tasting i18n
Tasting i18nTasting i18n
Tasting i18n
 
صناعة الصابون الطبيعي
صناعة الصابون الطبيعيصناعة الصابون الطبيعي
صناعة الصابون الطبيعي
 

Semelhante a An i18n Journey

Tuning the HotSpot JVM Garbage Collectors
Tuning the HotSpot JVM Garbage CollectorsTuning the HotSpot JVM Garbage Collectors
Tuning the HotSpot JVM Garbage Collectors
langer4711
 
MongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, AnalyticsMongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB
 

Semelhante a An i18n Journey (20)

AWS Customer Presentation - HotPads
AWS Customer Presentation - HotPadsAWS Customer Presentation - HotPads
AWS Customer Presentation - HotPads
 
ArangoDB 3.7 Roadmap: Performance at Scale
ArangoDB 3.7 Roadmap: Performance at ScaleArangoDB 3.7 Roadmap: Performance at Scale
ArangoDB 3.7 Roadmap: Performance at Scale
 
Scalding big ADta
Scalding big ADtaScalding big ADta
Scalding big ADta
 
Cost effective BigData Processing on Amazon EC2
Cost effective BigData Processing on Amazon EC2Cost effective BigData Processing on Amazon EC2
Cost effective BigData Processing on Amazon EC2
 
Tuning the HotSpot JVM Garbage Collectors
Tuning the HotSpot JVM Garbage CollectorsTuning the HotSpot JVM Garbage Collectors
Tuning the HotSpot JVM Garbage Collectors
 
IronRuby - A brave new world for .Net (NDC2010)
IronRuby - A brave new world for .Net (NDC2010)IronRuby - A brave new world for .Net (NDC2010)
IronRuby - A brave new world for .Net (NDC2010)
 
Fighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with EmbulkFighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with Embulk
 
MongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, AnalyticsMongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, Analytics
 
Jayway Web Tech Radar 2015
Jayway Web Tech Radar 2015Jayway Web Tech Radar 2015
Jayway Web Tech Radar 2015
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
STP201 Efficiency at Scale - AWS re: Invent 2012
STP201 Efficiency at Scale - AWS re: Invent 2012STP201 Efficiency at Scale - AWS re: Invent 2012
STP201 Efficiency at Scale - AWS re: Invent 2012
 
1Spatial: Cardiff FME World Tour: Time machines and attribute alchemy
1Spatial: Cardiff FME World Tour: Time machines and attribute alchemy1Spatial: Cardiff FME World Tour: Time machines and attribute alchemy
1Spatial: Cardiff FME World Tour: Time machines and attribute alchemy
 
Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019Dask and Machine Learning Models in Production - PyColorado 2019
Dask and Machine Learning Models in Production - PyColorado 2019
 
Mongodb beijingconf yottaa_3.3
Mongodb beijingconf yottaa_3.3Mongodb beijingconf yottaa_3.3
Mongodb beijingconf yottaa_3.3
 
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
 
Sorry - How Bieber broke Google Cloud at Spotify
Sorry - How Bieber broke Google Cloud at SpotifySorry - How Bieber broke Google Cloud at Spotify
Sorry - How Bieber broke Google Cloud at Spotify
 
System Design.pdf
System Design.pdfSystem Design.pdf
System Design.pdf
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 
SEO for Large/Enterprise Websites - Data & Tech Side
SEO for Large/Enterprise Websites - Data & Tech SideSEO for Large/Enterprise Websites - Data & Tech Side
SEO for Large/Enterprise Websites - Data & Tech Side
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Último (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 

An i18n Journey

  • 1. An i18n Journey Andy Waite November 2013
  • 3. Basics Lots of extracting to t(…) and l(…) rails-i18n gem helps a lot for supported languages. Coverage of dates, times, numbers, error messages. But doesn’t help for JavaScript-heavy sites
  • 4. Single or Separate DBs? Each site to have separate products and suppliers Scoping everything by site - massive amount of work. Site was MySQL so couldn’t use Postgres schemas for multi- tenancy (Apartment gem). Went with separate DBs for UK and German sites. Schema migrations run on both sites to keep schemas the same. But used primary key offsets so that we could potentially merge back together in future.
  • 5. Database State Values Generally not i18n friendly <%= order.status.titleize %> Order.where(status: ‘shipped’)
  • 6. Timezones Changing timezone -> broken tests -> usually due to a badly designed test Zonebie gem (time zone randomization) Time.parse -> Time.zone.parse Time.now -> Time.zone.now .to_time -> .to_time_in_current_zone Use ISO8601 for APIs (“2012-03-16T14:55:33Z")
  • 7. Credit Cards Two-thirds of Germans don’t own a credit card Second lowest credit card use in all of EU ‘debt’ == ‘guilt’ (Schuld)
  • 8. Capitalization German is the only language in the world that requires the capitalization of ALL nouns. der amerikanische Präsident #titleize considered harmful
  • 9. Crazy Pluralization English / German: one, other Icelandic: one: 1, 21, 31, 41, 51, 61, …, 0.1, 0.2, 0.3 other 0, 2-20, 22-30, 32-40, …, 0.0, 2.0, 3.0, … Arabic: zero 0, 0.0, … one 1, 1.00, 1.0, … two 2, 2.00, 2.00, 2.0, … few 3-10, 103-110, 203-210, …, 3.00, 3.00, 4.00, … many 11-99, 111-199, 211-299, …, 11.00, 11.00, 12.00, … other 100-102, 200-202, 300-302, …, 0.1, 0.2, 0.3, … http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
  • 11. Lessons Learned Stick to Rails conventions Demo to native speakers as early as you can Consider i18n-friendly-by-default approach: Store all strings in YAML config Wrap date/number/currency calls in l(…) in views