]> git.plutz.net Git - confetti/blob - l10n.sh
styling for iban assignment
[confetti] / l10n.sh
1 # Copyright 2014, 2016, 2019, 2021 Paul Hänsch
2 #
3 # This file is part of Confetti.
4
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
17
18 l10n(){
19   local word
20   [ $# -eq 0 ] && read -r word || word="$*"
21   l10n_global "$word"
22 }
23
24 l10n_global() {
25   case $1 in
26     # Nav Menu
27     cards) printf %s "Teil&shy;neh&shy;mende";;
28     courses) printf %s "Kurse";;
29     ledgers) printf %s "Bei&shy;trä&shy;ge";;
30
31     # VCF Default
32     PHOTO) printf %s "Foto";;
33     LOGO) printf %s "Logo";;
34     FN) printf %s "Voller Name";;
35     N) printf %s "Name";;
36     n_pre) printf %s "Titel";;
37     n_first) printf %s "Vorname";;
38     n_middle) printf %s "Mittel&shy;namen";;
39     n_last) printf %s "Nachname";;
40     n_post) printf %s "Zusätze";;
41     NICKNAME) printf %s "Spitz&shy;name";;
42     SOUND) printf %s "Aus&shy;sprache";;
43     GENDER) printf %s "Ge&shy;schlecht";;
44     KIND) printf %s "Typ";;
45     TITLE) printf %s "Beruf";;
46     ROLE) printf %s "Position";;
47     ORG) printf %s "Orga&shy;ni&shy;sation";;
48     MEMBER) printf %s "Mitglied";;
49     CATEGORIES) printf %s "Kategorien";;
50     ANNIVERSARY) printf %s "Jubiläum";;
51     BDAY) printf %s "Geburtstag";;
52     EMAIL) printf %s "E-Mail";;
53     TEL) printf %s "Telefon";;
54     teltype) printf %s "Anschluss&shy;typ:";;
55     TYPE=HOME) printf %s "Privat";;
56     TYPE=WORK) printf %s "Geschäft&shy;lich";;
57     TYPE=CELL) printf %s "Mobil";;
58     TYPE=FAX) printf %s "Fax";;
59     IMPP) printf %s "Chat";;
60     ADR) printf %s "Anschrift";;
61     URL) printf %s "Webseite";;
62     LANG) printf %s "Sprache";;
63     NOTE) printf %s "Notiz";;
64     RELATED) printf %s "Kontakte";;
65
66     # ICS Default
67     SUMMARY) printf "Bezeichnung";;
68     COMMENT) printf "Kommentar";;
69     DTSTART) printf "Beginn";;
70     DURATION) printf "Dauer";;
71     RRULE) printf "Regelmäßigkeit";;
72     DAILY) printf "Tage";;
73     WEEKLY) printf "Wochen";;
74     MONTHLY) printf "Monate";;
75     YEARLY) printf "Jahre";;
76     sDAILY) printf "Täglich";;
77     sWEEKLY) printf "Wöchentlich";;
78     sMONTHLY) printf "Monatlich";;
79     sYEARLY) printf "Jährlich";;
80
81     # UI labels
82     year) printf %s "Jahr";;
83     month) printf %s "Monat";;
84     day) printf %s "Tag";;
85     edit) printf %s "Bearbeiten";;
86     edit_categories) printf %s "Kategorien Bearbeiten";;
87     vcf_export) printf %s "Vcard Exportieren";;
88     control) printf %s "Aktionen";;
89     delete) printf %s "entfernen";;
90     edit_update) printf %s "Daten übernehmen";;
91     edit_cancel) printf %s "Abbrechen";;
92     edit_delete) printf %s "Eintrag löschen";;
93     edit_addfieldtext) printf %s "Neues Feld";;
94     edit_addfield) printf %s "+";;
95     edit_deletefield) printf %s "X";;
96
97     filter_label) printf %s "Filter";;
98     filter_item) printf %s "Eingrenzung nach";;
99     filter_placeholder) printf %s "Begriffe zur Eingrenzung eingeben";;
100     filter_type) printf %s "Filter&shy;typ";;
101     filter_order) printf %s "Sortie&shy;rung";;
102     filter_any) printf %s "Alles";;
103     filter_name) printf %s "Name";;
104     filter_firstname) printf %s "Vor&shy;name";;
105     filter_lastname) printf %s "Nach&shy;name";;
106     filter_street) printf %s "Straße";;
107     filter_zip) printf %s "PLZ.";;
108     filter_TEL) printf %s "Tele&shy;fon";;
109     filter_BDAY) printf %s "Geburts&shy;jahr";;
110     filter_bdate) printf %s "Geburts&shy;datum";;
111     filter_course) printf %s "Kurs";;
112     filter_CATEGORIES) printf %s "Kate&shy;go&shy;rien";;
113     filter_more) printf %s "+ mehr Filter";;
114     filter_apply) printf %s "Filtern";;
115     filter_cancel) printf %s "Filter löschen";;
116     export_csv) printf %s "Liste als CSV-Datei";;
117
118     # UI Labels Special
119     course_attendance) printf %s "Kurs&shy;teil&shy;nahme";;
120     vcf_seed_label) printf "Anmeld.     Vorn.   Nachn.  Geb.Tag Geb.Monat       Geb.Jahr        Tel.    Mobil   ()      EMail   ()      Notiz";;
121     '(unnamed course)') printf '(Unbe\302\255nannter Kurs)';;
122   
123     gender_none) printf %s "keine Angabe";;
124     gender_female) printf %s "Weiblich";;
125     gender_male) printf %s "Männlich";;
126     gender_other) printf %s "Sonstiges";;
127   
128     female) printf %s "&#x2640;";;
129     male) printf %s "&#x2642;";;
130     other) printf %s "&#x26A5;";;
131     none) printf %s "&#x26AA;";;
132
133     # Fallback
134     *) printf %s "$word";;
135   esac
136 }
137
138 l10n_time() {
139   [ $# -eq 0 ] && read -r time || time="$*"
140   printf '%s\n' "$time" |sed -E '
141     s;Monday;Mon\&shy\;tag;g;           s;Mon\.;Mo.;g;
142     s;Tuesday;Diens\&shy\;tag;g;        s;Tue\.;Di.;g;
143     s;Wednesday;Mitt\&shy\;woch;g;      s;Wed\.;Mi.;g;
144     s;Thursday;Don\&shy\;ners\&shy\;tag;g; s;Thu\.;Do.;g;
145     s;Friday;Frei\&shy\;tag;g;          s;Fri\.;Fr.;g;
146     s;Saturday;Sams\&shy\;tag;g;        s;Sat\.;Sa.;g;
147     s;Sunday;Sonn\&shy\;tag;g;          s;Sun\.;So.;g;
148
149     s;January;Ja\&shy\;nu\&shy\;ar;g;           s;Jan\.;Jan.;g;
150     s;February;Fe\&shy\;bru\&shy\;ar;g;         s;Feb\.;Feb.;g;
151     s;March;März;g;                            s;Mar\.;Mär.;g;
152     s;April;April;g;                            s;Apr\.;Apr.;g;
153     s;May;Mai;g;                                s;May\.;Mai.;g;
154     s;June;Juni;g;                              s;Jun\.;Jun.;g;
155     s;July;Juli;g;                              s;Jul\.;Jul.;g;
156     s;August;Au\&shy\;gust;g;                   s;Aug\.;Aug.;g;
157     s;September;Sep\&shy\;tem\&shy\;ber;g;      s;Sep\.;Sep.;g;
158     s;October;Ok\&shy\;to\&shy\;ber;g;          s;Oct\.;Okt.;g;
159     s;November;No\&shy\;vem\&shy\;ber;g;        s;Nov\.;Nov.;g;
160     s;December;De\&shy\;zem\&shy\;ber;g;        s;Dec\.;Dez.;g;
161   '
162 }
163
164 parse_date() {
165   [ $# -eq 0 ] && read -r date || date="$*"
166
167   case $date in
168     *[0-9].*[0-9].*[0-9])
169       d="${date%%.*}"
170       y="${date##*.}"
171       m="${date%.*}"
172       m="${m#*.}"
173       [ $y -lt 100 ] && y="$((y + 2000))"
174       date -d "$(printf '%04i-%02i-%02i' "$y" "$m" "$d")" +%F
175       ;;
176     *) date -d "$date" +%F
177       ;;
178   esac
179 }