diff --git a/index.html b/index.html index effddc5..142898a 100644 --- a/index.html +++ b/index.html @@ -72,6 +72,7 @@ --> + \ No newline at end of file diff --git a/langs.js b/langs.js new file mode 100644 index 0000000..33e2c8a --- /dev/null +++ b/langs.js @@ -0,0 +1,31 @@ +hmm.storage.i18n = {} +hmm.storage.i18n.en = { + "welcome": "Welcome to HmmOS!", + "menu": { + "apps-label": "Apps" + }, + "apps": { + "settings": { + "lang": "System language", + "name": "Settings" + } + } +} +hmm.storage.i18n.cd = { + welcome: "HmmOSk wangõ!", + menu: { + "apps-label": "selīng" + }, + apps: { + settings: { + lang: "kãiod moi", + name: "māthrdhng" + } + } +} +for (lang in hmm.storage.i18n) { + hmm.l[lang] = new Polyglot({ + locale: lang, + phrases: hmm.storage.i18n[lang] + }) +} \ No newline at end of file diff --git a/main.js b/main.js index c3fabcc..71fa749 100644 --- a/main.js +++ b/main.js @@ -26,47 +26,16 @@ window.hmm = { (p.match(/\/[^/]+/g) || []).forEach((e) => cr = cr[e.slice(1)]) return cr }, - pathToDot(p){ - return "hmm.storage[atob('"+p.replace(/^\//,"").split('/').map(btoa).join("')][atob('")+"')]" + pathToDot(p) { + return "hmm.storage[atob('" + p.replace(/^\//, "").split('/').map(btoa).join("')][atob('") + "')]" } } -hmm.l.en = new Polyglot({ - locale: "en", - phrases: { - "welcome": "Welcome to HmmOS!", - "menu": { - "apps-label": "Apps" - }, - "apps": { - "settings": { - "lang": "System language", - "name": "Settings", - _name: "Settings" - } - } - } -}) -hmm.l.cd = new Polyglot({ - locale: "cd", - phrases: { - welcome: "HmmOSk wangõ!", - menu: { - "apps-label": "selīng" - }, - apps: { - settings: { - lang: "kãiod moi", - name: "māthrdhng", - _name: "māthrdhng" - } - } - } -}) + hmm.storage = { - name:"HmmOS (tm)", + name: "HmmOS (tm)", apps: { "app.hmm": { - title: "testapp with a particularly long title", + title: { en: "Test app", cd: "edhō" }, type: "iframe", code: ` ` }, - "cmd.hmm": { - title: "Terminal", + "terminal.hmm": { + title: { en: "Terminal" }, type: 0, code: `` }, - "opts.hmm": { - title: "settings", + "settings.hmm": { + title: { en: "settings", cd:"māthrdhng" }, type: "iframe", code: "", }, "fe.hmm": { - title: "Files", + title: { en: "Files", cd:"kōpnge" }, type: "iframe", code: `` }, - "textpad.hmm":{ - title:"TextPad", - type:"iframe", - code:` + "textpad.hmm": { + title: { en: "TextPad" }, + type: "iframe", + code: `