Skip to content

Instantly share code, notes, and snippets.

View rpl's full-sized avatar

Luca Greco rpl

  • Mozilla
  • Lecce, Italy
View GitHub Profile
@rpl
rpl / gettext.js
Last active February 13, 2018 15:35 — forked from EnTeQuAk/gettext.js
// i18n data that get's passed to jed
let DEFAULT_I18N_DATA = {
messages: {
en: {
'This is a test': 'This is a test',
},
fr: {
'This is a test': 'C\'est un test',
},
ja: {
// recovery
var httpReadOrRetry = function (url, timeout, times) {
return http.read(url).then(function (content) {
return content;
}, function (error) {
if (times == 0)
return error;
return delay(timeout).then(function () {
return httpReadOrRetry(url, timeout, times - 1);
});