Skip to content

Internationalization: Coding

Dylan Barth edited this page May 16, 2014 · 19 revisions

Introduction

Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes.

-- Wikipedia

KA Lite is a cross-cultural tool and internationalization of the app by translating strings is a key component to making this content accessible anywhere.

We use an automated, Django-based tool for finding and extracting translatable strings. This means that devs, when we are coding, are responsible to mark up the code in standard ways, in order to allow this program to find the translatable strings.

Below, we've linked to tutorials for how to use Django's built-in internationalization features when writing code for KA Lite.

How to wrap strings in Django:

  1. templates

  2. view code

  3. Javascript. We import the JavaScript translation dictionary into our base template, so no need to worry about importing. In your js code, simple wrap strings in a gettext function like the following example: document.write(gettext('this is to be translated'));

TODO: Documentation about how the language pack building process works. Use the i18n doc as a starting place.

Clone this wiki locally