

Ni uzas por ĉiu lingvo json-dosieron, kiu enhavas la tradukojn.
Ni ŝarĝas ĉi tiun dosieron en "templates/main.html":

    <script type="text/javascript" src="{{static_path}}js/gettext.min.js"></script>
    <script type="text/javascript">
      function Get(yourUrl){
          var Httpreq = new XMLHttpRequest(); // a new request
          Httpreq.open("GET",yourUrl,false);
          Httpreq.send(null);
          return Httpreq.responseText;
      }
      var i18n = window.i18n();
      var i18njson=Get("{{static_path}}js/motioneye.{{lingvo}}.json");
      i18n.loadJSON(i18njson, 'messages');
      i18n.setLocale('{{lingvo}}');
    </script>

Kaj ni uzas la funkcion i18n.gettext donitan de gettext.min.js por traduki, ekz. :
     return i18n.gettext("Ĉi tiu kampo estas deviga");

La dosiero "pot" estas ĝisdatigita per la komando xgettext, ekz. :
	xgettext --from-code=UTF-8 --no-wrap -o motioneye/locale/motioneye.js.pot static/js/*.js
La dosiero "po" estas ĝisdatigita per la komando msgmerge, ekz. :
	msgmerge --no-wrap -N -U motioneye/locale/en/LC_MESSAGES/motioneye.js.po motioneye/locale/motioneye.js.pot
Tradukoj povas esti ĝisdatigitaj per teksta redaktilo aŭ per poedit.
La dosiero "json" estas ĝisdatigita per la komando scripts/po2json, ekz. :
	l10n/po2json motioneye/locale/en/LC_MESSAGES/motioneye.js.po motioneye/static/js/motioneye.en.json

La dosiero "Makefile" permesas aŭtomate administri xgettext, msgmerge kaj po2json. Simple enigu "make" post modifi dosieron "js" aŭ "po".

"Makefile" havas regulo "init%" por krei novan tradukon
    ekz. : uzi "make initro" por krei la rumana traduko.
