Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localisation + bug fix #165

Merged
merged 11 commits into from
Apr 3, 2021
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ complicated installation.
* Configurable overrides for all defaults as well as filters and formats
* Multipage scanning (with collation for double sided scans)
* Light and dark mode
* **NEW**: International translations: German; Spanish (**help requested**)
* **NEW**: International translations: Czech, German, Italian, Spanish (**help requested**)

It supports any
[SANE compatible devices](http://www.sane-project.org/sane-supported-devices.html).
Expand Down
2 changes: 1 addition & 1 deletion server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scanservjs-server",
"version": "2.8.1",
"version": "2.8.2",
"description": "scanservjs is a simple web-based UI for SANE which allows you to share a scanner on a network without the need for drivers or complicated installation. scanserv does not do image conversion or manipulation (beyond the bare minimum necessary for the purposes of browser preview) or OCR.",
"scripts": {
"serve": "nodemon --exec 'vue-cli-service serve'",
Expand Down
6 changes: 4 additions & 2 deletions server/src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ const Config = require('./config');
const Devices = require('./devices');

const diagnostic = (path) => {
const success = fs.existsSync(path);
const message = success ? `Found ${path}` : `Unable to find ${path}`;
const exists = fs.existsSync(path);
const isDirectory = exists && fs.statSync(path).isDirectory();
const success = exists && !isDirectory;
const message = success ? `Found ${path}` : `Unable to find file ${path}`;
return {
success,
message
Expand Down
15 changes: 15 additions & 0 deletions server/test/context.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env mocha */
const assert = require('assert');
const Config = require('../src/config');
const Context = require('../src/context');

describe('Context', () => {
it('missing files', () => {
const temp = Config.scanimage;
Config.scanimage = '/x';
const context = new Context([]);
assert.strictEqual(context.diagnostics.length, 2);
assert.strictEqual(context.diagnostics[0].success, false);
Config.scanimage = temp;
});
});
2 changes: 2 additions & 0 deletions webui/src/classes/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ const Constants = {
Version: process.env.VUE_APP_VERSION,

Locales: [
'cz',
'de',
'en',
'es',
'it',
'test'
],

Expand Down
6 changes: 3 additions & 3 deletions webui/src/components/BatchDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</v-card-title>
<v-card-text>
<v-spacer></v-spacer>
<v-btn v-if="onFinish" color="green" text @click.prevent="finish">Finish</v-btn>
<v-btn v-if="onRescan" color="warning" text @click.prevent="rescan">Rescan page</v-btn>
<v-btn color="primary" text @click.prevent="next">Next</v-btn>
<v-btn v-if="onFinish" color="green" text @click.prevent="finish">{{ $t('batch-dialog.btn-finish') }}</v-btn>
<v-btn v-if="onRescan" color="warning" text @click.prevent="rescan">{{ $t('batch-dialog.btn-rescan') }}</v-btn>
<v-btn color="primary" text @click.prevent="next">{{ $t('batch-dialog.btn-next') }}</v-btn>
<v-img v-if="image" :src="'data:image/jpeg;base64,' + image" contain />
</v-card-text>
<v-card-actions>
Expand Down
89 changes: 89 additions & 0 deletions webui/src/locales/cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"global": {
"application-name": "scanservjs"
},

"about": {
"main": "scanservjs je jednoduché webové uživatelské rozhraní pro váš skener. Umožňuje vám sdílet jeden nebo více skenerů (s využitím SANE) bez ovladačů nebo komplikované instalace. Umí ukládat do TIF, JPG, PNG, PDF a TXT (využívá Tesseract OCR) s různými nastaveními komprese, vše je možné konfigurovat. Podporuje vícestránkové skenování a všechna zařízení kompatibilní se SANE.",
"issue": "Ohlaste chybu nebo se podívejte na zdrojový kód:"
},

"batch-dialog": {
"btn-finish": "Dokončit",
"btn-rescan": "Znovu oskenovat stránku",
"btn-next": "Další"
},

"files": {
"filename": "Název souboru",
"date": "Datum",
"size": "Velikost",
"message:deleted": "Odstraněno"
},

"navigation": {
"scan": "Skenování",
"files": "Soubory",
"settings": "Nastavení",
"about": "Informace",
"version": "Verze"
},

"pipeline": {
"high-quality": "Vysoká kvalita",
"medium-quality": "Střední kvalita",
"low-quality": "Nízká kvalita",
"uncompressed": "Bez komprese",
"lzw-compressed": "S kompresí LZW",
"ocr": "OCR",
"text-file": "Textový soubor"
},

"scan": {
"device": "Zařízení",
"source": "Zdroj",
"resolution": "Rozlišení",
"mode": "Mód",
"dynamic-lineart": "Dynamická perokresba",
"dynamic-lineart:enabled": "Zapnuto",
"dynamic-lineart:disabled": "Vypnuto",
"batch": "Vícestránkový sken",
"batch:none": "Vypnuto",
"batch:manual": "Manuální (s výzvou)",
"batch:auto": "Automatický (Podavač dokumentů)",
"batch:auto-collate-standard": "Automatický (Kompletovat 1, 3... 4, 2)",
"batch:auto-collate-reverse": "Automatický (Obrátit 1, 3... 2, 4)",
"filters": "Filtry",
"filters:auto-level": "Automatické zarovnání",
"filters:threshold": "Prahová hodnota barev",
"filters:blur": "Rozmazané",
"format": "Formát",
"btn-preview": "Načíst náhled",
"btn-clear": "Vymazat",
"btn-scan": "Skenovat",
"btn-reset": "Resetovat",
"top": "Nahoře",
"left": "Vlevo",
"width": "Šířka",
"height": "Výška",
"brightness": "Jas",
"contrast": "Kontrast",
"message:loading-devices": "Načítání zařízení...",
"message:no-devices": "Nebyla nalezena žádná zařízení",
"message:deleted-preview": "Odstranit náhled",
"message:turn-documents": "Obrátit dokumenty",
"message:preview-of-page": "Náhled stránky"
},

"settings": {
"title": "@:navigation.settings",
"behaviour-ui": "Chování a uživatelské rozhraní",
"locale": "Lokalizace",
"locale:description": "Vyberte vaši lokalizaci",
"theme": "Motiv",
"theme:description": "Motiv. Pokud použijete systémový motiv a ten se změní, budete potřebovat přenačíst aplikaci.",
"theme:system": "Podle systému",
"theme:light": "Světlý",
"theme:dark": "Tmavý"
}
}
89 changes: 89 additions & 0 deletions webui/src/locales/it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"global": {
"application-name": "scanservjs"
},

"about": {
"main": "scanservjs è una semplice interfaccia web per il tuo scanner. Permette di condividere uno o più scanner (usando SANE) in una rete, senza necessità di driver o installazioni complicate. Può salvare nei formati TIF, JPG, PNG, PDF e TXT (via Tesseract OCR) con vari livelli di compressione. Supporta la scansione multi-pagina e tutti i dispositivi compatibili con SANE.",
"issue": "Segnala problemi o visualizza il codice sorgente:"
},

"batch-dialog": {
"btn-finish": "Finito",
"btn-rescan": "Ripeti scansione",
"btn-next": "Prossima pagina"
},

"files": {
"filename": "Nome file",
"date": "Data",
"size": "Dimensione",
"message:deleted": "Eliminato"
},

"navigation": {
"scan": "Scansiona",
"files": "File",
"settings": "Impostazioni",
"about": "Informazioni",
"version": "Versione"
},

"pipeline": {
"high-quality": "Qualità alta",
"medium-quality": "Qualità media",
"low-quality": "Qualità bassa",
"uncompressed": "Non compresso",
"lzw-compressed": "Conpresso con LZW",
"ocr": "OCR",
"text-file": "File di testo"
},

"scan": {
"device": "Dispositivo",
"source": "Sorgente",
"resolution": "Risoluzione",
"mode": "Modalità",
"dynamic-lineart": "Lineart dinamico",
"dynamic-lineart:enabled": "Abilitato",
"dynamic-lineart:disabled": "Disabilitato",
"batch": "Raggruppa",
"batch:none": "No",
"batch:manual": "Manuale (Con finestra guidata)",
"batch:auto": "Automatico (Cassetto dei documenti)",
"batch:auto-collate-standard": "Automatico (Fascicola 1, 3... 4, 2)",
"batch:auto-collate-reverse": "Automatico (Inverso 1, 3... 2, 4)",
"filters": "Filtri",
"filters:auto-level": "Livello automatico",
"filters:threshold": "Soglia",
"filters:blur": "Sfocatura",
"format": "Formato",
"btn-preview": "Anteprima",
"btn-clear": "Cancella",
"btn-scan": "Scansiona",
"btn-reset": "Ripristina",
"top": "Sopra",
"left": "Sinistra",
"width": "Larghezza",
"height": "Altezza",
"brightness": "Luminosità",
"contrast": "Contrasto",
"message:loading-devices": "Caricamento dispositivi...",
"message:no-devices": "Nessun dispositivo trovato",
"message:deleted-preview": "Anteprima eliminata",
"message:turn-documents": "Capovolgi i documenti",
"message:preview-of-page": "Anteprima della pagina"
},

"settings": {
"title": "@:navigation.settings",
"behaviour-ui": "Comportamento ed interfaccia",
"locale": "Lingua",
"locale:description": "Scegli la lingua",
"theme": "Tema",
"theme:description": "Tema. Se usi il tema Sistema e lo cambi, dovrai ricaricare l'app.",
"theme:system": "Sistema",
"theme:light": "Chiaro",
"theme:dark": "Scuro"
}
}