SlideShare uma empresa Scribd logo
1 de 8
How to Localize your Ruby on Rails
web application
Bethany Rentz
July 24, 2013
Why localize?
Estimates of the number of Internet users by language as of 31 May 2011:
[4]
"Number of Internet Users by Language", Internet World Stats, Miniwatts Marketing Group, 31 May 2011, accessed 22 April 2012
Home Page
Create a new important date
1) Setup your application for localizing
a) Change URL format to include locale (in routes.rb)
ex: http://localhost:3000/fr
scope "/:locale", :locale => /en|fr/ do
resources :importantdates
end
b) Add setting to application_controller.rb
before_filter :set_locale
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
c)Create .yml files in config/locales for each language you are supporting
* can find pre-localized .yml files at: https://github.com/svenfuchs/rails-i18n
How to localize?
en.yml fr.yml
2) Use 2 methods from public API in your specs and code:
● I18n.translate or I18n.t – translate text
● I18n.localize or I18n.l – format dates
Resources
• Ruby on Rails Guide to localization with i18n.htm
• Repo with locale files for use in your application
• Sample Localized Project

Mais conteúdo relacionado

Destaque

The amazing koi’s melon alvin jade l.
The amazing koi’s  melon alvin jade l.The amazing koi’s  melon alvin jade l.
The amazing koi’s melon alvin jade l.alvinjade
 
Taxonomia animal y vegetal
Taxonomia animal y vegetalTaxonomia animal y vegetal
Taxonomia animal y vegetalRallisongea
 
Mixed-Use Hotel Development Presentation
Mixed-Use Hotel Development PresentationMixed-Use Hotel Development Presentation
Mixed-Use Hotel Development PresentationRoland Buhler
 
Electronic & communication
Electronic & communication Electronic & communication
Electronic & communication Abhishekbauriya
 
Starbucks Coffee Kiosk Business Plan in Pune
Starbucks Coffee Kiosk Business Plan in Pune Starbucks Coffee Kiosk Business Plan in Pune
Starbucks Coffee Kiosk Business Plan in Pune Prerna Jha
 

Destaque (6)

The amazing koi’s melon alvin jade l.
The amazing koi’s  melon alvin jade l.The amazing koi’s  melon alvin jade l.
The amazing koi’s melon alvin jade l.
 
Taxonomia animal y vegetal
Taxonomia animal y vegetalTaxonomia animal y vegetal
Taxonomia animal y vegetal
 
Mixed-Use Hotel Development Presentation
Mixed-Use Hotel Development PresentationMixed-Use Hotel Development Presentation
Mixed-Use Hotel Development Presentation
 
CFL
CFLCFL
CFL
 
Electronic & communication
Electronic & communication Electronic & communication
Electronic & communication
 
Starbucks Coffee Kiosk Business Plan in Pune
Starbucks Coffee Kiosk Business Plan in Pune Starbucks Coffee Kiosk Business Plan in Pune
Starbucks Coffee Kiosk Business Plan in Pune
 

Semelhante a Localizing web sites in ruby on rails

Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2Vinh Nguyen
 
shobhit training report (3) (4).pdf report
shobhit training report (3) (4).pdf reportshobhit training report (3) (4).pdf report
shobhit training report (3) (4).pdf reportpoojaranga2911
 
HTML5 Next - Potential and opportunities in HTML5 development for mobile
HTML5 Next - Potential and opportunities in HTML5 development for mobileHTML5 Next - Potential and opportunities in HTML5 development for mobile
HTML5 Next - Potential and opportunities in HTML5 development for mobileChiara Zecchetto
 
Lecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesLecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesMubashir Ali
 
MyMobileWeb Certification Part I
MyMobileWeb Certification Part IMyMobileWeb Certification Part I
MyMobileWeb Certification Part Icrdlc
 
Best things to know about .net framework
Best things to know about .net frameworkBest things to know about .net framework
Best things to know about .net frameworkShelly Megan
 
Net framework
Net frameworkNet framework
Net frameworkjhsri
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET BasicKALIDHASANR
 
A Survey on Various Web Technologies
A Survey on Various Web TechnologiesA Survey on Various Web Technologies
A Survey on Various Web Technologiesijsrd.com
 
Online lg prodect
Online lg prodectOnline lg prodect
Online lg prodectYesu Raj
 
Learn .NET Core - Introduction
Learn .NET Core - IntroductionLearn .NET Core - Introduction
Learn .NET Core - IntroductionEng Teong Cheah
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net Jaya Kumari
 

Semelhante a Localizing web sites in ruby on rails (20)

Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2
 
shobhit training report (3) (4).pdf report
shobhit training report (3) (4).pdf reportshobhit training report (3) (4).pdf report
shobhit training report (3) (4).pdf report
 
HTML5 Next - Potential and opportunities in HTML5 development for mobile
HTML5 Next - Potential and opportunities in HTML5 development for mobileHTML5 Next - Potential and opportunities in HTML5 development for mobile
HTML5 Next - Potential and opportunities in HTML5 development for mobile
 
Lecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & DatabasesLecture-4: Introduction to Programming & Databases
Lecture-4: Introduction to Programming & Databases
 
MyMobileWeb Certification Part I
MyMobileWeb Certification Part IMyMobileWeb Certification Part I
MyMobileWeb Certification Part I
 
Best things to know about .net framework
Best things to know about .net frameworkBest things to know about .net framework
Best things to know about .net framework
 
Net framework
Net frameworkNet framework
Net framework
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
 
A Survey on Various Web Technologies
A Survey on Various Web TechnologiesA Survey on Various Web Technologies
A Survey on Various Web Technologies
 
Melvin Cureton Resume
Melvin Cureton ResumeMelvin Cureton Resume
Melvin Cureton Resume
 
Mobile Application Development class 001
Mobile Application Development class 001Mobile Application Development class 001
Mobile Application Development class 001
 
Online lg prodect
Online lg prodectOnline lg prodect
Online lg prodect
 
Planetdata simpda
Planetdata simpdaPlanetdata simpda
Planetdata simpda
 
PlanetData: Consuming Structured Data at Web Scale
PlanetData: Consuming Structured Data at Web ScalePlanetData: Consuming Structured Data at Web Scale
PlanetData: Consuming Structured Data at Web Scale
 
Learn .NET Core - Introduction
Learn .NET Core - IntroductionLearn .NET Core - Introduction
Learn .NET Core - Introduction
 
ColdBox i18N
ColdBox i18N ColdBox i18N
ColdBox i18N
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Introduction to .net
Introduction to .net Introduction to .net
Introduction to .net
 
test4
test4test4
test4
 

Último

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 WorkerThousandEyes
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Localizing web sites in ruby on rails

  • 1. How to Localize your Ruby on Rails web application Bethany Rentz July 24, 2013
  • 2. Why localize? Estimates of the number of Internet users by language as of 31 May 2011: [4] "Number of Internet Users by Language", Internet World Stats, Miniwatts Marketing Group, 31 May 2011, accessed 22 April 2012
  • 4. Create a new important date
  • 5. 1) Setup your application for localizing a) Change URL format to include locale (in routes.rb) ex: http://localhost:3000/fr scope "/:locale", :locale => /en|fr/ do resources :importantdates end b) Add setting to application_controller.rb before_filter :set_locale def set_locale I18n.locale = params[:locale] || I18n.default_locale end c)Create .yml files in config/locales for each language you are supporting * can find pre-localized .yml files at: https://github.com/svenfuchs/rails-i18n How to localize?
  • 7. 2) Use 2 methods from public API in your specs and code: ● I18n.translate or I18n.t – translate text ● I18n.localize or I18n.l – format dates
  • 8. Resources • Ruby on Rails Guide to localization with i18n.htm • Repo with locale files for use in your application • Sample Localized Project

Notas do Editor

  1. 1) update specs – use localized strings I18n.t(:date_added)