Compare commits

..

No commits in common. "b3f7002556fc10c94321611e0f0e7f8dd09b53f6" and "0aea3c1e7ca4f83c0277245f6fa8c7772a152a80" have entirely different histories.

7 changed files with 53 additions and 107 deletions

View File

@ -1,16 +0,0 @@
const fs = require('fs');
// get all language files
const files = fs.readdirSync('./src/locales/');
files.forEach((f) => {
// read file as object
const unordered = JSON.parse(fs.readFileSync(`src/locales/${f}`));
// order object by keys alpabetically A-Z
const ordered = Object.keys(unordered).sort().reduce((obj, key) => {
obj[key] = unordered[key];
return obj;
}, {});
// format output as json for commit diff compatibility
const out = JSON.stringify(ordered, 0, 4);
// write output file
fs.writeFileSync(`src/locales/${f}`, out);
});

View File

@ -17,7 +17,7 @@
// //
init({ init({
fallbackLocale: "en-US", fallbackLocale: "en-US",
initialLocale: $lang, initialLocale: $lang
}); });
</script> </script>

View File

@ -38,13 +38,12 @@
<div <div
class="flex flex-col justify-center md:justify-start my-auto pt-8 md:pt-0 px-8 md:px-24 lg:px-32" class="flex flex-col justify-center md:justify-start my-auto pt-8 md:pt-0 px-8 md:px-24 lg:px-32"
> >
<p class="text-center text-3xl">{$_("configuration")}</p> <p class="text-center text-3xl">{$_('configuration')}</p>
<p class="text-center"> <p class="text-center">
{$_("please_provide_the_scan_client_token")}<br /><a {$_('please_provide_the_scan_client_token')}<br /><a
target="_blank" target="_blank"
class="underline" class="underline"
href="https://docs.lauf-fuer-kaya.de/" href="https://docs.lauf-fuer-kaya.de/">{$_('see_our_configuration_guide')}</a
>{$_("see_our_configuration_guide")}</a
> >
</p> </p>
{#if error} {#if error}
@ -53,9 +52,7 @@
class="text-white px-6 py-4 border-0 rounded relative bg-red-500 mt-2" class="text-white px-6 py-4 border-0 rounded relative bg-red-500 mt-2"
> >
<span class="inline-block align-middle"> <span class="inline-block align-middle">
<b class="capitalize">{$_("error")}</b><br />{$_( <b class="capitalize">{$_('error')}</b><br />{$_('the_provided_scan_station_token_is_invalid')}<br />{$_('please_check_your_token_and_try_again')}
"the_provided_scan_station_token_is_invalid"
)}<br />{$_("please_check_your_token_and_try_again")}
</span> </span>
</div> </div>
{/if} {/if}
@ -64,9 +61,7 @@
class="text-white px-6 py-4 border-0 rounded relative bg-red-500 mt-2" class="text-white px-6 py-4 border-0 rounded relative bg-red-500 mt-2"
> >
<span class="inline-block align-middle"> <span class="inline-block align-middle">
<b class="capitalize">{$_("error")}</b><br />{$_( <b class="capitalize">{$_('error')}</b><br />{$_('the_provided_scan_station_is_disabled')}
"the_provided_scan_station_is_disabled"
)}
</span> </span>
</div> </div>
{/if} {/if}
@ -97,11 +92,11 @@
}} }}
> >
<div class="flex flex-col pt-4"> <div class="flex flex-col pt-4">
<label for="token" class="text-lg">{$_("client_token")}</label> <label for="token" class="text-lg">{$_('client_token')}</label>
<input <input
type="text" type="text"
id="token" id="token"
placeholder={$_("client_token")} :placeholder={$_('client_token')}
bind:value={token} bind:value={token}
class:border-red-500={!isTokenValid} class:border-red-500={!isTokenValid}
class:border-solid={!isTokenValid} class:border-solid={!isTokenValid}
@ -110,9 +105,7 @@
/> />
</div> </div>
{#if !isTokenValid} {#if !isTokenValid}
<span class="text-sm" <span class="text-sm">{$_('please_provide_a_valid_client_token')}</span>
>{$_("please_provide_a_valid_client_token")}</span
>
{/if} {/if}
<button <button
disabled={!isTokenValid} disabled={!isTokenValid}
@ -121,7 +114,7 @@
id="configure" id="configure"
type="submit" type="submit"
class="bg-black text-white font-bold text-lg hover:bg-gray-700 p-2 mt-8 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black" class="bg-black text-white font-bold text-lg hover:bg-gray-700 p-2 mt-8 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black"
>{$_("configure")}</button >{$_('configure')}</button
> >
</form> </form>
<div class="text-center pt-12 pb-12"> <div class="text-center pt-12 pb-12">

View File

@ -1,7 +1,7 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
import { apikey, page, stationinfo } from "./store.js"; import { apikey, lang, page, stationinfo } from "./store.js";
function init(el) { function init(el) {
el.focus(); el.focus();
} }
@ -100,7 +100,7 @@
> >
<label class="block"> <label class="block">
<span class="block mb-1 text-xs font-medium text-gray-700" <span class="block mb-1 text-xs font-medium text-gray-700"
>{$_('runner_card')}</span >Runner Card</span
> >
<input <input
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mt-1 leading-tight focus:outline-none focus:shadow-outline" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mt-1 leading-tight focus:outline-none focus:shadow-outline"
@ -121,9 +121,9 @@
<h1 class="text-3xl font-bold text-center">lap time</h1> <h1 class="text-3xl font-bold text-center">lap time</h1>
<h1 class="text-8xl font-bold text-center">{lastscan_laptime}</h1> <h1 class="text-8xl font-bold text-center">{lastscan_laptime}</h1>
{:else} {:else}
<h1 class="text-3xl font-bold text-center">{$_('please_scan_a_card')}</h1> <h1 class="text-3xl font-bold text-center">please scan a card...</h1>
{/if} {/if}
<button type="submit" class="hidden">{$_('scan')}</button> <button type="submit" class="hidden">Scan!</button>
</form> </form>
</div> </div>
</section> </section>

View File

@ -1,6 +1,4 @@
<script> <script>
import { _ } from "svelte-i18n";
import { apikey, lang, page, stationinfo } from "./store.js"; import { apikey, lang, page, stationinfo } from "./store.js";
</script> </script>
@ -8,30 +6,30 @@ import { _ } from "svelte-i18n";
<h1 class="font-bold text-3xl w-full text-center text-gray-900"> <h1 class="font-bold text-3xl w-full text-center text-gray-900">
Lauf Für Kaya! Scan 📷 Lauf Für Kaya! Scan 📷
</h1> </h1>
<h1 class="text-3xl w-full text-center text-gray-900">{$_('settings')}</h1> <h1 class="text-3xl w-full text-center text-gray-900">Settings</h1>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('api_key')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">API Key</p>
<p class="block text-sm text-gray-700">{$apikey}</p> <p class="block text-sm text-gray-700">{$apikey}</p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('station_description')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Station Description</p>
<p class="block text-sm text-gray-700"> <p class="block text-sm text-gray-700">
{JSON.parse($stationinfo).description} {JSON.parse($stationinfo).description}
</p> </p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('station_id')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Station ID</p>
<p class="block text-sm text-gray-700">{JSON.parse($stationinfo).id}</p> <p class="block text-sm text-gray-700">{JSON.parse($stationinfo).id}</p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_id')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Track ID</p>
<p class="block text-sm text-gray-700">{JSON.parse($stationinfo).track.id}</p> <p class="block text-sm text-gray-700">{JSON.parse($stationinfo).track.id}</p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_name')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Track Name</p>
<p class="block text-sm text-gray-700"> <p class="block text-sm text-gray-700">
{JSON.parse($stationinfo).track.name} {JSON.parse($stationinfo).track.name}
</p> </p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('track_distance')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Track Distance</p>
<p class="block text-sm text-gray-700"> <p class="block text-sm text-gray-700">
{JSON.parse($stationinfo).track.distance} {JSON.parse($stationinfo).track.distance}
</p> </p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('minimum_lap_time')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">minimum lap time</p>
<p class="block text-sm text-gray-700"> <p class="block text-sm text-gray-700">
{JSON.parse($stationinfo).track.minimumLapTime}s {JSON.parse($stationinfo).track.minimumLapTime}s
</p> </p>
<p class="block text-sm font-bold text-gray-700 mt-2">{$_('language')}</p> <p class="block text-sm font-bold text-gray-700 mt-2">Language</p>
<div class="w-full"> <div class="w-full">
<div class="inline-block mr-2 mt-2"> <div class="inline-block mr-2 mt-2">
<button <button
@ -92,7 +90,7 @@ import { _ } from "svelte-i18n";
page.set(""); page.set("");
}} }}
class="mb-3 w-full py-3 border-black border-3 text-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black" class="mb-3 w-full py-3 border-black border-3 text-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black"
>{$_('back_to_scanner')}</button >Back to Scanner</button
> >
<button <button
on:click={() => { on:click={() => {
@ -100,6 +98,6 @@ import { _ } from "svelte-i18n";
page.set(""); page.set("");
}} }}
class="w-full py-3 bg-black text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black" class="w-full py-3 bg-black text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black"
>{$_('log_out_from_this_client')}</button >Log Out from this Client</button
> >
</div> </div>

View File

@ -1,26 +1,9 @@
{ {
"api_key": "API Key", "english": "Englisch",
"back_to_scanner": "Zurück zum Scanner", "the_provided_scan_station_token_is_invalid": "",
"client_token": "Client Token",
"configuration": "Konfiguration", "configuration": "Konfiguration",
"configure": "Konfigurieren",
"error": "Error!",
"language": "Sprache",
"log_out_from_this_client": "Von diesem Scanner abmelden",
"minimum_lap_time": "minimale Rundenzeit",
"please_check_your_token_and_try_again": "Bitte überprüfe den Token und versuche es erneut...",
"please_provide_a_valid_client_token": "Bitte gebe einen gültigen Client-Token an ...",
"please_provide_the_scan_client_token": "Bitte gebe den Scan-Client-Token an.", "please_provide_the_scan_client_token": "Bitte gebe den Scan-Client-Token an.",
"please_scan_a_card": "Bitte scanne eine Karte ...",
"runner_card": "Läuferkarte",
"scan": "Scannen!",
"see_our_configuration_guide": "Siehe dir unsere Konfigurationsanleitung an.",
"settings": "Einstellungen",
"station_description": "Beschreibung der Scanstation",
"station_id": "Scanstations-ID",
"the_provided_scan_station_is_disabled": "Die angegebene Scanstation ist deaktiviert.", "the_provided_scan_station_is_disabled": "Die angegebene Scanstation ist deaktiviert.",
"the_provided_scan_station_token_is_invalid": "Der angegebene Scanstation-Token ist ungültig.", "see_our_configuration_guide": "Siehe dir unsere Konfigurationsanleitung an.",
"track_distance": "Länge des Tracks", "please_provide_a_valid_client_token": "Bitte gebe einen gültigen Client-Token an ..."
"track_id": "Track ID",
"track_name": "Track Name"
} }

View File

@ -1,26 +1,14 @@
{ {
"api_key": "API Key",
"back_to_scanner": "Back to Scanner",
"client_token": "Client Token",
"configuration": "Configuration",
"configure": "Configure",
"error": "Error!",
"language": "Language",
"log_out_from_this_client": "Log Out from this Client",
"minimum_lap_time": "minimum lap time",
"please_check_your_token_and_try_again": "Please check your token and try again...",
"please_provide_a_valid_client_token": "Please provide a valid client token...",
"please_provide_the_scan_client_token": "Please provide the scan client token.", "please_provide_the_scan_client_token": "Please provide the scan client token.",
"please_scan_a_card": "please scan a card...", "configuration": "Configuration",
"runner_card": "Runner Card",
"scan": "Scan!",
"see_our_configuration_guide": "See our configuration guide.", "see_our_configuration_guide": "See our configuration guide.",
"settings": "Settings", "error": "Error!",
"station_description": "Station Description",
"station_id": "Scanstation ID",
"the_provided_scan_station_is_disabled": "The provided scan station is disabled.",
"the_provided_scan_station_token_is_invalid": "The provided scan station token is invalid.", "the_provided_scan_station_token_is_invalid": "The provided scan station token is invalid.",
"track_distance": "Track Distance", "please_check_your_token_and_try_again": "Please check your token and try again...",
"track_id": "Track ID", "the_provided_scan_station_is_disabled": "The provided scan station is disabled.",
"track_name": "Track Name" "client_token": "Client Token",
"please_provide_a_valid_client_token": "Please provide a valid client token...",
"configure": "Configure",
"german": "Deutsch",
"english": "English"
} }