Opslag

Viser opslag fra marts, 2015

Localization of graphic resources for a Python Flask website

Over at Hungry.dk we are working hard on getting an Irish version of our site ready. In Ireland the company will be named Marvin.ie , and though it will have the same look and feel, there are of course graphic resources, that needs to be localized, such as logo's, graphics containing text, available payment types etc. So we needed to come up with a strategy for localizing these resources. We are already using the excellent Flask-Babel extension to handle string/text localization, so an easy approach would be to simply use it for the resource reference as well. However I really prefer to keep these things out of the translation files, as it quickly becomes tedious and boring work to maintain it there. Basically what I wanted was for both (and any future) sites to use the same set of resources, with the possibility to override any resource on a per locale basis. I wanted to control which resources to have localized versions for usng the filesystem only. Example: The resourc