Single blog post file with localized paths

Hi, I am building a localized site that includes 2 localised blogs. The Localization setup is a bit different to the localization for pages and I’m struggling to achieve the following:

  • My site locales are actually just variations of English (Australian, American etc)
  • For this reason, I want to have one post file and use t() helpers inline for words which are spelt differently.
  • When my site builds, I’d like the following output example.com/{lang}/posts/{title}

This approach is very well supported with pages, but I’ve been struggling to achieve with the prefix, name, source, permalink options.

Can this be achieved?

Can you show us your config.rb? I don’t use I18n with blog in the same project, but maybe something can be spotted. When you say: 2 blogs, do you mean two different blogs in the same project, or two localizations?

Hi @komor72
A good summary of the difference between localisation in blog plugin vs vanilla middleman I18n can be found in this post. https://github.com/middleman/middleman/issues/1144#issuecomment-31557176

What I don’t like about their solution is that it requires you to duplicate the files for each locale, rather than using the inline I18n helpers. Whereas with pages, I can interchangeably use one file for all locales with t() helpers or use one file per locale.

Oh my… Seems to be messy… Have you tried to use t() in layout, article layout and partials? If it doesn’t work there too, then it really is a downer.