]> git.plutz.net Git - confetti/commitdiff
global translation lists
authorPaul Hänsch <paul@plutz.net>
Fri, 22 Jan 2021 17:16:39 +0000 (18:16 +0100)
committerPaul Hänsch <paul@plutz.net>
Fri, 22 Jan 2021 17:16:39 +0000 (18:16 +0100)
cards/l10n.sh
courses/l10n.sh
index.cgi
l10n.sh [new file with mode: 0755]

index 9c17957bcdce976a6448d363eb100287705a7183..2d9dc06362d250a5719f378aa0e9ef8a61867bee 100755 (executable)
@@ -19,61 +19,8 @@ l10n(){
   local word
   [ $# -eq 0 ] && read -r word || word="$*"
   case $word in
-    PHOTO) printf %s "Foto";;
-    LOGO) printf %s "Logo";;
-    FN) printf %s "Voller Name";;
-    N) printf %s "Name";;
-    n_pre) printf %s "Titel";;
-    n_first) printf %s "Vorname";;
-    n_middle) printf %s "Mittel&shy;namen";;
-    n_last) printf %s "Nachname";;
-    n_post) printf %s "Zusätze";;
-    NICKNAME) printf %s "Spitz&shy;name";;
-    SOUND) printf %s "Aus&shy;sprache";;
-    GENDER) printf %s "Ge&shy;schlecht";;
-    KIND) printf %s "Typ";;
-    TITLE) printf %s "Beruf";;
-    ROLE) printf %s "Position";;
-    ORG) printf %s "Orga&shy;ni&shy;sation";;
-    MEMBER) printf %s "Mitglied";;
-    CATEGORIES) printf %s "Kategorien";;
-    ANNIVERSARY) printf %s "Jubiläum";;
-    BDAY) printf %s "Geburtstag";;
-    EMAIL) printf %s "E-Mail";;
-    TEL) printf %s "Telefon";;
-    teltype) printf %s "Anschluss&shy;typ:";;
-    TYPE=HOME) printf %s "Privat";;
-    TYPE=WORK) printf %s "Geschäft&shy;lich";;
-    TYPE=CELL) printf %s "Mobil";;
-    TYPE=FAX) printf %s "Fax";;
-    IMPP) printf %s "Chat";;
-    ADR) printf %s "Anschrift";;
-    URL) printf %s "Webseite";;
-    LANG) printf %s "Sprache";;
-    NOTE) printf %s "Notiz";;
-  
-    RELATED) printf %s "Kontakte";;
-  
-    BEGIN) printf %s "";;
-    CALADRURI) printf %s "";;
-    CALURI) printf %s "";;
-    CLASS) printf %s "";;
-    CLIENTPIDMAP) printf %s "";;
-    END) printf %s "";;
-    FBURL) printf %s "";;
-    GEO) printf %s "";;
-    MAILER) printf %s "";;
-    NAME) printf %s "";;
-    PRODID) printf %s "";;
-    PROFILE) printf %s "";;
-    REV) printf %s "";;
-    SORT-STRING) printf %s "";;
-    SOURCE) printf %s "";;
-    TZ) printf %s "";;
-    UID) printf %s "";;
-    VERSION) printf %s "";;
-    XML) printf %s "";;
-  
+    newcard) printf %s "Neuen Eintrag anlegen";;
+
     X-HEALTH-INSURANCE) printf %s "Kran&shy;ken&shy;ver&shy;sich&shy;er&shy;ung";;
     hi_from_list) printf %s "Aus Liste";;
     hi_other) printf %s "Andere";;
@@ -90,77 +37,27 @@ l10n(){
     X-ZACK-LEAVEDATE) printf %s "Abmelde&shy;datum";;
     X-ZACK-JOINDATE_short)  printf %s "Anm.";;
     X-ZACK-LEAVEDATE_short) printf %s "Abm.";;
-  
-    edit) printf %s "Bearbeiten";;
-    edit_categories) printf %s "Kategorien Bearbeiten";;
-    vcf_export) printf %s "Vcard Exportieren";;
-    control) printf %s "Aktionen";;
-    delete) printf %s "entfernen";;
-    edit_update) printf %s "Daten übernehmen";;
-    edit_cancel) printf %s "Abbrechen";;
-    edit_delete) printf %s "Eintrag löschen";;
-    edit_addfieldtext) printf %s "Neues Feld";;
-    edit_addfield) printf %s "+";;
-    edit_deletefield) printf %s "X";;
-    filter_label) printf %s "Filter";;
-    filter_item) printf %s "Eingrenzung nach";;
-    filter_placeholder) printf %s "Begriffe zur Eingrenzung eingeben";;
-    filter_type) printf %s "Filtertyp";;
-    filter_order) printf %s "Sortierung";;
-    filter_any) printf %s "Alles";;
-    filter_name) printf %s "Name";;
-    filter_firstname) printf %s "Vorname";;
-    filter_lastname) printf %s "Nachname";;
-    filter_street) printf %s "Straße";;
-    filter_zip) printf %s "PLZ.";;
-    filter_TEL) printf %s "Telefon";;
-    filter_BDAY) printf %s "Geburts&shy;jahr";;
-    filter_bdate) printf %s "Geburts&shy;datum";;
-    filter_course) printf %s "Kurs";;
-    filter_CATEGORIES) printf %s "Kategorien";;
-    filter_more) printf %s "+ mehr Filter";;
-    filter_apply) printf %s "Filtern";;
-    filter_cancel) printf %s "Filter löschen";;
-    newcard) printf %s "Neuen Eintrag anlegen";;
-    course_attendance) printf %s "Kurs&shy;teil&shy;nahme";;
-  
-    gender_none) printf %s "keine Angabe";;
-    gender_female) printf %s "Weiblich";;
-    gender_male) printf %s "Männlich";;
-    gender_other) printf %s "Sonstiges";;
-  
-    female) printf %s "&#x2640;";;
-    male) printf %s "&#x2642;";;
-    other) printf %s "&#x26A5;";;
-    none) printf %s "&#x26AA;";;
 
-    *) printf %s "$word";;
+    *) l10n_global "$word";;
   esac
 }
 
-l10n_time() {
-  [ $# -eq 0 ] && read -r time || time="$*"
-  printf '%s\n' "$time" |sed -E '
-    s;Monday;Mon\&shy\;tag;g;          s;Mon\.;Mo.;g;
-    s;Tuesday;Diens\&shy\;tag;g;       s;Tue\.;Di.;g;
-    s;Wednesday;Mitt\&shy\;woch;g;     s;Wed\.;Mi.;g;
-    s;Thursday;Don\&shy\;ners\&shy\;tag;g; s;Thu\.;Do.;g;
-    s;Friday;Frei\&shy\;tag;g;         s;Fri\.;Fr.;g;
-    s;Saturday;Sams\&shy\;tag;g;       s;Sat\.;Sa.;g;
-    s;Sunday;Sonn\&shy\;tag;g;         s;Sun\.;So.;g;
-
-    s;January;Ja\&shy\;nu\&shy\;ar;g;          s;Jan\.;Jan.;g;
-    s;February;Fe\&shy\;bru\&shy\;ar;g;                s;Feb\.;Feb.;g;
-    s;March;März;g;                           s;Mar\.;Mär.;g;
-    s;April;April;g;                           s;Apr\.;Apr.;g;
-    s;May;Mai;g;                               s;May\.;Mai.;g;
-    s;June;Juni;g;                             s;Jun\.;Jun.;g;
-    s;July;Juli;g;                             s;Jul\.;Jul.;g;
-    s;August;Au\&shy\;gust;g;                  s;Aug\.;Aug.;g;
-    s;September;Sep\&shy\;tem\&shy\;ber;g;     s;Sep\.;Sep.;g;
-    s;October;Ok\&shy\;to\&shy\;ber;g;         s;Oct\.;Okt.;g;
-    s;November;No\&shy\;vem\&shy\;ber;g;       s;Nov\.;Nov.;g;
-    s;December;De\&shy\;zem\&shy\;ber;g;       s;Dec\.;Dez.;g;
-  '
-}
-
+# BEGIN) printf %s "";;
+# CALADRURI) printf %s "";;
+# CALURI) printf %s "";;
+# CLASS) printf %s "";;
+# CLIENTPIDMAP) printf %s "";;
+# END) printf %s "";;
+# FBURL) printf %s "";;
+# GEO) printf %s "";;
+# MAILER) printf %s "";;
+# NAME) printf %s "";;
+# PRODID) printf %s "";;
+# PROFILE) printf %s "";;
+# REV) printf %s "";;
+# SORT-STRING) printf %s "";;
+# SOURCE) printf %s "";;
+# TZ) printf %s "";;
+# UID) printf %s "";;
+# VERSION) printf %s "";;
+# XML) printf %s "";;
index c40a5b190252376c8beab76140a43f2a83e8ec78..f98529f1c5adfdabd51205e00b75040e0a927087 100755 (executable)
@@ -20,35 +20,14 @@ l10n(){
   [ $# -eq 0 ] && read -r word || word="$*"
 
   case $word in
-    SUMMARY) printf "Bezeichnung";;
-    COMMENT) printf "Kommentar";;
-    DTSTART) printf "Beginn";;
-    DURATION) printf "Dauer";;
-    RRULE) printf "Regelmäßigkeit";;
-    
-    DAILY) printf "Tage";;
-    WEEKLY) printf "Wochen";;
-    MONTHLY) printf "Monate";;
-    YEARLY) printf "Jahre";;
-    
-    sDAILY) printf "Täglich";;
-    sWEEKLY) printf "Wöchentlich";;
-    sMONTHLY) printf "Monatlich";;
-    sYEARLY) printf "Jährlich";;
-    
-    newcourse) printf "Neuen Eintrag anlegen";;
+    newcourse) printf "Neuen Kurs anlegen";;
     time) printf "Uhrzeit";;
-    edit_update) printf "Daten übernehmen";;
-    edit_cancel) printf "Abbrechen";;
-    edit_delete) printf "Eintrag löschen";;
-    edit_addfieldtext) printf "Neues Feld";;
-    edit_addfield) printf "+";;
+
     edit_dtscal) printf "&#x2713;";;
     edit) printf "Bearbeiten";;
     ics_export) printf "ICal exportieren";;
     courselist) printf "Kursliste (PDF)";;
     
-    course_attendance) printf "Teilnahme";;
     course_mail) printf "Mail an Teilnehmende";;
     
     sort_order) printf "Sortierung";;
@@ -66,6 +45,6 @@ l10n(){
     "January February March April May June July August September October November December")
       printf "Januar Februar März April Mai Juni Juli August September Oktober November Dezember";;
 
-    *) printf %s "$word";;
+    *) l10n_global "$word";;
   esac
 }
index 7dfe9fd9353b2524f30beff93abe8ddad68e78cb..07edbf2bb25244cc15c1aac9f4e9b7653ae1c47c 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -23,6 +23,8 @@ debug() {
 . "$_EXEC/cgilite/cgilite.sh"
 . "$_EXEC/cgilite/session.sh"
 
+. "$_EXEC/l10n.sh"
+
 _PATH="$(PATH "/${PATH_INFO}")"
 ACTION="$(GET a)"
 
diff --git a/l10n.sh b/l10n.sh
new file mode 100755 (executable)
index 0000000..882087c
--- /dev/null
+++ b/l10n.sh
@@ -0,0 +1,155 @@
+# Copyright 2014, 2016, 2019, 2021 Paul Hänsch
+#
+# This file is part of Confetti.
+# 
+# Confetti is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# Confetti 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 Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with Confetti.  If not, see <http://www.gnu.org/licenses/>. 
+
+l10n(){
+  local word
+  [ $# -eq 0 ] && read -r word || word="$*"
+  l10n_global "$word"
+}
+
+l10n_global() {
+  case $1 in
+    # Nav Menu
+    cards) printf %s "Teil&shy;neh&shy;mende";;
+    courses) printf %s "Kurse";;
+
+    # VCF Default
+    PHOTO) printf %s "Foto";;
+    LOGO) printf %s "Logo";;
+    FN) printf %s "Voller Name";;
+    N) printf %s "Name";;
+    n_pre) printf %s "Titel";;
+    n_first) printf %s "Vorname";;
+    n_middle) printf %s "Mittel&shy;namen";;
+    n_last) printf %s "Nachname";;
+    n_post) printf %s "Zusätze";;
+    NICKNAME) printf %s "Spitz&shy;name";;
+    SOUND) printf %s "Aus&shy;sprache";;
+    GENDER) printf %s "Ge&shy;schlecht";;
+    KIND) printf %s "Typ";;
+    TITLE) printf %s "Beruf";;
+    ROLE) printf %s "Position";;
+    ORG) printf %s "Orga&shy;ni&shy;sation";;
+    MEMBER) printf %s "Mitglied";;
+    CATEGORIES) printf %s "Kategorien";;
+    ANNIVERSARY) printf %s "Jubiläum";;
+    BDAY) printf %s "Geburtstag";;
+    EMAIL) printf %s "E-Mail";;
+    TEL) printf %s "Telefon";;
+    teltype) printf %s "Anschluss&shy;typ:";;
+    TYPE=HOME) printf %s "Privat";;
+    TYPE=WORK) printf %s "Geschäft&shy;lich";;
+    TYPE=CELL) printf %s "Mobil";;
+    TYPE=FAX) printf %s "Fax";;
+    IMPP) printf %s "Chat";;
+    ADR) printf %s "Anschrift";;
+    URL) printf %s "Webseite";;
+    LANG) printf %s "Sprache";;
+    NOTE) printf %s "Notiz";;
+    RELATED) printf %s "Kontakte";;
+
+    # ICS Default
+    SUMMARY) printf "Bezeichnung";;
+    COMMENT) printf "Kommentar";;
+    DTSTART) printf "Beginn";;
+    DURATION) printf "Dauer";;
+    RRULE) printf "Regelmäßigkeit";;
+    DAILY) printf "Tage";;
+    WEEKLY) printf "Wochen";;
+    MONTHLY) printf "Monate";;
+    YEARLY) printf "Jahre";;
+    sDAILY) printf "Täglich";;
+    sWEEKLY) printf "Wöchentlich";;
+    sMONTHLY) printf "Monatlich";;
+    sYEARLY) printf "Jährlich";;
+
+    # UI labels
+    edit) printf %s "Bearbeiten";;
+    edit_categories) printf %s "Kategorien Bearbeiten";;
+    vcf_export) printf %s "Vcard Exportieren";;
+    control) printf %s "Aktionen";;
+    delete) printf %s "entfernen";;
+    edit_update) printf %s "Daten übernehmen";;
+    edit_cancel) printf %s "Abbrechen";;
+    edit_delete) printf %s "Eintrag löschen";;
+    edit_addfieldtext) printf %s "Neues Feld";;
+    edit_addfield) printf %s "+";;
+    edit_deletefield) printf %s "X";;
+
+    filter_label) printf %s "Filter";;
+    filter_item) printf %s "Eingrenzung nach";;
+    filter_placeholder) printf %s "Begriffe zur Eingrenzung eingeben";;
+    filter_type) printf %s "Filtertyp";;
+    filter_order) printf %s "Sortierung";;
+    filter_any) printf %s "Alles";;
+    filter_name) printf %s "Name";;
+    filter_firstname) printf %s "Vorname";;
+    filter_lastname) printf %s "Nachname";;
+    filter_street) printf %s "Straße";;
+    filter_zip) printf %s "PLZ.";;
+    filter_TEL) printf %s "Telefon";;
+    filter_BDAY) printf %s "Geburts&shy;jahr";;
+    filter_bdate) printf %s "Geburts&shy;datum";;
+    filter_course) printf %s "Kurs";;
+    filter_CATEGORIES) printf %s "Kategorien";;
+    filter_more) printf %s "+ mehr Filter";;
+    filter_apply) printf %s "Filtern";;
+    filter_cancel) printf %s "Filter löschen";;
+
+    # UI Labels Special
+    course_attendance) printf %s "Kurs&shy;teil&shy;nahme";;
+  
+    gender_none) printf %s "keine Angabe";;
+    gender_female) printf %s "Weiblich";;
+    gender_male) printf %s "Männlich";;
+    gender_other) printf %s "Sonstiges";;
+  
+    female) printf %s "&#x2640;";;
+    male) printf %s "&#x2642;";;
+    other) printf %s "&#x26A5;";;
+    none) printf %s "&#x26AA;";;
+
+    # Fallback
+    *) printf %s "$word";;
+  esac
+}
+
+l10n_time() {
+  [ $# -eq 0 ] && read -r time || time="$*"
+  printf '%s\n' "$time" |sed -E '
+    s;Monday;Mon\&shy\;tag;g;          s;Mon\.;Mo.;g;
+    s;Tuesday;Diens\&shy\;tag;g;       s;Tue\.;Di.;g;
+    s;Wednesday;Mitt\&shy\;woch;g;     s;Wed\.;Mi.;g;
+    s;Thursday;Don\&shy\;ners\&shy\;tag;g; s;Thu\.;Do.;g;
+    s;Friday;Frei\&shy\;tag;g;         s;Fri\.;Fr.;g;
+    s;Saturday;Sams\&shy\;tag;g;       s;Sat\.;Sa.;g;
+    s;Sunday;Sonn\&shy\;tag;g;         s;Sun\.;So.;g;
+
+    s;January;Ja\&shy\;nu\&shy\;ar;g;          s;Jan\.;Jan.;g;
+    s;February;Fe\&shy\;bru\&shy\;ar;g;                s;Feb\.;Feb.;g;
+    s;March;März;g;                           s;Mar\.;Mär.;g;
+    s;April;April;g;                           s;Apr\.;Apr.;g;
+    s;May;Mai;g;                               s;May\.;Mai.;g;
+    s;June;Juni;g;                             s;Jun\.;Jun.;g;
+    s;July;Juli;g;                             s;Jul\.;Jul.;g;
+    s;August;Au\&shy\;gust;g;                  s;Aug\.;Aug.;g;
+    s;September;Sep\&shy\;tem\&shy\;ber;g;     s;Sep\.;Sep.;g;
+    s;October;Ok\&shy\;to\&shy\;ber;g;         s;Oct\.;Okt.;g;
+    s;November;No\&shy\;vem\&shy\;ber;g;       s;Nov\.;Nov.;g;
+    s;December;De\&shy\;zem\&shy\;ber;g;       s;Dec\.;Dez.;g;
+  '
+}