you still discovered no bugs :-) I then commented out the login: Login xxx line and instead of seeing the > [en.hobo.actions.login] key, it showed "Log in". I can't find the string > "Log in" anywhere in the dryml files. In fact, the string "Log in" is not > in any of the files in the app. I don't know where it is coming from. >
All the english keys in the hobo.en.yml have an hardcoded default (rails style) which allows a basic en app to work even without ANY locale file. 1) Is there a default prompt in the <ht ..... >Default Prompt</ht> > 2) Does Hobo generate one of the many alternate keys that exist in > hobo.xx.yml? > 1) The content of the <ht> tag (or <t> tag) IS the default in case the key is missing. 2) defaults are hardcoded when missing from the call (tag content), and there is a fallback... You should take a look at the documentation of the ht method. ciao dd On Thu, Jan 20, 2011 at 12:48 PM, Donald R. Ziesig <[email protected]>wrote: > Oh!!!!! > > Well, if that's the case, yes there is another bug, (as a result of a > feature). > > I tried a simple experiment. In hobo.en.yml, I changed > > en: > hobo: > actions: > login: Login > > to > en: > hobo: > actions: > login: Login xxx > > The heading changed appropriately. > > I then commented out the login: Login xxx line and instead of seeing the > [en.hobo.actions.login] key, it showed "Log in". I can't find the string > "Log in" anywhere in the dryml files. In fact, the string "Log in" is not > in any of the files in the app. I don't know where it is coming from. > > I then tried another experiment, a little more complicated this time > because there are many different possible keys (hobo is being a little too > helpful). I experimented with the "new" action on an index-page. > > First I added the following to app.en.yml > > issue: > actions: > new: Add a new Index > > Then I added a few more lines in my copy of the <index-page for="Issue"> > tag def. > > <ht key="issue.actions.new">New Index</ht> > <!-- <ht key="issue.actions.new">Default Prompt</ht> --> > <!-- <ht key="issue.actions.newxxx"/> --> > > *do you see where this is going?* > > The link text was: Add a new Index > > Then I commented out the new: Add a new Index line in app.en.yml > > The link text was: New Issue > > Then I re-arranged the comments in <index-page> > > <!-- <ht key="issue.actions.new">New Index</ht> --> > <ht key="issue.actions.new">Default Prompt</ht> > <!-- <ht key="issue.actions.newxxx"/> --> > > The link text was: New Issue > !!!!!!!! > > In hobo.en.yml, commented out > > en: > hobo: > actions: > ### new: ... > > The link text was: Default Prompt > > Finally, re-arranged the comments in <index-page> again: > > <!-- <ht key="issue.actions.new">New Index</ht> --> > <!-- <ht key="issue.actions.new">Default Prompt</ht> --> > <ht key="issue.actions.newxxx"/> > > The link text was: [MISSING: en.issue.actions.newxxx] > > So, after a lot of experimentation, it looks like I have to worry about two > things when trying to build my app.xx.yml and hobo.xx.yml files: > > 1) Is there a default prompt in the <ht ..... >Default Prompt</ht> > 2) Does Hobo generate one of the many alternate keys that exist in > hobo.xx.yml? > > Is there some way of temporarily disabling all of the alternate keys, and > perhaps even the defaults in <ht>...</ht>? > > Thanks for putting up with my constant complaining ;-) . > > Don > > > > > > > > On 1/20/2011 10:14 AM, Domizio Demichelis wrote: > > Unfortunately, all of the keys (even those that are satisfied) show up on >> the rendered page. >> > > That is the right behaviour! > > I mean that if you turn the show_translation_keys OFF, the regular > (patched) rails translation helper should show you something like [Missing > translation key blah]. > > They are there for 2 different purposes: the show_translation_keys is meant > to show you where a string comes from, for easy overriding, so it shows > EVERYTHING. While if you want to catch missing translations keys, you have > just to switch it OFF (because its purpose is getting in the way) and the > regular helper should annotate the missing key. If that does not happen, > THAT is a bug, not the fact that show_translation_keys shows everything! > > ciao > dd > > On Thu, Jan 20, 2011 at 10:15 AM, Donald R. Ziesig <[email protected]>wrote: > >> Hi Domizio! >> >> Unfortunately, all of the keys (even those that are satisfied) show up on >> the rendered page. Even the Login page has >> >> *[en.hobo.login.heading]Login >> * >> which is defined in *hobo.en.yml* >> >> Similarly, when I switch to Spanish, the heading shows: >> >> *[es.hobo.actions.account]Perfil* >> *[en.hobo.actions.account]Account* >> >> which are defined in *hobo.es.yml* and *hobo.en.yml respectively.* >> >> Right now, the login page defaults to English, only when the user >> identifies herself does the chosen language get set, so I can't show that >> one in Spanish. >> >> Looks like your refactories ran away with themselves :-D >> >> Thanks, >> >> Don >> >> >> On 1/19/2011 6:16 PM, Domizio Demichelis wrote: >> >> "only keys that are not satisfied in the current locale" >> >> IIRC that should already happen by default, even without any >> "show_translation_keys" option.... if my last refactories didn't wipe it out >> :-) >> >> Please, let me know >> ciao >> dd >> >> On Wed, Jan 19, 2011 at 5:23 PM, Donald R. Ziesig <[email protected]>wrote: >> >>> Domizio ! >>> >>> Got it! Yes this is the right way to help in the translation. >>> >>> One potential improvement (at least as I see it ;-) ) : Is it possible >>> to add an *option* so that only keys that are not satisfied in the >>> current locale are shown? That way, the developer/translator would be able >>> to tell at a glance what was left to be done on any given page. >>> >>> Thanks, >>> >>> Don >>> >>> On 1/18/2011 5:20 PM, Domizio Demichelis wrote: >>> >>> The ht method has been deeply refactoried many times. >>> >>> HOBO_VERBOSE_TRANSLATIONS was just filling your log with ALL keys and >>> values, without really be of any help, so I removed it >>> >>> HOBO_SHOW_LOCALE_KEYS has been substituted by the >>> config.hobo.show_translation_keys. >>> >>> The output is better because it shows you also the fallbacks, besides it >>> is dryml/erb friendly (i.e. plain text, not tags that mess the parsing up) >>> >>> ciao >>> dd >>> >>> >>> >>> On Tue, Jan 18, 2011 at 6:08 PM, Donald R. Ziesig <[email protected]>wrote: >>> >>>> I give up! How can I enable these options? >>>> >>>> >>>> On 1/18/2011 5:03 PM, Domizio Demichelis wrote: >>>> >>>> indeed I removed all the globals related to locale keys in 1.3... there >>>> is only the config option and the result is better. >>>> >>>> ciao >>>> dd >>>> >>>> On Tue, Jan 18, 2011 at 5:58 PM, Donald R. Ziesig <[email protected]>wrote: >>>> >>>>> Hi Scorpio! >>>>> >>>>> Yes (without the typo, too) ;-) . It has no effect, unless I am >>>>> looking it the wrong place. The locale data is supposed to show up in the >>>>> log, correct? >>>>> >>>>> Don >>>>> >>>>> >>>>> On 1/18/2011 2:07 PM, Scorpio wrote: >>>>> >>>>>> Have you tried "HOBO_SHOW_LOCALE_KEYS = ture" without the quotes? >>>>>> >>>>>> On Jan 18, 5:53 pm, "Donald R. Ziesig"<[email protected]> wrote: >>>>>> >>>>>>> Hi All! >>>>>>> >>>>>>> The hobo cookbook shows a pair of environment variables that enable >>>>>>> debugging of internationalization. >>>>>>> >>>>>>> HOBO_VERBOSE_TRANSLATIONS >>>>>>> HOBO_SHOW_LOCALE_KEYS >>>>>>> >>>>>>> I have these set in the environment, but they do not have any effect >>>>>>> (RoR 3.0.3, Hobo 1.3). >>>>>>> >>>>>>> I remember seeing something that said these were replaced by >>>>>>> something >>>>>>> in config.??? but I'll be *^%&^% if I can find it again. >>>>>>> >>>>>>> I tried: >>>>>>> >>>>>>> config.hobo_verbose_translations = true >>>>>>> config.hobo_show_locale_keys = true >>>>>>> >>>>>>> which apparently compiled correctly (no errors and website ran >>>>>>> properly) >>>>>>> but again there does not seem to be anything translation-related in >>>>>>> the log. >>>>>>> >>>>>>> How can I get the keys and translations in the log so I don't have to >>>>>>> randomly try different keys, etc. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Don Ziesig >>>>>>> >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Hobo Users" group. >>>>> To post to this group, send email to [email protected]. >>>>> To unsubscribe from this group, send email to >>>>> [email protected]<hobousers%[email protected]> >>>>> . >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/hobousers?hl=en. >>>>> >>>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Hobo Users" 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/hobousers?hl=en. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Hobo Users" group. >>>> To post to this group, send email to [email protected]. >>>> To unsubscribe from this group, send email to >>>> [email protected]<hobousers%[email protected]> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/hobousers?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Hobo Users" 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/hobousers?hl=en. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Hobo Users" group. >>> To post to this group, send email to [email protected]. >>> To unsubscribe from this group, send email to >>> [email protected]<hobousers%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/hobousers?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Hobo Users" 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/hobousers?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Hobo Users" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<hobousers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/hobousers?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" 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/hobousers?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<hobousers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. > -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
