Static site localisation JSON

  Posted Thursday, November 21st, 2019

Static site localisation

Providing static site content in all languages without a content management system

Problem

I needed to provide a means to localise a website with static content – ergo, a change to website content would necessitate a code change and redeploy. Furthermore, the localisation team already had a well defined workflow to help them manage requests, and I needed to be considerate of that. Lastly, they always found themselves re-translating the same common strings repeatedly for new sites – “play now”, “sign in” etc.

Solution

I created a paradigm for our JSON content files that closely matched that found in our CMS (in case we wanted to upgrade from static to dynamic content). This paradigm included a demarcation for localisable per string field, and ISO language codes per localised value e.g. es-ESde-DE, defaulting to en-GB. Then, I created a private NPM package to convert these files to-fro CSV for use by localisation. By communicating with localisation experts early, I was able to create something functional and re-usable quickly; it also worked for images, as we could direct to different URLs. Even though this was not our ideal solution, I reduced quickly removed a blocker and reduced the amount of work necessary in the following weeks to support the launch of new game content.

Learnings

  • Converting data between different formats in a safe (lossless) way
  • Collaborating with localisation experts on the intricacies of translating strings that may contain dynamic content