Re: [Rails] help regarding internationalization for bootstrap button.
On Jul 17, 2013, at 4:39 AM, Colin Law <clanlaw@googlemail.com> wrote:
> On 17 July 2013 12:24, Tushar Patil <tushar01patil@gmail.com> wrote:
>> Hi,
>> I am trying to convert my application in hindi, I am stuck in the renaming
>> submit button name, It works fine for hindi but not working for english, it
>> gives syntax error, here is my submit button code
>>
>> <%= f.submit t('.Create Company', :default => t("helpers.links.Create
>> Company")), :class => 'btn btn-primary' %>
>
> I have not used internationalisation, but should that be
> <%= f.submit t('.Create Company'), :default => t("helpers.links.Create
>> Company"), :class => 'btn btn-primary' %>
>
In this case, probably not -- the #t helper takes a default: option in case the first item is not found in the translation tables.
I suspect the key '.Create Company' to be the culprit -- and actually I think the leading '.' in this case might be the problem. Very hard to tell without seeing the translation tables. Making a translation key a spaced phrase with capitals is unusual as well -- these things are keys, and just seeing this seems odd to me. It might work? It certainly seems to be working for the default translation token.
Tushar, please paste in the segments from each of your translation files so we can see the actual code?
> Colin
>
>>
>> Create Company => mention in the hi.bootstrap.yml file
>> Please, let me know where i am wrong.
>>
>> Thanks..
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/rubyonrails-talk/CAMFjjRe%2Bs1pkZ2Y9SWqitFGEFy3%2BkEZTNp7c34Luo-3mCfVXkg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv6Q%2BuaW6PUZ86LXzcbJ9f5qy8Gd8oH56Y_BDw8o0Vwyg%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/67BD485C-C111-4926-A9AD-0305CABE03D1%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home