File: i18n.js

package info (click to toggle)
openboard 1.7.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 57,404 kB
  • sloc: cpp: 76,443; javascript: 10,089; xml: 234; ansic: 38; makefile: 23; sh: 8
file content (49 lines) | stat: -rw-r--r-- 956 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// translate tooltips
const de = [
  "Links drehen",
  "Rechts drehen",
  "Kamera wählen",
  "Bildgröße wählen",
  "Bild aufnehmen"
];

const fr = [
  "Pivoter à gauche",
  "Pivoter à droite",
  "Sélectionner la caméra",
  "Taille de la capture",
  "Capturer"
];

function translate() {
  const buttons = [
    document.getElementById("rotleft"),
    document.getElementById("rotright"),
    document.getElementById("selectCamera"),
    document.getElementById("selectSize"),
    document.getElementById("snapshot")
  ];

  let lang = sankore.lang.substr(0, 2);
  let translation;

  switch (lang) {
    case "de":
      translation = de;
      break;
    case "fr":
      translation = fr;
      break;
    default:
      return;
  }

  for (ix = 0; ix < buttons.length; ++ix) {
    // get the span below the button
    let span = buttons[ix].getElementsByTagName("span");

    if (span) {
      span[0].textContent = translation[ix];
    }
  }
}