all repos — gemini-redirect @ a59ca1351120174591b7ba9c8808cb11a27d2dfb

static/stringlate/translate.html (view raw)

 1<!DOCTYPE html>
 2<html>
 3  <head>
 4    <title>Translate with Stringlate</title>
 5    <link rel="stylesheet" type="text/css" href="style.css">
 6    <link href="https://fonts.googleapis.com/css?family=Crimson+Text|Droid+Serif" rel="stylesheet">
 7    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
 8    <link rel="shortcut icon" href="favicon.ico" />
 9  </head>
10  <body>
11    <main>
12      <h1>Translate with Stringlate</h1>
13      <p>
14        This is a special link that you can open from your phone to translate
15        someone's application via Stringlate. You should have clicked
16        "Open with Stringlate" instead!
17      </p>
18      <noscript><p>
19        If you had JavaScript enabled, I could tell you which repository you
20        were trying to translate. But it's fine!
21      </p></noscript>
22      <p id="whichAppP" style="display:none">
23        You were probably trying to translate <a id="whichAppA"></a>.
24      </p>
25      <hr />
26      <p>
27        Don't have Stringlate installed?
28        <a href="https://f-droid.org/app/io.github.lonamiwebs.stringlate">Get
29        it from F-Droid!</a> or
30        <a href="https://github.com/LonamiWebs/Stringlate/releases">grab the
31        latest release</a>!
32      </p>
33      <p>
34        Want to integrate Stringlate with your application too? Check out the
35        <a href="https://lonami.dev/stringlate/index">main page</a>!
36      </p>
37    </main>
38
39    <script>
40      // https://stackoverflow.com/a/1404100/4759433
41      function getURLParameter(name) {
42        var r = RegExp(name+'='+'(.+?)(&|$)').exec(location.search)||[,null];
43        if (r[1]) return decodeURIComponent(r[1]);
44      }
45
46      var git = getURLParameter('git');
47      if (git) {
48        var whichAppP = document.getElementById('whichAppP');
49        var whichAppA = document.getElementById('whichAppA');
50
51        whichAppP.style.display = '';
52        whichAppA.href = git;
53
54        var slash = git.lastIndexOf('/');
55        if (slash == -1) {
56          whichAppA.innerHTML = git;
57        } else {
58          var name = git.substring(slash + 1);
59          if (/.git$/.test(name)) {
60            name = name.substring(0, name.length - 4);
61          }
62          whichAppA.innerHTML = name;
63        }
64      }
65    </script>
66  </body>
67</html>