#26 new
calavera

I18n, look up a translation with the default locale when it's missed with another specific locale

Reported by calavera | May 13th, 2009 @ 10:20 PM

This feature has already been validated, revised and voted in the Rails tracker

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2637-patch-i18n-look-up-a-translation-with-the-default-locale-when-its-missed-with-another-specific-locale#ticket-2637-11

've added an I18n option to allow to look up a translation with the default locale when it's missed with another specific locale.

This is a useful option if you don't want your page will crash when misses a translation and you don't want to use the default option in each translation. It's inspired by the gettext behaviour.

For example, I have this code in an initializer:

  I18n.use_default_locale_on_missing_translation = true
  I18n.default_locale = :en

And two translation files, en.yml and es.yml:

  en:

hello: 'hello'
hello_world: 'hello world'



es:
hello_world: 'hola mundo'</code>



When I execute this code:

  I18n.t :hello, :locale => :es

Rails returns hello instead of send an error

Comments and changes to this ticket

  • Kieran P

    Kieran P July 9th, 2009 @ 12:16 AM

    +1 since it is optional and false by default. Since that'll mean existing functionality works as expected, is there any reason stopping this change?

  • Madicim1958

    Madicim1958 January 20th, 2019 @ 06:06 AM

    Good information from the author. Here this posts the list of school result shown their brilliant students and their trained teachers. This assignment writing help australia to manage any kind of post. Amazing information from this blog.

  • sergi constance

    sergi constance April 16th, 2019 @ 12:02 PM

    How do i find file explorer windows 10,window are mostly using in operating system,now update your window http://fileexplorerwindows.com this batter file manage application.

  • markpitt

    markpitt January 2nd, 2020 @ 10:43 AM

    You shared a useful post and thanks for sharing this to us. Keep sharing the new things like this. For getting more updates about the best apps you can check this apps for pc.

  • Adam Thomas

    Adam Thomas January 7th, 2020 @ 01:13 PM

    AllAssignmentHelp.com helps Students sometimes get troubles with these assignments and projects. While Java is still a fair programming language as compared to other languages, it is still very complicated to make assignments and projects. Students often take Java homework help from the online research paper writing services to help them out from this difficult situation.
    https://www.allassignmenthelp.com/us/buy-college-term-paper.html

    mba thesis writing services
    custom term paper writing
    best research paper writing service

  • Alex Kim

    Alex Kim January 11th, 2020 @ 09:52 AM

    Are you face more trouble to choose a trustworthy translation? If yes, then not worry about this regard. Singapore translators are at the top positioned translation help provider in Singapore.Here, you can get fast, flawless translation easily at very reasonable prices.

  • hannah tims

    hannah tims April 29th, 2020 @ 04:24 PM

    Great article! This was very helpful! how to get diamonds in geometry dashThank you so much for this!

  • pbawerawi

    pbawerawi April 30th, 2020 @ 05:36 AM

    Den løpeskoen ønsker å kaste. Du kan muligens gå gjennom denne EVORIDE for å hjelpe helt ny Sense of balance Vazee Desire, Saucony Kinvara 11, Skechers Electric shaver 3, en original ASICS Roadhawk https://www.simandysko.com/ , adidas Birkenstock boston RAISE, i tillegg til Nike Zoomfly 3. Det er bare en lett i vektlærer som kan koble dette hullet forbundet med vanlig lærer for å hjelpe hurtiglærer.

  • dubbmill

    dubbmill May 26th, 2020 @ 06:47 AM

    Thanks for the post and nice to see this here. Looking for how to use chromecast without wifi Make sure you update the Chromecast to the latest version of its firmware. Chromecast Guest Mode allows a sender device to cast to it when that sender device is nearby, without requiring it to be connected to the same WiFi network.

  • sahil

    sahil July 23rd, 2020 @ 12:08 PM

    Do you have difficulty in writing an law assignment help ? Here
    is the solution! law assignment help provides assignment help
    services at reasonable prices to students across the globe. If you need expert help for your law work, visit the website of assignment help services or talk with the academic expert for more clarification best assignment help services

  • wardrin

    wardrin September 9th, 2020 @ 11:14 AM

    Nice to see this post here. PerYourHealth is online bill pay portal which allows users to pay their hospital bills while sitting at home. peryourhealth is a secure way to pay medical bills online.

  • lookpong

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff

People watching this ticket

Attachments

Pages