Diego Carrion a écrit : > Hi, > > i think _all can be a better namespace than global-attributes, good > idea (: > > Does everybody thinks the same?
Hello, what about using 'default' ? By the way I have an issue with your plugin: >> Page.human_attribute_name 'created_at' won't work for example. It seems I have problems with default already defined to the column_name humanized, and with the scope [:activerecord, :attributes] I pasted a gist of a version which seems to be working : http://gist.github.com/30002 It certainly is really ugly, I'm checking the scope and if the default option is equal to the humanized column name, but it seems to be working. > > > > On Nov 25, 8:34 pm, Sven Fuchs <[EMAIL PROTECTED]> wrote: >> Isn't that similar to what Diego's plugin also does? >> >> The problem with this: >> >>> [:activerecord][:attributes][:user][:name], then, if miss: >>> [:activerecord][:attributes][:name], then, if miss: >> is that there could be a model Name. That's what I understand Diego >> solves with the :global-attributes namespace. >> >> Or am I missing something? >> >> Sorry ... I'm only following this peripherally cause I'm up to my ears >> in other stuff :-/ >> >> On 25.11.2008, at 23:03, Carlos Júnior wrote: >> >>> Sven, I think that would be really nice and useful if the >>> translations could be inheritable. >>> So, take this example: >>> pt-BR: >>> name: Nome >>> activerecord: >>> attributes: >>> user: >>> name: Nome >>> if you translated something once in a toplevel, you shouldn't need >>> to translate it again, but you can replace it: >>> pt-BR: >>> name: Nome >>> activerecord: >>> attributes: >>> user: >>> name: Nome completo >>> But, if you don't want, this would be enough: >>> pt-BR: >>> name: Nome >>> This is quite simple: >>> I18n.t "activerecord.attributes.user.name" would try: >>> [:activerecord][:attributes][:user][:name], then, if miss: >>> [:activerecord][:attributes][:name], then, if miss: >>> [:activerecord][:name], then, if miss >>> [:name], and it would finally find the translation, or, if it miss: >>> then I18n.t would return the translation missing string >>> This approach would be very welcome, if you think that "name" would >>> be used in many places of the applications, such as a lot of >>> translations. >>> What do you think? >>> I can implement this as a plugin or as a patch if you want. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "rails-i18n" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rails-i18n?hl=en -~----------~----~----~----~------~----~------~--~---
