jbake-org/jbake — pull request #106 by bashnesnos (2014-03-28 22:06:18+00:00)
Title: Localization POC

Hello there,

While I've been playing around with JBake, I just thought may be a localization feature could be useful?

The idea is: localized pages during the build are being put to a separate folder. Since the pages are static it is the cheapest and straight-forward option. Switching between the localized/original is to be operated by URL manipulation in javascript. E.g. the following transformation will occur:
```
src\jbake\content\blog\2014\jbake_locale.md -> \blog\2014\jbake_locale.html (original)
src\jbake\content\blog\2014\en_jbake_locale.md -> \en\blog\2014\jbake_locale.html (localized)
```
Overall convention is the following:
* Localized post file name should differ from original only by *localeId_* prefix (in my case **en_**)
* Add the localized templates into jbake.properties
* Localized template name should start from *localeId_* (in my case **en_**)
* Keep the *localeId_* in mind when populating links and includes inside of the templates

If none are supplied - no localization, falls back to the usual transformation.

If the idea is all right, I'll extend the current POC to all other template engines etc.

P.S. working blog [sources](https://github.com/bashnesnos/blog) and live [example](http://bashnesnos.github.io/blog/en/)