Internationalization
Reported by Don Ziesig | February 17th, 2010 @ 10:17 PM
I am trying to internationalize your demo app prior to using hobo in a major application.
In application.dryml:
<def tag="app-name"><%=I18n.t('The Customized Website')%></def>
works better than I expected. Everywhere the app-name appears is translated appropriately!
However, in index.dryml, line 1:
<page title="<% I18n.t('Home') %>" >
and many variations on the theme all crash with "SyntaxError in Front#index" on line #1 or Hobo::Dryml::DrymlException in Front#index" on line #1
I have written many websites in 'bare" rails, some of which use I18n, but this is my first attempt at hobo. Is what I want to do possible? Did I miss something in the documentation?
Thanks,
Don Ziesig
Comments and changes to this ticket
-
Bryan Larsen February 17th, 2010 @ 11:01 PM
- State changed from new to invalid
I fixed your origin post. In lighthouse you have to use four spaces or backticks to escape DRYML code. Other methods work for ruby code, but not for stuff that looks a little bit too much like HTML.
Your problem is that DRYML isn't ERB. Attributes do not use the
<%
syntax, they use either an ampersand (&
) or rubyish#{
:<page title="#{I18n.t('Home')}">
http://cookbook.hobocentral.net/manual/dryml-guide#no_erb_inside_tags
Just curious: have you tried Hobo style internationalization? I haven't used it much myself, and wouldn't mind feedback. http://cookbook.hobocentral.net/manual/i18n
-
Bryan Larsen February 17th, 2010 @ 11:01 PM
I fixed your origin post. In lighthouse you have to use four spaces or backticks to escape DRYML code. Other methods work for ruby code, but not for stuff that looks a little bit too much like HTML.
Your problem is that DRYML isn't ERB. Attributes do not use the
<%
syntax, they use either an ampersand (&
) or rubyish#{
:<page title="#{I18n.t('Home')}">
http://cookbook.hobocentral.net/manual/dryml-guide#no_erb_inside_tags
Just curious: have you tried Hobo style internationalization? I haven't used it much myself, and wouldn't mind feedback. http://cookbook.hobocentral.net/manual/i18n
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป