On 2013-Jul-18, at 04:51 , Tushar Patil wrote: > Hi, > Here i mention my hi.bootstrap.yml file, and i use > create company => key use in form.html > > <%= f.submit t('.create company', :default => t("helpers.links.Create > Company")), :class => 'btn btn-primary' %> > > It works fine for Hindi, but it gives problem for English > > hi: > helpers: > actions: "क्रिया" > > links: > Edit: "संपादित करें" > new: "नई" > update: "अपडेट" > cancel: "रद्द करें" > enable: "द्रश्य" > disable: "अदृश्य" > Create Company: "कंपनी बनाएं" > Delete: "हटाना" > > Let me know where i am wrong
Have you tried putting quotes around the key having a space? "Create Company": "कंपनी बनाएं" Having extra space between the : and the value does not matter (especially since you have a quoted value). The only difference that an unquoted value would have is all the leading spaces would be removed from the value. -Rob > > On Wednesday, July 17, 2013 8:31:08 PM UTC+5:30, tamouse wrote: > Pardon the follow up on myself… > > On Jul 17, 2013, at 7:55 AM, Tamara Temple <tamous...@gmail.com> wrote: > > > > > On Jul 17, 2013, at 4:39 AM, Colin Law <cla...@googlemail.com> wrote: > > > >> On 17 July 2013 12:24, Tushar Patil <tushar...@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. > > > Tushar, please try this: remove the default: from the t() call, and see if > you get the translation not found error? > > <% f.submit t('.Create Company'), class: 'btn btn-primary' %> > > > > -- > 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+unsubscr...@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/45456acb-e2da-4981-ac67-78e71686736a%40googlegroups.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+unsubscr...@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/B8A380BA-12C5-4BC6-93CD-2237EDA55E14%40agileconsultingllc.com. For more options, visit https://groups.google.com/groups/opt_out.