#15 new
Yaroslav Markin

Improvement: AR I18n: default attribute name translations

Reported by Yaroslav Markin | September 1st, 2008 @ 08:43 PM

Now:

"I want a login attribute in User model to be translated as Логин"


ru-RU:
  activerecord:
    attributes:
      user:
        login: "Логин"

Feature req:

"I want all attributes in my application called login to be translated as Логин by default, except for Admin model -- custom translation"


ru-RU:
  activerecord:
    attributes:
      login: "Логин"
      admin:
        login: "Custom translation"

Comments and changes to this ticket

  • iain

    iain September 1st, 2008 @ 08:46 PM

    • Tag changed from activerecord, yaml to activerecord, tiny, yaml

    I am suggesting a global scope to avoid name clashes

    
    ru-RU:
      activerecord:
        global-attributes:
          login: "Логин"
    
  • robert watson

    robert watson June 6th, 2025 @ 06:41 PM

    I want the login attribute in the User model to be translated as 'Логин'."

    ru-RU:  
      activerecord:
        attributes:
          user:
            login: "Логин"
    <pre><code> Feature Request:
    
    &quot;I want **all attributes named `login`** across my application to be translated as &#39;Логин&#39; **by default**, but I also want to provide **a custom translation** for the `Admin` model.&quot;
    
     Desired Behavior with Change:
    
    ```yaml
    ru-RU:
      activerecord:
        attributes:
          login: &quot;Логин&quot;
          admin:
            login: &quot;Custom translation&quot;
    ```https:&#47;&#47;thesubwaysurfer.com&#47;
    
    &lt;a href=&quot;https:&#47;&#47;thesubwaysurfer.com&quot;&gt;the subway surfer&lt;&#47;a&gt;
    
    
    This allows a global default translation for the `login` attribute, while still supporting model-specific overrides.</code>
    </pre>
    

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

Pages