Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

add I18n scope option to distance_of_time_in_words

#5806

add option for distance_of_time_in_words to add an custom I18n scope.

For example in german the wording depends on the context: 3 days = 3 Tage 3 days ago = vor 3 Tagen (with an n)

this patch gives more flexibility for different contexts

patch attached or http://github.com/jovoto/rails/commit/768f3f8211fb7a839ea84f446fcad...

Reported by tassmann (at jovoto) · October 14th, 2010 @ 02:04 PM

State: open
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. tassmann (at jovoto)
    tassmann (at jovoto)
    • Tag set to date_helper, i18n, patch

    October 14th, 2010 @ 02:04 PM

  2. Yaroslav Markin
    Yaroslav Markin
    • Assigned user set to José Valim

    Is it possible to do the same with lambda-translations feature of I18n? In that case, we'll need to pass the datetime object to Proc which does the translation, instead of patching like that.

    Could you look into it?

    October 16th, 2010 @ 04:17 AM

  3. Thomas Fritzsche
    Thomas Fritzsche

    I just come across this ticket while searching for a solution for exactly this issue in German translation? As I'm new to i18n, may I ask you: This lambda-translation you suggested. Is this something I can use in my project or this is just a ways you guys try to fix the i18n support of distance_of_time_in_words?

    As "time_ago_in_words" and "distance_of_time_in_words" should yield in different texts in German grammar. I could maybe adjust the translation to meaning "time_ago_in_words" ("vor 3 Tage" --> "vor 3 Tagen") and just use this version? Or I create a local copy of that method in my project that is using different translations for "time_ago_in words"?

    Thanks so much for your great work!

    December 22nd, 2010 @ 07:45 AM

  4. rails
    rails
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    March 23rd, 2011 @ 12:00 AM

  5. rails
    rails
    • State changed from open to stale

    March 23rd, 2011 @ 12:00 AM

  6. tassmann (at jovoto)
    tassmann (at jovoto)

    the problem still exists in rails3, nothing changed..

    March 23rd, 2011 @ 09:01 AM

  7. tassmann (at jovoto)
    tassmann (at jovoto)
    • State changed from stale to open

    forgot the reopen part .. [state:open]

    March 23rd, 2011 @ 09:02 AM