Migrate all layouts

This commit is contained in:
Manuel Friedli 2019-05-05 10:59:50 +02:00
parent 3e18bcb223
commit 5a00280bdc
12 changed files with 806 additions and 28 deletions

102
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

View file

@ -20,6 +20,14 @@ import {WidgetPrototype} from "./widget/widget-prototype";
import {Layout} from "./domain/layout";
import {Layout_de_CH} from "./layout/layout-de_ch";
import {Layout_de_CH_genau} from "./layout/layout-de_ch_genau";
import {Layout_de} from "./layout/layout-de";
import {Layout_dk} from "./layout/layout-dk";
import {Layout_en} from "./layout/layout-en";
import {Layout_es} from "./layout/layout-es";
import {Layout_fr} from "./layout/layout-fr";
import {Layout_it} from "./layout/layout-it";
import {Layout_nl} from "./layout/layout-nl";
import {Layout_pt} from "./layout/layout-pt";
// First things first: discover included themes and register them
autodetectThemes();
@ -27,6 +35,14 @@ autodetectThemes();
// Now register some layouts
Globals.registerLayout(Layout_de_CH);
Globals.registerLayout(Layout_de_CH_genau);
Globals.registerLayout(Layout_de);
Globals.registerLayout(Layout_dk);
Globals.registerLayout(Layout_en);
Globals.registerLayout(Layout_es);
Globals.registerLayout(Layout_fr);
Globals.registerLayout(Layout_it);
Globals.registerLayout(Layout_nl);
Globals.registerLayout(Layout_pt);
$.widget("fritteli.uhr", {
"options": {

74
src/layout/layout-de.ts Normal file
View file

@ -0,0 +1,74 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const es_ist: WordDefinition = {1: [1, 2, 4, 5, 6]};
const uhr: WordDefinition = {10: [9, 10, 11]};
const nach: WordDefinition = {4: [8, 9, 10, 11]};
const vor: WordDefinition = {4: [1, 2, 3]};
const halb: WordDefinition = {5: [1, 2, 3, 4]};
const fuenf: WordDefinition = {1: [8, 9, 10, 11]};
const zehn: WordDefinition = {2: [1, 2, 3, 4]};
const viertel: WordDefinition = {3: [5, 6, 7, 8, 9, 10, 11]};
const zwanzig: WordDefinition = {2: [5, 6, 7, 8, 9, 10, 11]};
const dreiviertel: WordDefinition = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
export const Layout_de: Layout = {
code: 'de',
hours: {
'0,12': {9: [7, 8, 9, 10, 11]},
'1,13': {6: [1, 2, 3, 4]},
'2,14': {6: [8, 9, 10, 11]},
'3,15': {7: [1, 2, 3, 4]},
'4,16': {7: [8, 9, 10, 11]},
'5,17': {5: [8, 9, 10, 11]},
'6,18': {8: [1, 2, 3, 4, 5]},
'7,19': {9: [1, 2, 3, 4, 5, 6]},
'8,20': {8: [8, 9, 10, 11]},
'9,21': {10: [4, 5, 6, 7]},
'10,22': {10: [1, 2, 3, 4]},
'11,23': {5: [6, 7, 8]}
},
letters: [
'ESKISTAFÜNF',
'ZEHNZWANZIG',
'DREIVIERTEL',
'VORFUNKNACH',
'HALBAELFÜNF',
'EINSXAMZWEI',
'DREIPMJVIER',
'SECHSNLACHT',
'SIEBENZWÖLF',
'ZEHNEUNKUHR'
],
minutes: {
'0,1,2,3,4': uhr,
'5,6,7,8,9': [fuenf, nach],
'10,11,12,13,14': [zehn, nach],
'15,16,17,18,19': [viertel, nach],
'20,21,22,23,24': [zwanzig, nach],
'25,26,27,28,29': [fuenf, vor, halb],
'30,31,32,33,34': halb,
'35,36,37,38,39': [fuenf, nach, halb],
'40,41,42,43,44': [zwanzig, vor],
'45,46,47,48,49': dreiviertel,
'50,51,52,53,54': [zehn, vor],
'55,56,57,58,59': [fuenf, vor]
},
permanent: es_ist,
prettyName: 'Deutsch',
version: 2
};

View file

@ -13,7 +13,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from "../domain/layout";
import {Layout, WordDefinition} from '../domain/layout';
const es_isch: WordDefinition = {1: [1, 2, 4, 5, 6, 7]};
const ab: WordDefinition = {4: [1, 2]};
@ -53,17 +53,17 @@ export const Layout_de_CH: Layout = {
'ZWÖUFINAUHR'
],
minutes: {
"5,6,7,8,9": [fuef, ab],
"10,11,12,13,14": [zae, ab],
"15,16,17,18,19": [viertu, ab],
"20,21,22,23,24": [zwaenzg, ab],
"25,26,27,28,29": [fuef, vor, haubi],
"30,31,32,33,34": haubi,
"35,36,37,38,39": [fuef, ab, haubi],
"40,41,42,43,44": [zwaenzg, vor],
"45,46,47,48,49": [viertu, vor],
"50,51,52,53,54": [zae, vor],
"55,56,57,58,59": [fuef, vor]
'5,6,7,8,9': [fuef, ab],
'10,11,12,13,14': [zae, ab],
'15,16,17,18,19': [viertu, ab],
'20,21,22,23,24': [zwaenzg, ab],
'25,26,27,28,29': [fuef, vor, haubi],
'30,31,32,33,34': haubi,
'35,36,37,38,39': [fuef, ab, haubi],
'40,41,42,43,44': [zwaenzg, vor],
'45,46,47,48,49': [viertu, vor],
'50,51,52,53,54': [zae, vor],
'55,56,57,58,59': [fuef, vor]
},
permanent: es_isch,
prettyName: 'Bärndütsch',

View file

@ -13,7 +13,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from "../domain/layout";
import {Layout, WordDefinition} from '../domain/layout';
const es_isch: WordDefinition = {1: [1, 2, 4, 5, 6, 7]};
const genau: WordDefinition = {3: [7, 8, 9, 10, 11]};
@ -54,18 +54,18 @@ export const Layout_de_CH_genau: Layout = {
'ZWÖUFINAUHR'
],
minutes: {
"0": genau,
"5,6,7,8,9": [fuef, ab],
"10,11,12,13,14": [zae, ab],
"15,16,17,18,19": [viertu, ab],
"20,21,22,23,24": [zwaenzg, ab],
"25,26,27,28,29": [fuef, vor, haubi],
"30,31,32,33,34": haubi,
"35,36,37,38,39": [fuef, ab, haubi],
"40,41,42,43,44": [zwaenzg, vor],
"45,46,47,48,49": [viertu, vor],
"50,51,52,53,54": [zae, vor],
"55,56,57,58,59": [fuef, vor]
'0': genau,
'5,6,7,8,9': [fuef, ab],
'10,11,12,13,14': [zae, ab],
'15,16,17,18,19': [viertu, ab],
'20,21,22,23,24': [zwaenzg, ab],
'25,26,27,28,29': [fuef, vor, haubi],
'30,31,32,33,34': haubi,
'35,36,37,38,39': [fuef, ab, haubi],
'40,41,42,43,44': [zwaenzg, vor],
'45,46,47,48,49': [viertu, vor],
'50,51,52,53,54': [zae, vor],
'55,56,57,58,59': [fuef, vor]
},
permanent: es_isch,
prettyName: 'Bärndütsch (genau)',

72
src/layout/layout-dk.ts Normal file
View file

@ -0,0 +1,72 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const klokken_er: WordDefinition = {1: [1, 2, 3, 4, 5, 6, 7, 9, 10]};
const minutter: WordDefinition = {4: [4, 5, 6, 7, 8, 9, 10, 11]};
const i: WordDefinition = {5: [8]};
const over: WordDefinition = {5: [4, 5, 6, 7]};
const fem: WordDefinition = {2: [1, 2, 3]};
const ti: WordDefinition = {4: [1, 2]};
const kvart: WordDefinition = {3: [4, 5, 6, 7, 8]};
const tyve: WordDefinition = {2: [4, 5, 6, 7]};
const halv: WordDefinition = {6: [8, 9, 10, 11]};
export const Layout_dk: Layout = {
code: 'dk',
hours: {
'0,12': {10: [8, 9, 10, 11]},
'1,13': {7: [1, 2]},
'2,14': {7: [3, 4]},
'3,15': {7: [5, 6, 7]},
'4,16': {7: [8, 9, 10, 11]},
'5,17': {8: [1, 2, 3]},
'6,18': {8: [4, 5, 6, 7]},
'7,19': {8: [9, 10, 11]},
'8,20': {9: [1, 2, 3, 4]},
'9,21': {9: [6, 7]},
'10,22': {9: [10, 11]},
'11,23': {10: [1, 2, 3, 4, 5, 6]}
},
letters: [
'KLOKKENVERO',
'FEMTYVESKLA',
'OJEKVARTVAT',
'TIAMINUTTER',
'VEMOVERILMF',
'MONALISHALV',
'ETTOTREFIRE',
'FEMSEKSRSYV',
'OTTERNIMETI',
'ELLEVEATOLV'
],
minutes: {
'5,6,7,8,9': [fem, minutter, over],
'10,11,12,13,14': [ti, minutter, over],
'15,16,17,18,19': [kvart, over],
'20,21,22,23,24': [tyve, minutter, over],
'25,26,27,28,29': [fem, minutter, i, halv],
'30,31,32,33,34': [halv],
'35,36,37,38,39': [fem, minutter, over, halv],
'40,41,42,43,44': [tyve, minutter, i],
'45,46,47,48,49': [kvart, i],
'50,51,52,53,54': [ti, minutter, i],
'55,56,57,58,59': [fem, minutter, i]
},
permanent: klokken_er,
prettyName: 'Dansk',
version: 2
};

82
src/layout/layout-en.ts Normal file
View file

@ -0,0 +1,82 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const it_is: WordDefinition = {1: [1, 2, 4, 5]};
const half: WordDefinition = {4: [1, 2, 3, 4]};
const to: WordDefinition = {4: [10, 11]};
const past: WordDefinition = {5: [1, 2, 3, 4]};
const o_clock: WordDefinition = {10: [5, 6, 7, 8, 9, 10, 11]};
const five: WordDefinition = {3: [7, 8, 9, 10]};
const ten: WordDefinition = {4: [6, 7, 8]};
const a_quarter: WordDefinition = {2: [1, 3, 4, 5, 6, 7, 8, 9]};
const twenty: WordDefinition = {3: [1, 2, 3, 4, 5, 6]};
const twentyfive: WordDefinition = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]};
export const Layout_en: Layout = {
code: 'en',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 35) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0,12': {9: [6, 7, 8, 9, 10, 11]},
'1,13': {6: [1, 2, 3]},
'2,14': {7: [9, 10, 11]},
'3,15': {6: [7, 8, 9, 10, 11]},
'4,16': {7: [1, 2, 3, 4]},
'5,17': {7: [5, 6, 7, 8]},
'6,18': {6: [4, 5, 6]},
'7,19': {9: [1, 2, 3, 4, 5]},
'8,20': {8: [1, 2, 3, 4, 5]},
'9,21': {5: [8, 9, 10, 11]},
'10,22': {10: [1, 2, 3]},
'11,23': {8: [6, 7, 8, 9, 10, 11]}
},
letters: [
'ITLISBFAMPM',
'ACQUARTERDC',
'TWENTYFIVEX',
'HALFBTENFTO',
'PASTERUNINE',
'ONESIXTHREE',
'FOURFIVETWO',
'EIGHTELEVEN',
'SEVENTWELVE',
'TENSO\'CLOCK'
],
minutes: {
'0,1,2,3,4': o_clock,
'5,6,7,8,9': [five, past],
'10,11,12,13,14': [ten, past],
'15,16,17,18,19': [a_quarter, past],
'20,21,22,23,24': [twenty, past],
'25,26,27,28,29': [twentyfive, past],
'30,31,32,33,34': [half, past],
'35,36,37,38,39': [twentyfive, to],
'40,41,42,43,44': [twenty, to],
'45,46,47,48,49': [a_quarter, to],
'50,51,52,53,54': [ten, to],
'55,56,57,58,59': [five, to]
},
permanent: it_is,
prettyName: 'English',
version: 2
};

81
src/layout/layout-es.ts Normal file
View file

@ -0,0 +1,81 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const es_la: WordDefinition = {1: [1, 2, 6, 7]};
const son_las: WordDefinition = {1: [2, 3, 4, 6, 7, 8]};
const y: WordDefinition = {7: [6]};
const menos: WordDefinition = {7: [7, 8, 9, 10, 11]};
const media: WordDefinition = {10: [1, 2, 3, 4, 5]};
const cinco: WordDefinition = {9: [7, 8, 9, 10, 11]};
const diez: WordDefinition = {8: [8, 9, 10, 11]};
const cuarto: WordDefinition = {10: [6, 7, 8, 9, 10, 11]};
const veinte: WordDefinition = {8: [2, 3, 4, 5, 6, 7]};
const veinticinco: WordDefinition = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
export const Layout_es: Layout = {
code: 'es',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 35) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0,12': [son_las, {7: [1, 2, 3, 4]}],
'1,13': [es_la, {1: [9, 10, 11]}],
'2,14': [son_las, {2: [1, 2, 3]}],
'3,15': [son_las, {2: [5, 6, 7, 8]}],
'4,16': [son_las, {3: [1, 2, 3, 4, 5, 6]}],
'5,17': [son_las, {3: [7, 8, 9, 10, 11]}],
'6,18': [son_las, {4: [1, 2, 3, 4]}],
'7,19': [son_las, {4: [6, 7, 8, 9, 10]}],
'8,20': [son_las, {5: [1, 2, 3, 4]}],
'9,21': [son_las, {5: [5, 6, 7, 8, 9]}],
'10,22': [son_las, {6: [3, 4, 5, 6]}],
'11,23': [son_las, {6: [8, 9, 10, 11]}]
},
letters: [
'ESONELASUNA',
'DOSITRESORE',
'CUATROCINCO',
'SEISASIETEN',
'OCHONUEVEYO',
'LADIEZSONCE',
'DOCELYMENOS',
'OVEINTEDIEZ',
'VEINTICINCO',
'MEDIACUARTO'
],
minutes: {
'5,6,7,8,9': [y, cinco],
'10,11,12,13,14': [y, diez],
'15,16,17,18,19': [y, cuarto],
'20,21,22,23,24': [y, veinte],
'25,26,27,28,29': [y, veinticinco],
'30,31,32,33,34': [y, media],
'35,36,37,38,39': [menos, veinticinco],
'40,41,42,43,44': [menos, veinte],
'45,46,47,48,49': [menos, cuarto],
'50,51,52,53,54': [menos, diez],
'55,56,57,58,59': [menos, cinco]
},
permanent: null,
prettyName: 'Español',
version: 2
};

115
src/layout/layout-fr.ts Normal file
View file

@ -0,0 +1,115 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const il_est: WordDefinition = {1: [1, 2, 4, 5, 6]};
const et: WordDefinition = {8: [1, 2]};
const moins: WordDefinition = {7: [1, 2, 3, 4, 5]};
const demie: WordDefinition = {10: [4, 5, 6, 7, 8]};
const heures: WordDefinition = {6: [6, 7, 8, 9, 10, 11]};
const le: WordDefinition = {7: [7, 8]};
const cinq: WordDefinition = {9: [7, 8, 9, 10]};
const dix: WordDefinition = {7: [9, 10, 11]};
const quart: WordDefinition = {8: [4, 5, 6, 7, 8]};
const vingt: WordDefinition = {9: [1, 2, 3, 4, 5]};
const vingtcinq: WordDefinition = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]};
export const Layout_fr: Layout = {
code: 'fr',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 35) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0': {5: [6, 7, 8, 9, 10, 11]},
'1,13': [
{3: [5, 6, 7]},
heures
],
'2,14': [
{1: [8, 9, 10, 11]},
heures
],
'3,15': [
{2: [7, 8, 9, 10, 11]},
heures
],
'4,16': [
{2: [1, 2, 3, 4, 5, 6]},
heures
],
'5,17': [
{4: [8, 9, 10, 11]},
heures
],
'6,18': [
{4: [5, 6, 7]},
heures
],
'7,19': [
{3: [8, 9, 10, 11]},
heures
],
'8,20': [
{4: [1, 2, 3, 4]},
heures
],
'9,21': [
{3: [1, 2, 3, 4]},
heures
],
'10,22': [
{5: [3, 4, 5]},
heures
],
'11,23': [
{6: [1, 2, 3, 4]},
heures
],
'12': {5: [1, 2, 3, 4]}
},
letters: [
'ILNESTODEUX',
'QUATRETROIS',
'NEUFUNESEPT',
'HUITSIXCINQ',
'MIDIXMINUIT',
'ONZERHEURES',
'MOINSOLEDIX',
'ETRQUARTPMD',
'VINGT-CINQU',
'ETSDEMIEPAM'
],
minutes: {
'5,6,7,8,9': cinq,
'10,11,12,13,14': dix,
'15,16,17,18,19': [et, quart],
'20,21,22,23,24': vingt,
'25,26,27,28,29': vingtcinq,
'30,31,32,33,34': [et, demie],
'35,36,37,38,39': [moins, vingtcinq],
'40,41,42,43,44': [moins, vingt],
'45,46,47,48,49': [moins, le, quart],
'50,51,52,53,54': [moins, dix],
'55,56,57,58,59': [moins, cinq]
},
permanent: il_est,
prettyName: 'Français',
version: 2
};

80
src/layout/layout-it.ts Normal file
View file

@ -0,0 +1,80 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const sono_le: WordDefinition = {1: [1, 2, 3, 4, 6, 7]};
const e_l: WordDefinition = {2: [1, 3, 4]};
const e: WordDefinition = {8: [1]};
const meno: WordDefinition = {7: [8, 9, 10, 11]};
const mezza: WordDefinition = {10: [7, 8, 9, 10, 11]};
const cinque: WordDefinition = {9: [6, 7, 8, 9, 10, 11]};
const dieci: WordDefinition = {10: [1, 2, 3, 4, 5]};
const un_quarto: WordDefinition = {8: [3, 4, 6, 7, 8, 9, 10, 11]};
const venti: WordDefinition = {9: [1, 2, 3, 4, 5]};
const venticinque: WordDefinition = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
export const Layout_it: Layout = {
code: 'it',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 35) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0,12': [sono_le, {5: [1, 2, 3, 4, 5, 6]}],
'1,13': [e_l, {2: [5, 6, 7]}],
'2,14': [sono_le, {2: [9, 10, 11]}],
'3,15': [sono_le, {3: [1, 2, 3]}],
'4,16': [sono_le, {6: [1, 2, 3, 4, 5, 6, 7]}],
'5,17': [sono_le, {7: [1, 2, 3, 4, 5, 6]}],
'6,18': [sono_le, {6: [9, 10, 11]}],
'7,19': [sono_le, {5: [7, 8, 9, 10, 11]}],
'8,20': [sono_le, {3: [4, 5, 6, 7]}],
'9,21': [sono_le, {3: [8, 9, 10, 11]}],
'10,22': [sono_le, {4: [1, 2, 3, 4, 5]}],
'11,23': [sono_le, {4: [6, 7, 8, 9, 10, 11]}]
},
letters: [
'SONORLEBORE',
'ÈRL\'UNASDUE',
'TREOTTONOVE',
'DIECIUNDICI',
'DODICISETTE',
'QUATTROCSEI',
'CINQUEAMENO',
'ECUNOQUARTO',
'VENTICINQUE',
'DIECIPMEZZA'
],
minutes: {
'5,6,7,8,9': [e, cinque],
'10,11,12,13,14': [e, dieci],
'15,16,17,18,19': [e, un_quarto],
'20,21,22,23,24': [e, venti],
'25,26,27,28,29': [e, venticinque],
'30,31,32,33,34': [e, mezza],
'35,36,37,38,39': [meno, venticinque],
'40,41,42,43,44': [meno, venti],
'45,46,47,48,49': [meno, un_quarto],
'50,51,52,53,54': [meno, dieci],
'55,56,57,58,59': [meno, cinque]
},
permanent: null,
prettyName: 'Italiano',
version: 2
};

81
src/layout/layout-nl.ts Normal file
View file

@ -0,0 +1,81 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const het_is: WordDefinition = {1: [1, 2, 3, 5, 6]};
const over1: WordDefinition = {3: [1, 2, 3, 4]};
const voor1: WordDefinition = {2: [8, 9, 10, 11]};
const over2: WordDefinition = {4: [8, 9, 10, 11]};
const voor2: WordDefinition = {5: [1, 2, 3, 4]};
const half: WordDefinition = {4: [1, 2, 3, 4]};
const vijf: WordDefinition = {1: [8, 9, 10, 11]};
const tien: WordDefinition = {2: [1, 2, 3, 4]};
const kwart: WordDefinition = {3: [7, 8, 9, 10, 11]};
const uur: WordDefinition = {10: [9, 10, 11]};
export const Layout_nl: Layout = {
code: 'nl',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 20) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0,12': {10: [1, 2, 3, 4, 5, 6]},
'1,13': {5: [8, 9, 10]},
'2,14': {6: [1, 2, 3, 4]},
'3,15': {6: [8, 9, 10, 11]},
'4,16': {7: [1, 2, 3, 4]},
'5,17': {7: [5, 6, 7, 8]},
'6,18': {7: [9, 10, 11]},
'7,19': {8: [1, 2, 3, 4, 5]},
'8,20': {9: [1, 2, 3, 4]},
'9,21': {8: [7, 8, 9, 10, 11]},
'10,22': {9: [5, 6, 7, 8]},
'11,23': {9: [9, 10, 11]}
},
letters: [
'HETKISAVIJF',
'TIENBTZVOOR',
'OVERMEKWART',
'HALFSPWOVER',
'VOORTHGEENS',
'TWEEPVCDRIE',
'VIERVIJFZES',
'ZEVENONEGEN',
'ACHTTIENELF',
'TWAALFBFUUR'
],
minutes: {
'0,1,2,3,4': uur,
'5,6,7,8,9': [vijf, over1],
'10,11,12,13,14': [tien, over1],
'15,16,17,18,19': [kwart, over2],
'20,21,22,23,24': [tien, voor1, half],
'25,26,27,28,29': [vijf, voor1, half],
'30,31,32,33,34': half,
'35,36,37,38,39': [vijf, over1, half],
'40,41,42,43,44': [tien, over1, half],
'45,46,47,48,49': [kwart, voor2],
'50,51,52,53,54': [tien, voor1],
'55,56,57,58,59': [vijf, voor1]
},
permanent: het_is,
prettyName: 'Nederlands',
version: 2
};

81
src/layout/layout-pt.ts Normal file
View file

@ -0,0 +1,81 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import {Layout, WordDefinition} from '../domain/layout';
const e_: WordDefinition = {1: [1]};
const sao: WordDefinition = {1: [2, 3, 4]};
const e1: WordDefinition = {7: [8]};
const e2: WordDefinition = {10: [5]};
const menos: WordDefinition = {7: [7, 8, 9, 10, 11]};
const meia: WordDefinition = {8: [8, 9, 10, 11]};
const cinco: WordDefinition = {10: [7, 8, 9, 10, 11]};
const dez: WordDefinition = {10: [1, 2, 3]};
const um_quarto: WordDefinition = {9: [1, 2, 4, 5, 6, 7, 8, 9]};
const vinte: WordDefinition = {8: [1, 2, 3, 4, 5]};
export const Layout_pt: Layout = {
code: 'pt',
getHour: (time: Date) => {
const hour = time.getHours();
if (time.getMinutes() >= 35) {
return (hour + 1) % 24;
}
return hour;
},
hours: {
'0': [e_, {'6': [2, 3, 4, 5, 7, 8, 9, 10, 11]}],
'12': [e_, {'2': [1, 2, 3, 4, 6, 7, 8]}],
'1,13': [e_, {'1': [5, 6, 7]}],
'2,14': [sao, {'3': [1, 2, 3, 4]}],
'3,15': [sao, {'1': [8, 9, 10, 11]}],
'4,16': [sao, {'4': [1, 2, 3, 4, 5, 6]}],
'5,17': [sao, {'5': [1, 2, 3, 4, 5]}],
'6,18': [sao, {'3': [4, 5, 6, 7]}],
'7,19': [sao, {'3': [7, 8, 9, 10]}],
'8,20': [sao, {'5': [5, 6, 7, 8]}],
'9,21': [sao, {'4': [8, 9, 10, 11]}],
'10,22': [sao, {'2': [9, 10, 11]}],
'11,23': [sao, {'5': [8, 9, 10, 11]}]
},
letters: [
'ÉSÃOUMATRÊS',
'MEIOLDIADEZ',
'DUASEISETEY',
'QUATROHNOVE',
'CINCOITONZE',
'ZMEIALNOITE',
'HORASYMENOS',
'VINTECAMEIA',
'UMVQUARTOPM',
'DEZOEYCINCO'
],
minutes: {
'5,6,7,8,9': [e1, cinco],
'10,11,12,13,14': [e1, dez],
'15,16,17,18,19': [e1, um_quarto],
'20,21,22,23,24': [e1, vinte],
'25,26,27,28,29': [e1, vinte, e2, cinco],
'30,31,32,33,34': [e1, meia],
'35,36,37,38,39': [menos, vinte, e2, cinco],
'40,41,42,43,44': [menos, vinte],
'45,46,47,48,49': [menos, um_quarto],
'50,51,52,53,54': [menos, dez],
'55,56,57,58,59': [menos, cinco]
},
permanent: null,
prettyName: 'Português',
version: 2
};