trekr67
2013-Sep-16 11:16 UTC
Translate tag (I18n.t) in ruby on rails not having CSS formatting applied
Hello, I''ve got the following piece of code:- %section#download %h1= t "section.title" .content %p = I18n.t "section.first_box.first" in name.html.erb file. But I noticed that the css formatting that would apply to the %p tag no longer applies because of the internationalization tag I18n.t. Does anyone know how I can make sure that the text being translated "section.first_box.first" will preserve it''s css formatting and not have it removed because of the I18n.t tag? I''m a Rails newbie Thanks Angela -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0431a4e5-6f3f-4c2c-a0bb-4aac4580e988%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Frederick Cheung
2013-Sep-16 14:24 UTC
Re: Translate tag (I18n.t) in ruby on rails not having CSS formatting applied
On Monday, September 16, 2013 12:16:45 PM UTC+1, trekr67 wrote:> > > %section#download > %h1= t "section.title" > .content > %p > = I18n.t "section.first_box.first" > > in name.html.erb file. > > But I noticed that the css formatting that would apply to the %p tag no > longer applies because of the internationalization tag I18n.t. Does anyone > know how I can make sure that the text being translated > "section.first_box.first" will preserve it''s css formatting and not have it > removed because of the I18n.t tag? > >This isn''t related to the use of i18n ( as a shortcut you can use just ''t'' in views instead of I18n.t). As it stands the indentation in your haml file will put the internationalized text outside of the p tag, so the css rules for p tags won''t be used. Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d09bf5c9-1b89-400f-9c97-a668900b0f44%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
angela ebirim
2013-Sep-16 14:29 UTC
Re: Translate tag (I18n.t) in ruby on rails not having CSS formatting applied
The problem is that the CSS formatting for the translated part is contained in the p tag and that''s what I''d like preserved. Or would you suggest creating a new tag for the translated text in the CSS file with the same formatting as the p tag and then applying it that way? Thanks On Monday, 16 September 2013, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Monday, September 16, 2013 12:16:45 PM UTC+1, trekr67 wrote: >> >> %section#download >> %h1= t "section.title" >> .content >> %p >> = I18n.t "section.first_box.first" >> in name.html.erb file. >> But I noticed that the css formatting that would apply to the %p tag nolonger applies because of the internationalization tag I18n.t. Does anyone know how I can make sure that the text being translated "section.first_box.first" will preserve it''s css formatting and not have it removed because of the I18n.t tag?> > This isn''t related to the use of i18n ( as a shortcut you can use just''t'' in views instead of I18n.t). As it stands the indentation in your haml file will put the internationalized text outside of the p tag, so the css rules for p tags won''t be used.> Fred > > -- > 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 anemail to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visithttps://groups.google.com/d/msgid/rubyonrails-talk/d09bf5c9-1b89-400f-9c97-a668900b0f44%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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL_gTQEm-smMBksd8R_8OWwqJz5SaiA6bsoyGYc6B0xxqT%3DUxg%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Walter Lee Davis
2013-Sep-16 14:52 UTC
Re: Translate tag (I18n.t) in ruby on rails not having CSS formatting applied
On Sep 16, 2013, at 7:16 AM, trekr67 wrote:> Hello, > > I''ve got the following piece of code:- > > %section#download > %h1= t "section.title" > .content > %p > = I18n.t "section.first_box.first" > > in name.html.erb file. > > But I noticed that the css formatting that would apply to the %p tag no longer applies because of the internationalization tag I18n.t. Does anyone know how I can make sure that the text being translated "section.first_box.first" will preserve it''s css formatting and not have it removed because of the I18n.t tag?Can you write out, in HTML, how you want the final code to appear? The use of HAML may be confusing things here. Walter> I''m a Rails newbie > > Thanks > > Angela > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0431a4e5-6f3f-4c2c-a0bb-4aac4580e988%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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/BBA2B7A7-AE0F-4891-940F-37D31344DE5E%40wdstudio.com. For more options, visit https://groups.google.com/groups/opt_out.
Frederick Cheung
2013-Sep-17 06:14 UTC
Re: Translate tag (I18n.t) in ruby on rails not having CSS formatting applied
On Monday, September 16, 2013 3:29:37 PM UTC+1, trekr67 wrote:> The problem is that the CSS formatting for the translated part is contained in the p tag and that''s what I''d like preserved. > > Or would you suggest creating a new tag for the translated text in the CSS file with the same formatting as the p tag and then applying it that way? > >At the moment your haml is resulting in markup that looks like <div class="content"> <p></p> Translated text here </div> So it should be clear why the style rules for p have no effect. What I was trying to say was that for the translated text to be inside the p element you need to indent it, that is %p = I18n.t(...) Or perhaps I''ve got the wrong end of the stick and you should spell out what you''re trying to do, as Walter suggests. Fred> Thanks > > On Monday, 16 September 2013, Frederick Cheung <frederic...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Monday, September 16, 2013 12:16:45 PM UTC+1, trekr67 wrote: > > >> > >> %section#download > >> %h1= t "section.title" > >> .content > >> %p > >> = I18n.t "section.first_box.first" > >> in name.html.erb file. > > >> But I noticed that the css formatting that would apply to the %p tag no longer applies because of the internationalization tag I18n.t. Does anyone know how I can make sure that the text being translated "section.first_box.first" will preserve it''s css formatting and not have it removed because of the I18n.t tag? > > > > > This isn''t related to the use of i18n ( as a shortcut you can use just ''t'' in views instead of I18n.t). As it stands the indentation in your haml file will put the internationalized text outside of the p tag, so the css rules for p tags won''t be used. > > > Fred > > > > -- > > 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-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > To post to this group, send email to rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d09bf5c9-1b89-400f-9c97-a668900b0f44%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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c71a83c1-97d0-4e3a-bf55-bc54d9735a79%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.