middleman / middleman-i18n

Internationalization extension for Middleman (Built-in to 3.0)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

observations / experience from our attempt at this

eggheadgames opened this issue · comments

Your solution looks way more elegant than our hack at https://github.com/agamz/FindBigMail. A few things we're playing with as we get closer to our deployment that may further inform your design & implementation:

  • currently changing data/*yml files doesn't trigger a reload when running in server mode. Our hack around this is to touch the config.rb file. Your solution of having locales directories for the en.yml files etc likely takes this into account
  • we've gone back on forth on which way the final website should be:
  • server mode is necessarily different. Currently we generate both the links and page names differently based on whether :development is true or not, to account for the different /en vs /de and ending in html or not. I suspect some of this is magically handled by the server already. Related to this, we've moved away from the /pagename/index.html solution for pages without extensions and instead will deploy .html and use apache to hide the extension.

I hope some of this helps. Your software and support has been awesome for this development effort. Thanks!

  1. You're talking about LiveReload? I can add locales/ and data/ to the refresh paths.

  2. So, we definitely need a default locale option, eh?

  3. There is a :directory_indexes feature to help with this, but I'd definitely do with Apache or a real server in most cases.

  1. yes, LiveReload. And yes, it would be useful to add those to the refresh paths

  2. well, its more about what styles you want to support. But yes, I think a default would be a good thing.

  3. Yes, we're using the server to handle this. The only thing that would be nice is to get the build? or development? flags working properly in my site so that I can make the links have .html while running in server mode and drop the .html when I build. Probably my error that I can't seem to make these work. I'll dig a bit more before i bug you.

Another item: the generated paths may also be different based on the language. We made that work in our version by using a paths: map in the language file. If its there it gets mapped, if not, its left alone. I'll see if I can attach my code to your sample code in the readme, or find it at agamz/FindBigMail here in github.

Turn on :directory_indexes in dev only:

configure :development do 
  activate :directory_indexes
end

This will allow you to hardcode all your links to the /my/path versions and they'll work in dev, they will build into .html files and your server can strip the .html in production.

Fantasitc! That worked just as you described. Wow, this is truly becoming an incredible environment for building our website! All the advantages of the latest tools, very DRY sources, and blazing server speed because its all pre-computed. Thanks again for all the effort you continue to put into this.

You're welcome. Going to close this ticket and work off the other example you posted.