bryanbraun / middleman-navtree

For building navigation trees & menus in Middleman.
MIT License
45 stars 17 forks source link

localization introduced #19

Closed musashimm closed 7 years ago

bryanbraun commented 7 years ago

@musashimm, I'm glad you got this started (for issue #9).

It looks like this still needs some work... we're missing translations for the values you added:


image


I can't contribute much time to this, but if you can get it into a working state, I'm happy to review and merge. 👍

musashimm commented 7 years ago

To get working state you only have to put locales files in locales directory of franklin app. So if you want I can reedit README.md files of this extension end franklin's or I can add functionality to after_configuration method to create such dir if not exists and put yml files there. Or both.

bryanbraun commented 7 years ago

Ok, I see what you mean.

I wonder if there's a way for us to default to the English "Next / Previous" text, if their site doesn't have anything in their locales directory?

I tried this but it didn't work:

link_to(I18n.t("next_page") || "Next", next_page, options)

I'd like it if Middleman Navtree still worked with English as a a default out of the box, but people could enhance it via the locales directory like you described. Maybe something in i18n's fallbacks docs can help?

musashimm commented 7 years ago

Did as requested.

bryanbraun commented 7 years ago

This looks promising! I should be able to test this later this week. 👍

bryanbraun commented 7 years ago

This works great! Merging. 👍