From afc2d35c32943976861038f124ef446460334382 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Sun, 19 Mar 2017 23:47:40 +0100 Subject: [PATCH 01/10] automatic keymap with option to change --- data/translations/english.trans | 2 ++ lib/util.sh | 36 ++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/data/translations/english.trans b/data/translations/english.trans index 7472a15..b8d7bad 100644 --- a/data/translations/english.trans +++ b/data/translations/english.trans @@ -152,6 +152,8 @@ _MIrrorPacQ="Use edited pacman configuration for installed system? If Yes, the f # Set Keymap (vconsole) _VCKeymapTitle="Set Virtual Console" +_DefKeymap="The default keymap for your selected language is" +_Change="Change" _VCKeymapBody="A virtual console is a shell prompt in a non-graphical environment. Its keymap is independent of a desktop environment / terminal." # Set Xkbmap (environment) diff --git a/lib/util.sh b/lib/util.sh index 52ff2f2..7b4e97a 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -229,46 +229,55 @@ select_language() { case $(cat ${LANGSEL}) in "1") source $DATADIR/translations/danish.trans CURR_LOCALE="da_DK.UTF-8" + KEYMAP="dk" ;; "2") source $DATADIR/translations/dutch.trans CURR_LOCALE="nl_NL.UTF-8" + KEYMAP="nl" ;; "3") source $DATADIR/translations/english.trans CURR_LOCALE="en_US.UTF-8" + KEYMAP="us" ;; "4") source $DATADIR/translations/french.trans CURR_LOCALE="fr_FR.UTF-8" + KEYMAP="fr" ;; "5") source $DATADIR/translations/german.trans CURR_LOCALE="de_DE.UTF-8" + KEYMAP="de" ;; "6") source $DATADIR/translations/hungarian.trans CURR_LOCALE="hu_HU.UTF-8" + KEYMAP="hu" fl="2" ;; "7") source $DATADIR/translations/italian.trans CURR_LOCALE="it_IT.UTF-8" + KEYMAP="it" ;; "8") source $DATADIR/translations/portuguese.trans CURR_LOCALE="pt_PT.UTF-8" + KEYMAP="pt-latin1" ;; "9") source $DATADIR/translations/portuguese_brasil.trans CURR_LOCALE="pt_BR.UTF-8" + KEYMAP="pt-latin1" ;; "10") source $DATADIR/translations/russian.trans CURR_LOCALE="ru_RU.UTF-8" + KEYMAP="ru" fl="u" ;; "11") source $DATADIR/translations/spanish.trans CURR_LOCALE="es_ES.UTF-8" + KEYMAP="es" ;; *) clear && exit 0 ;; esac - if [[ $(cat ${KEYSEL} 2>/dev/null) == "" ]]; then - set_keymap - fi + set_keymap # Generate the chosen locale and set the language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 @@ -282,20 +291,16 @@ select_language() { # virtual console keymap and font set_keymap() { - KEYMAPS="" - for i in $(ls -R /usr/share/kbd/keymaps | grep "map.gz" | sed 's/\.map\.gz//g' | sort); do - KEYMAPS="${KEYMAPS} ${i} -" - done - - DIALOG " $_VCKeymapTitle " --menu "\n$_VCKeymapBody\n " 20 40 20 ${KEYMAPS} 2>${KEYSEL} || return 0 - KEYMAP=$(cat ${KEYSEL}) + DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap ${KEYMAP}.\n$_Change ?\n " 0 0 && select_keymap loadkeys $KEYMAP 2>$ERR check_for_error "loadkeys $KEYMAP" "$?" ini linux.keymap "$KEYMAP" + # set keymap for openrc too echo "keymap=\"$KEYMAP\"" > /tmp/keymap biggest_resolution=$(head -n 1 /sys/class/drm/card*/*/modes | awk -F'[^0-9]*' '{print $1}' | awk 'BEGIN{a= 0}{if ($1>a) a=$1 fi} END{print a}') + # Choose terminus font size depending on resolution if [[ $biggest_resolution -gt 1920 ]]; then fs="24" @@ -304,6 +309,7 @@ set_keymap() { else fs="16" fi + FONT="ter-${fl}${fs}n" ini linux.font "$FONT" echo -e "KEYMAP=${KEYMAP}\nFONT=${FONT}" > /tmp/vconsole.conf @@ -314,6 +320,16 @@ set_keymap() { ini system.font "$FONT" } +select_keymap() { + KEYMAPS="" + for i in $(ls -R /usr/share/kbd/keymaps | grep "map.gz" | sed 's/\.map\.gz//g' | sort); do + KEYMAPS="${KEYMAPS} ${i} -" + done + + DIALOG " $_VCKeymapTitle " --menu "\n$_VCKeymapBody\n " 20 40 20 ${KEYMAPS} 2>${ANSWER} || return 0 + KEYMAP=$(cat ${ANSWER}) +} + mk_connection() { if [[ ! $(ping -c 2 google.com) ]]; then DIALOG " $_NoCon " --yesno "\n$_EstCon\n " 0 0 && $NW_CMD && return 0 || clear && exit 0 From 788796ecdd7d40151e924c73d51134e420253c48 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Mar 2017 00:10:13 +0100 Subject: [PATCH 02/10] select keymap only once --- lib/util.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index 7b4e97a..93c687f 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -277,7 +277,7 @@ select_language() { ;; esac - set_keymap + [[ ! -e $KEYSEL ]] && set_keymap # Generate the chosen locale and set the language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 @@ -291,7 +291,7 @@ select_language() { # virtual console keymap and font set_keymap() { - DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap ${KEYMAP}.\n$_Change ?\n " 0 0 && select_keymap + DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n${_Change}?\n " 0 0 && select_keymap || touch $KEYSEL loadkeys $KEYMAP 2>$ERR check_for_error "loadkeys $KEYMAP" "$?" @@ -328,6 +328,7 @@ select_keymap() { DIALOG " $_VCKeymapTitle " --menu "\n$_VCKeymapBody\n " 20 40 20 ${KEYMAPS} 2>${ANSWER} || return 0 KEYMAP=$(cat ${ANSWER}) + touch $KEYSEL } mk_connection() { From 5b090c47e8028b66c119dec5d82d69517696a0f2 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Mar 2017 11:06:20 +0100 Subject: [PATCH 03/10] language strings --- data/translations/danish.trans | 2 ++ data/translations/dutch.trans | 2 ++ data/translations/french.trans | 2 ++ data/translations/german.trans | 2 ++ data/translations/hungarian.trans | 2 ++ data/translations/italian.trans | 2 ++ data/translations/portuguese.trans | 2 ++ data/translations/portuguese_brasil.trans | 2 ++ data/translations/russian.trans | 2 ++ data/translations/spanish.trans | 2 ++ lib/util.sh | 2 +- 11 files changed, 21 insertions(+), 1 deletion(-) diff --git a/data/translations/danish.trans b/data/translations/danish.trans index 411a808..8fc9fdc 100644 --- a/data/translations/danish.trans +++ b/data/translations/danish.trans @@ -154,6 +154,8 @@ _MIrrorPacQ="Brug denne opsætning til det færdige system? Hvis ja, vil filen b # Set Keymap (vconsole) _VCKeymapTitle="Vælg Terminal Tastatur Layout" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="En Terminal er en kommando prompt i et ikke-grafisk miljø. Tastatur layout er uafhængigt af Skrivebord" # Set Xkbmap (environment) diff --git a/data/translations/dutch.trans b/data/translations/dutch.trans index e984d66..d4d5e95 100644 --- a/data/translations/dutch.trans +++ b/data/translations/dutch.trans @@ -153,6 +153,8 @@ _MIrrorPacQ="Wil je het aangepast pacman configuratiebestand gebruiken voor het # Stel het toetsenbord in (vconsole) _VCKeymapTitle="Stel de Virtuele Console in" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Een virtuele console is een shell prompt in een niet-grafische omgeving. De toetsenbordindeling ervan is onafhankelijk van een desktop suite / terminal." # stel Xkbmap in (omgeving) diff --git a/data/translations/french.trans b/data/translations/french.trans index 1e6897a..cec8935 100644 --- a/data/translations/french.trans +++ b/data/translations/french.trans @@ -154,6 +154,8 @@ _MIrrorPacQ="Utiliser la configuration modifiée de pacman pour le système inst # Configurer l'agencement du clavier (vconsole) _VCKeymapTitle="Configurer la console virtuelle" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Une console virtuelle est une invite de commande (shell prompt) dans un environnement non graphique. Son agencement clavier est indépendant du terminal / environnement de bureau." # Configurer Xkbmap (environnement) diff --git a/data/translations/german.trans b/data/translations/german.trans index c8beb09..6579839 100644 --- a/data/translations/german.trans +++ b/data/translations/german.trans @@ -152,6 +152,8 @@ _MIrrorPacQ="Die editierte Pacman-Konfiguration für das installierte System nut # Set Keymap (vconsole) _VCKeymapTitle="Konsolensprache einstellen" +_DefKeymap="Die automatisch ausgewählte Tastaturbelegung für Kommandozeilen-Interface ist" +_Change="Ändern" _VCKeymapBody="Eine virtuelle Konsole ist das Kommandozeilen-Interface einer nicht-graphischen Umgebung.\nIhr Tastaturlayout ist unabhängig von der Desktop-Umgebung." # Set Xkbmap (environment) diff --git a/data/translations/hungarian.trans b/data/translations/hungarian.trans index 3988d29..30befc3 100644 --- a/data/translations/hungarian.trans +++ b/data/translations/hungarian.trans @@ -151,6 +151,8 @@ _MirrorPacQ="Használni akarod a szerkesztett 'pacman' konfigurációt a telepí # Virtuális konzol billentyűzetkiosztásának beállítása \(vconsole\) _VCKeymapTitle="Virtuális konzol beállítása" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="A virtuális konzol egy nem grafikus környezetben futó 'shell prompt'. A billentyűzetkiosztása független az asztali környezettől." # Asztali környezet billentyűzetkioszásának beállítása \(Xkbmap\) diff --git a/data/translations/italian.trans b/data/translations/italian.trans index 5fb548d..65b206b 100644 --- a/data/translations/italian.trans +++ b/data/translations/italian.trans @@ -153,6 +153,8 @@ _MIrrorPacQ="Usare la configurazione pacman modificata per il sistema installato # Impostazione tastiera (vconsole) _VCKeymapTitle="Imposta Virtual Console" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Una virtual console è un prompt di comando in un ambiente non-grafico. La sua mappatura tastiera è indipendente da quella per l'ambiente desktop / terminale." # Impostazione Xkbmap (ambiente desktop) diff --git a/data/translations/portuguese.trans b/data/translations/portuguese.trans index f685e50..ffa4fa0 100644 --- a/data/translations/portuguese.trans +++ b/data/translations/portuguese.trans @@ -152,6 +152,8 @@ _MIrrorPacQ="Utilizar o arquivo de configuração editado do pacman para o siste # Definir Layout de teclado (vconsole) _VCKeymapTitle="Definir Console Virtual" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Um console virtual é um prompt do shell em um ambiente não-gráfico. Seu layout de teclado é independente de um ambiente de desktop / terminal." # Definir Xkbmap (ambiente) diff --git a/data/translations/portuguese_brasil.trans b/data/translations/portuguese_brasil.trans index acca27c..0f062f4 100644 --- a/data/translations/portuguese_brasil.trans +++ b/data/translations/portuguese_brasil.trans @@ -153,6 +153,8 @@ _MIrrorPacQ="Utilizar o arquivo de configuração editado do pacman para o siste # Definir layout de teclado (vconsole) _VCKeymapTitle="Definir console virtual" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Um console virtual é um prompt do shell em um ambiente não-gráfico. Seu layout de teclado é independente de um ambiente de desktop / terminal." # Definir Xkbmap (ambiente) diff --git a/data/translations/russian.trans b/data/translations/russian.trans index 40fa22f..83f6fc3 100644 --- a/data/translations/russian.trans +++ b/data/translations/russian.trans @@ -153,6 +153,8 @@ _MIrrorPacQ="Использовать отредактированный кон # Set Keymap (vconsole) _VCKeymapTitle="Настройка виртуальной консоли" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Виртуальная консоль представляет собой оболочку командной строки в неграфической среде. Ее раскладка не зависит от среды рабочего стола / терминала." # Set Xkbmap (environment) diff --git a/data/translations/spanish.trans b/data/translations/spanish.trans index a50dda8..fa3e5f9 100644 --- a/data/translations/spanish.trans +++ b/data/translations/spanish.trans @@ -153,6 +153,8 @@ _MIrrorPacQ="¿Utilizar el archivo de configuración de 'pacman' editado para el # Seleccionar distribución de teclado de la consola virtual (vconsole) _VCKeymapTitle="Seleccionar distribución de teclado de la consola virtual" +_DefKeymap="The default keymap for your selected language is" # translate me ! +_Change="Change" # translate me ! _VCKeymapBody="Una consola virtual es un intérprete de comandos en un entorno no gráfico. Su distribución de teclado es independiente de un entorno de escritorio o terminal." # Seleccionar Xkbmap (entorno) diff --git a/lib/util.sh b/lib/util.sh index 93c687f..7a48297 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -277,7 +277,7 @@ select_language() { ;; esac - [[ ! -e $KEYSEL ]] && set_keymap + [[ ! -e ${KEYSEL} ]] && set_keymap # Generate the chosen locale and set the language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 From 78e07ff9d00810fa5400b6af32b8e111e005815c Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Mar 2017 11:21:10 +0100 Subject: [PATCH 04/10] use ini to test for keymap already defined --- lib/util.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index 7a48297..643c743 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -14,14 +14,13 @@ VERSION="Manjaro Architect Installer v$version" # Host system information -ARCHI=$(uname -m) # Display whether 32 or 64 bit system +ARCHI=$(uname -m) # Display whether 32 or 64 bit system SYSTEM="Unknown" # Display whether system is BIOS or UEFI. Default is "unknown" H_INIT="" # Host init-sys NW_CMD="" # command to launch the available network client # Locale and Language LANGSEL="/tmp/.language" -KEYSEL="/tmp/.keymap" CURR_LOCALE="en_US.UTF-8" # Default Locale FONT="" # Set new font if necessary KEYMAP="us" # Virtual console keymap. Default is "us" @@ -38,7 +37,7 @@ SUB_MENU="" # Submenu to be highlighted PARENT="" # the parent menu # Temporary files to store menu selections and errors -ANSWER="/tmp/.answer" # Basic menu selections +ANSWER="/tmp/.answer" # Basic menu selections PACKAGES="/tmp/.pkgs" # Packages to install MOUNT_OPTS="/tmp/.mnt_opts" # Filesystem Mount options INIT="/tmp/.init" # init systemd|openrc @@ -68,7 +67,7 @@ LV_SIZE_INVALID=0 # Is LVM LV size entered valid? VG_SIZE_TYPE="" # Is VG in Gigabytes or Megabytes? # Mounting -MOUNT="" # Installation: All other mounts branching +MOUNT="" # Installation: All other mounts branching MOUNTPOINT="/mnt" # Installation: Root mount from Root FS_OPTS="" # File system special mount options available CHK_NUM=16 # Used for FS mount options checklist length @@ -106,8 +105,8 @@ DIALOG() { } # store datas in ini file -# read: value=$(ini system.init) -# set: ini system.init "openrc" +# read: value=$(ini system.init) +# set: ini system.init "openrc" ini() { local section="$1" value="$2" [[ ! -f "$INIFILE" ]] && echo "">"$INIFILE" @@ -277,7 +276,7 @@ select_language() { ;; esac - [[ ! -e ${KEYSEL} ]] && set_keymap + [[ ! $(ini linux.keymap) ]] && set_keymap # Generate the chosen locale and set the language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 @@ -291,7 +290,7 @@ select_language() { # virtual console keymap and font set_keymap() { - DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n${_Change}?\n " 0 0 && select_keymap || touch $KEYSEL + DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n${_Change}?\n " 0 0 && select_keymap loadkeys $KEYMAP 2>$ERR check_for_error "loadkeys $KEYMAP" "$?" @@ -328,7 +327,6 @@ select_keymap() { DIALOG " $_VCKeymapTitle " --menu "\n$_VCKeymapBody\n " 20 40 20 ${KEYMAPS} 2>${ANSWER} || return 0 KEYMAP=$(cat ${ANSWER}) - touch $KEYSEL } mk_connection() { From 013d215c32e685fae27da0ef0ab0cd6ee8007023 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Mar 2017 11:26:08 +0100 Subject: [PATCH 05/10] use ini to test if language already set --- lib/util.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index 643c743..6b649fc 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -20,7 +20,6 @@ H_INIT="" # Host init-sys NW_CMD="" # command to launch the available network client # Locale and Language -LANGSEL="/tmp/.language" CURR_LOCALE="en_US.UTF-8" # Default Locale FONT="" # Set new font if necessary KEYMAP="us" # Virtual console keymap. Default is "us" @@ -210,7 +209,7 @@ check_for_error() { # Add locale on-the-fly and sets source translation file for installer select_language() { fl="1" # terminus-font variation supporting most languages, to be processed in set_keymap() - if [[ $(cat ${LANGSEL} 2>/dev/null) == "" ]]; then + if [[ ! $(ini system.lang) ]]; then DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 11 \ "1" $"Danish|(da_DK)" \ "2" $"Dutch|(nl_NL)" \ @@ -222,10 +221,10 @@ select_language() { "8" $"Portuguese|(pt_PT)" \ "9" $"Portuguese [Brasil]|(pt_BR)" \ "10" $"Russian|(ru_RU)" \ - "11" $"Spanish|(es_ES)" 2>${LANGSEL} + "11" $"Spanish|(es_ES)" 2>${ANSWER} fi - case $(cat ${LANGSEL}) in + case $(cat ${ANSWER}) in "1") source $DATADIR/translations/danish.trans CURR_LOCALE="da_DK.UTF-8" KEYMAP="dk" From 43c08b822524e589239ce89bdeefefd0d4d8272e Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Mon, 20 Mar 2017 17:13:23 +0100 Subject: [PATCH 06/10] use grep saved ini file instead --- lib/util.sh | 108 ++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index 6b649fc..e275de6 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -209,7 +209,7 @@ check_for_error() { # Add locale on-the-fly and sets source translation file for installer select_language() { fl="1" # terminus-font variation supporting most languages, to be processed in set_keymap() - if [[ ! $(ini system.lang) ]]; then + if [[ ! $(grep lang /var/log/m-a.ini 2>/dev/null) ]]; then DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 11 \ "1" $"Danish|(da_DK)" \ "2" $"Dutch|(nl_NL)" \ @@ -222,60 +222,62 @@ select_language() { "9" $"Portuguese [Brasil]|(pt_BR)" \ "10" $"Russian|(ru_RU)" \ "11" $"Spanish|(es_ES)" 2>${ANSWER} + + case $(cat ${ANSWER}) in + "1") source $DATADIR/translations/danish.trans + CURR_LOCALE="da_DK.UTF-8" + KEYMAP="dk" + ;; + "2") source $DATADIR/translations/dutch.trans + CURR_LOCALE="nl_NL.UTF-8" + KEYMAP="nl" + ;; + "3") source $DATADIR/translations/english.trans + CURR_LOCALE="en_US.UTF-8" + KEYMAP="us" + ;; + "4") source $DATADIR/translations/french.trans + CURR_LOCALE="fr_FR.UTF-8" + KEYMAP="fr" + ;; + "5") source $DATADIR/translations/german.trans + CURR_LOCALE="de_DE.UTF-8" + KEYMAP="de" + ;; + "6") source $DATADIR/translations/hungarian.trans + CURR_LOCALE="hu_HU.UTF-8" + KEYMAP="hu" + fl="2" + ;; + "7") source $DATADIR/translations/italian.trans + CURR_LOCALE="it_IT.UTF-8" + KEYMAP="it" + ;; + "8") source $DATADIR/translations/portuguese.trans + CURR_LOCALE="pt_PT.UTF-8" + KEYMAP="pt-latin1" + ;; + "9") source $DATADIR/translations/portuguese_brasil.trans + CURR_LOCALE="pt_BR.UTF-8" + KEYMAP="pt-latin1" + ;; + "10") source $DATADIR/translations/russian.trans + CURR_LOCALE="ru_RU.UTF-8" + KEYMAP="ru" + fl="u" + ;; + "11") source $DATADIR/translations/spanish.trans + CURR_LOCALE="es_ES.UTF-8" + KEYMAP="es" + ;; + *) clear && exit 0 + ;; + esac + else + CURR_LOCALE="$(grep lang /var/log/m-a.ini | cut -d' ' -f3)" fi - case $(cat ${ANSWER}) in - "1") source $DATADIR/translations/danish.trans - CURR_LOCALE="da_DK.UTF-8" - KEYMAP="dk" - ;; - "2") source $DATADIR/translations/dutch.trans - CURR_LOCALE="nl_NL.UTF-8" - KEYMAP="nl" - ;; - "3") source $DATADIR/translations/english.trans - CURR_LOCALE="en_US.UTF-8" - KEYMAP="us" - ;; - "4") source $DATADIR/translations/french.trans - CURR_LOCALE="fr_FR.UTF-8" - KEYMAP="fr" - ;; - "5") source $DATADIR/translations/german.trans - CURR_LOCALE="de_DE.UTF-8" - KEYMAP="de" - ;; - "6") source $DATADIR/translations/hungarian.trans - CURR_LOCALE="hu_HU.UTF-8" - KEYMAP="hu" - fl="2" - ;; - "7") source $DATADIR/translations/italian.trans - CURR_LOCALE="it_IT.UTF-8" - KEYMAP="it" - ;; - "8") source $DATADIR/translations/portuguese.trans - CURR_LOCALE="pt_PT.UTF-8" - KEYMAP="pt-latin1" - ;; - "9") source $DATADIR/translations/portuguese_brasil.trans - CURR_LOCALE="pt_BR.UTF-8" - KEYMAP="pt-latin1" - ;; - "10") source $DATADIR/translations/russian.trans - CURR_LOCALE="ru_RU.UTF-8" - KEYMAP="ru" - fl="u" - ;; - "11") source $DATADIR/translations/spanish.trans - CURR_LOCALE="es_ES.UTF-8" - KEYMAP="es" - ;; - *) clear && exit 0 - ;; - esac - - [[ ! $(ini linux.keymap) ]] && set_keymap + [[ $(grep keymap /var/log/m-a.ini 2>/dev/null) ]] && KEYMAP="$(grep keymap /var/log/m-a.ini | cut -d' ' -f3)" || set_keymap # Generate the chosen locale and set the language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 From 12205d10be58a08755d29805277fab2cabef9b04 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 21 Mar 2017 12:57:56 +0100 Subject: [PATCH 07/10] re-organize lang/keymap/font settings --- bin/manjaro-architect.in | 2 +- lib/util.sh | 179 +++++++++++++++++++++------------------ 2 files changed, 96 insertions(+), 85 deletions(-) diff --git a/bin/manjaro-architect.in b/bin/manjaro-architect.in index bf2db3a..ca985ed 100644 --- a/bin/manjaro-architect.in +++ b/bin/manjaro-architect.in @@ -34,7 +34,7 @@ fi [[ $1 == "-d" ]] && declare -i debug=1 id_system -select_language +set_language mk_connection check_requirements greeting diff --git a/lib/util.sh b/lib/util.sh index e275de6..589a4b9 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -206,80 +206,21 @@ check_for_error() { fi } -# Add locale on-the-fly and sets source translation file for installer -select_language() { - fl="1" # terminus-font variation supporting most languages, to be processed in set_keymap() - if [[ ! $(grep lang /var/log/m-a.ini 2>/dev/null) ]]; then - DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 11 \ - "1" $"Danish|(da_DK)" \ - "2" $"Dutch|(nl_NL)" \ - "3" $"English|(en_**)" \ - "4" $"French|(fr_FR)" \ - "5" $"German|(de_DE)" \ - "6" $"Hungarian|(hu_HU)" \ - "7" $"Italian|(it_IT)" \ - "8" $"Portuguese|(pt_PT)" \ - "9" $"Portuguese [Brasil]|(pt_BR)" \ - "10" $"Russian|(ru_RU)" \ - "11" $"Spanish|(es_ES)" 2>${ANSWER} - - case $(cat ${ANSWER}) in - "1") source $DATADIR/translations/danish.trans - CURR_LOCALE="da_DK.UTF-8" - KEYMAP="dk" - ;; - "2") source $DATADIR/translations/dutch.trans - CURR_LOCALE="nl_NL.UTF-8" - KEYMAP="nl" - ;; - "3") source $DATADIR/translations/english.trans - CURR_LOCALE="en_US.UTF-8" - KEYMAP="us" - ;; - "4") source $DATADIR/translations/french.trans - CURR_LOCALE="fr_FR.UTF-8" - KEYMAP="fr" - ;; - "5") source $DATADIR/translations/german.trans - CURR_LOCALE="de_DE.UTF-8" - KEYMAP="de" - ;; - "6") source $DATADIR/translations/hungarian.trans - CURR_LOCALE="hu_HU.UTF-8" - KEYMAP="hu" - fl="2" - ;; - "7") source $DATADIR/translations/italian.trans - CURR_LOCALE="it_IT.UTF-8" - KEYMAP="it" - ;; - "8") source $DATADIR/translations/portuguese.trans - CURR_LOCALE="pt_PT.UTF-8" - KEYMAP="pt-latin1" - ;; - "9") source $DATADIR/translations/portuguese_brasil.trans - CURR_LOCALE="pt_BR.UTF-8" - KEYMAP="pt-latin1" - ;; - "10") source $DATADIR/translations/russian.trans - CURR_LOCALE="ru_RU.UTF-8" - KEYMAP="ru" - fl="u" - ;; - "11") source $DATADIR/translations/spanish.trans - CURR_LOCALE="es_ES.UTF-8" - KEYMAP="es" - ;; - *) clear && exit 0 - ;; - esac +set_language() { + if [[ ! $(grep font /var/log/m-a.ini 2>/dev/null) ]]; then + select_language else CURR_LOCALE="$(grep lang /var/log/m-a.ini | cut -d' ' -f3)" + KEYMAP="$(grep keymap /var/log/m-a.ini | cut -d' ' -f3)" + FONT="$(grep font /var/log/m-a.ini | cut -d' ' -f3)" + TRANS="$(grep translation /var/log/m-a.ini | cut -d' ' -f3)" + import $DATADIR/translations/$TRANS.trans + + # does user want to change the old settings? + DIALOG " $_SelLang " --yesno "\nLanguage: [ ${TRANS} ]\n Keymap: [ ${KEYMAP} ].\n\n${_Change}?\n " 0 0 && select_language fi - [[ $(grep keymap /var/log/m-a.ini 2>/dev/null) ]] && KEYMAP="$(grep keymap /var/log/m-a.ini | cut -d' ' -f3)" || set_keymap - - # Generate the chosen locale and set the language + # Generate locale and set language DIALOG " $_Config " --infobox "\n$_ApplySet\n " 0 0 sed -i "s/#${CURR_LOCALE}/${CURR_LOCALE}/" /etc/locale.gen locale-gen >/dev/null 2>$ERR @@ -287,21 +228,94 @@ select_language() { check_for_error "set LANG=${CURR_LOCALE}" $? ini system.lang "$CURR_LOCALE" -} - -# virtual console keymap and font -set_keymap() { - DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n${_Change}?\n " 0 0 && select_keymap loadkeys $KEYMAP 2>$ERR check_for_error "loadkeys $KEYMAP" "$?" ini linux.keymap "$KEYMAP" - # set keymap for openrc too - echo "keymap=\"$KEYMAP\"" > /tmp/keymap - biggest_resolution=$(head -n 1 /sys/class/drm/card*/*/modes | awk -F'[^0-9]*' '{print $1}' | awk 'BEGIN{a= 0}{if ($1>a) a=$1 fi} END{print a}') + setfont $FONT 2>$ERR + check_for_error "set font $FONT" $? + ini system.font "$FONT" - # Choose terminus font size depending on resolution + # store settings for re-use in target install ## to be accomplished via ini in the future + echo -e "KEYMAP=${KEYMAP}\nFONT=${FONT}" > /tmp/vconsole.conf + echo -e "consolefont=\"${FONT}\"" > /tmp/consolefont + echo -e "keymap=\"$KEYMAP\"" > /tmp/keymap +} + +# set locale, keymap and font and source translation file for installer +select_language() { + fl="1" # terminus-font variation supporting most languages, to be processed in set_keymap() + DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 11 \ + "1" $"Danish|(da_DK)" \ + "2" $"Dutch|(nl_NL)" \ + "3" $"English|(en_**)" \ + "4" $"French|(fr_FR)" \ + "5" $"German|(de_DE)" \ + "6" $"Hungarian|(hu_HU)" \ + "7" $"Italian|(it_IT)" \ + "8" $"Portuguese|(pt_PT)" \ + "9" $"Portuguese [Brasil]|(pt_BR)" \ + "10" $"Russian|(ru_RU)" \ + "11" $"Spanish|(es_ES)" 2>${ANSWER} + + case $(cat ${ANSWER}) in + "1") TRANS="danish" + CURR_LOCALE="da_DK.UTF-8" + KEYMAP="dk" + ;; + "2") TRANS="dutch" + CURR_LOCALE="nl_NL.UTF-8" + KEYMAP="nl" + ;; + "3") TRANS="english" + CURR_LOCALE="en_US.UTF-8" + KEYMAP="us" + ;; + "4") TRANS="french" + CURR_LOCALE="fr_FR.UTF-8" + KEYMAP="fr" + ;; + "5") TRANS="german" + CURR_LOCALE="de_DE.UTF-8" + KEYMAP="de" + ;; + "6") TRANS="hungarian" + CURR_LOCALE="hu_HU.UTF-8" + KEYMAP="hu" + fl="2" + ;; + "7") TRANS="italian" + CURR_LOCALE="it_IT.UTF-8" + KEYMAP="it" + ;; + "8") TRANS="portuguese" + CURR_LOCALE="pt_PT.UTF-8" + KEYMAP="pt-latin1" + ;; + "9") TRANS="portuguese_brasil" + CURR_LOCALE="pt_BR.UTF-8" + KEYMAP="pt-latin1" + ;; + "10") TRANS="russian" + CURR_LOCALE="ru_RU.UTF-8" + KEYMAP="ru" + fl="u" + ;; + "11") TRANS="spanish" + CURR_LOCALE="es_ES.UTF-8" + KEYMAP="es" + ;; + *) clear && exit 0 + ;; + esac + + # source translation file + import $DATADIR/translations/$TRANS.trans + ini translation "$TRANS" + + # adjust terminus font size depending on resolution + biggest_resolution=$(head -n 1 /sys/class/drm/card*/*/modes | awk -F'[^0-9]*' '{print $1}' | awk 'BEGIN{a= 0}{if ($1>a) a=$1 fi} END{print a}') if [[ $biggest_resolution -gt 1920 ]]; then fs="24" elif [[ $biggest_resolution -eq 1920 ]]; then @@ -312,12 +326,9 @@ set_keymap() { FONT="ter-${fl}${fs}n" ini linux.font "$FONT" - echo -e "KEYMAP=${KEYMAP}\nFONT=${FONT}" > /tmp/vconsole.conf - echo -e "consolefont=\"${FONT}\"" > /tmp/consolefont - setfont $FONT 2>$ERR - check_for_error "set font $FONT" $? - ini system.font "$FONT" + # does user want to change the default keymap? + DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n\n${_Change}?\n " 0 0 && select_keymap } select_keymap() { From 3fa4a5c76706443c3e0b436567b6c3f242379204 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 21 Mar 2017 13:28:04 +0100 Subject: [PATCH 08/10] update dialogs --- data/translations/danish.trans | 7 ++++--- data/translations/dutch.trans | 17 +++++++++-------- data/translations/english.trans | 3 ++- data/translations/french.trans | 3 ++- data/translations/german.trans | 3 ++- data/translations/hungarian.trans | 3 ++- data/translations/italian.trans | 17 +++++++++-------- data/translations/portuguese.trans | 17 +++++++++-------- data/translations/portuguese_brasil.trans | 17 +++++++++-------- data/translations/russian.trans | 3 ++- data/translations/spanish.trans | 17 +++++++++-------- lib/util.sh | 6 +++--- 12 files changed, 62 insertions(+), 51 deletions(-) diff --git a/data/translations/danish.trans b/data/translations/danish.trans index 8fc9fdc..74c78cc 100644 --- a/data/translations/danish.trans +++ b/data/translations/danish.trans @@ -22,11 +22,13 @@ _PassErrBody="Adgangskoderne er ikke ens. Prøv igen." # Basics _SelLang="Sprogvalg" _Lang="Sprog" +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! _NoCon="Internet forbindelse er ikke aktiv" _EstCon="Opret forbindelse?" _Config="Opsæt" -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Security and Tweaks @@ -155,7 +157,6 @@ _MIrrorPacQ="Brug denne opsætning til det færdige system? Hvis ja, vil filen b # Set Keymap (vconsole) _VCKeymapTitle="Vælg Terminal Tastatur Layout" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="En Terminal er en kommando prompt i et ikke-grafisk miljø. Tastatur layout er uafhængigt af Skrivebord" # Set Xkbmap (environment) diff --git a/data/translations/dutch.trans b/data/translations/dutch.trans index d4d5e95..239b1ea 100644 --- a/data/translations/dutch.trans +++ b/data/translations/dutch.trans @@ -19,13 +19,15 @@ _ErrTitle="Fout" _PassErrBody="De ingegeven wachtwoorden zijn niet identiek. Probeer opnieuw aub." # Basics -_SelLang="Select Language" # translate me ! -_Lang="Language" # translate me ! -_NoCon="No Internet Detected." # translate me ! -_EstCon="Establish connection?" # translate me ! -_Config="Configure" # translate me ! -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_SelLang="Select Language" # translate me ! +_Lang="Language" # translate me ! +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! +_NoCon="No Internet Detected." # translate me ! +_EstCon="Establish connection?" # translate me ! +_Config="Configure" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Veiligheid en aanpassingen @@ -154,7 +156,6 @@ _MIrrorPacQ="Wil je het aangepast pacman configuratiebestand gebruiken voor het # Stel het toetsenbord in (vconsole) _VCKeymapTitle="Stel de Virtuele Console in" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Een virtuele console is een shell prompt in een niet-grafische omgeving. De toetsenbordindeling ervan is onafhankelijk van een desktop suite / terminal." # stel Xkbmap in (omgeving) diff --git a/data/translations/english.trans b/data/translations/english.trans index b8d7bad..e30f0a6 100644 --- a/data/translations/english.trans +++ b/data/translations/english.trans @@ -21,6 +21,8 @@ _PassErrBody="The passwords entered do not match. Please try again." # Basics _SelLang="Select Language" _Lang="Language" +_Keymap="Keymap" +_Change="Would you like to change the settings?" _NoCon="No Internet Detected." _EstCon="Establish connection?" _Config="Configure" @@ -153,7 +155,6 @@ _MIrrorPacQ="Use edited pacman configuration for installed system? If Yes, the f # Set Keymap (vconsole) _VCKeymapTitle="Set Virtual Console" _DefKeymap="The default keymap for your selected language is" -_Change="Change" _VCKeymapBody="A virtual console is a shell prompt in a non-graphical environment. Its keymap is independent of a desktop environment / terminal." # Set Xkbmap (environment) diff --git a/data/translations/french.trans b/data/translations/french.trans index cec8935..f13400a 100644 --- a/data/translations/french.trans +++ b/data/translations/french.trans @@ -22,6 +22,8 @@ _PassErrBody="Les mots de passe entrés ne correspondent pas. Veuillez réessaye # Basics _SelLang="Choisir la langue" _Lang="Langue" +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! _NoCon="Pas de connexion Internet détectée." _EstCon="Établir la connexion ?" _Config="Configurer" @@ -155,7 +157,6 @@ _MIrrorPacQ="Utiliser la configuration modifiée de pacman pour le système inst # Configurer l'agencement du clavier (vconsole) _VCKeymapTitle="Configurer la console virtuelle" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Une console virtuelle est une invite de commande (shell prompt) dans un environnement non graphique. Son agencement clavier est indépendant du terminal / environnement de bureau." # Configurer Xkbmap (environnement) diff --git a/data/translations/german.trans b/data/translations/german.trans index 6579839..eb95ccc 100644 --- a/data/translations/german.trans +++ b/data/translations/german.trans @@ -20,6 +20,8 @@ _PassErrBody="Die eingegebenen Passwörter sind nicht gleich. Bitte erneut versu # Basics _SelLang="Sprachauswahl" _Lang="Sprache" +_Keymap="Tastaturbelegung" +_Change="Möchten Sie die Einstellungen ändern?" _NoCon="Keine Internetverbindung." _EstCon="Verbindung herstellen?" _Config="Konfiguration" @@ -153,7 +155,6 @@ _MIrrorPacQ="Die editierte Pacman-Konfiguration für das installierte System nut # Set Keymap (vconsole) _VCKeymapTitle="Konsolensprache einstellen" _DefKeymap="Die automatisch ausgewählte Tastaturbelegung für Kommandozeilen-Interface ist" -_Change="Ändern" _VCKeymapBody="Eine virtuelle Konsole ist das Kommandozeilen-Interface einer nicht-graphischen Umgebung.\nIhr Tastaturlayout ist unabhängig von der Desktop-Umgebung." # Set Xkbmap (environment) diff --git a/data/translations/hungarian.trans b/data/translations/hungarian.trans index 30befc3..65fe262 100644 --- a/data/translations/hungarian.trans +++ b/data/translations/hungarian.trans @@ -20,6 +20,8 @@ _PassErrBody="A megadott jelszavak nem egyeznek. Kérlek próbáld újra." # Alap beállítások _SelLang="Válassz nyelvet" _Lang="Nyelv" +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! _NoCon="Nincs internetkapcsolat." _EstCon="Kapcsolódni akarsz az internethez?" _Config="Beállítás" @@ -152,7 +154,6 @@ _MirrorPacQ="Használni akarod a szerkesztett 'pacman' konfigurációt a telepí # Virtuális konzol billentyűzetkiosztásának beállítása \(vconsole\) _VCKeymapTitle="Virtuális konzol beállítása" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="A virtuális konzol egy nem grafikus környezetben futó 'shell prompt'. A billentyűzetkiosztása független az asztali környezettől." # Asztali környezet billentyűzetkioszásának beállítása \(Xkbmap\) diff --git a/data/translations/italian.trans b/data/translations/italian.trans index 65b206b..1633eba 100644 --- a/data/translations/italian.trans +++ b/data/translations/italian.trans @@ -19,13 +19,15 @@ _ErrTitle="Errore" _PassErrBody="Le password digitate non corrispondono. Provare nuovamente." # Basics -_SelLang="Select Language" # translate me ! -_Lang="Language" # translate me ! -_NoCon="No Internet Detected." # translate me ! -_EstCon="Establish connection?" # translate me ! -_Config="Configure" # translate me ! -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_SelLang="Select Language" # translate me ! +_Lang="Language" # translate me ! +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! +_NoCon="No Internet Detected." # translate me ! +_EstCon="Establish connection?" # translate me ! +_Config="Configure" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Security and Tweaks @@ -154,7 +156,6 @@ _MIrrorPacQ="Usare la configurazione pacman modificata per il sistema installato # Impostazione tastiera (vconsole) _VCKeymapTitle="Imposta Virtual Console" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Una virtual console è un prompt di comando in un ambiente non-grafico. La sua mappatura tastiera è indipendente da quella per l'ambiente desktop / terminale." # Impostazione Xkbmap (ambiente desktop) diff --git a/data/translations/portuguese.trans b/data/translations/portuguese.trans index ffa4fa0..83436ce 100644 --- a/data/translations/portuguese.trans +++ b/data/translations/portuguese.trans @@ -19,13 +19,15 @@ _ErrTitle="Erro" _PassErrBody="As senhas digitadas não coincidem. Por favor, tente novamente." # Basics -_SelLang="Select Language" # translate me ! -_Lang="Language" # translate me ! -_NoCon="No Internet Detected." # translate me ! -_EstCon="Establish connection?" # translate me ! -_Config="Configure" # translate me ! -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_SelLang="Select Language" # translate me ! +_Lang="Language" # translate me ! +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! +_NoCon="No Internet Detected." # translate me ! +_EstCon="Establish connection?" # translate me ! +_Config="Configure" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Segurança e Ajustes @@ -153,7 +155,6 @@ _MIrrorPacQ="Utilizar o arquivo de configuração editado do pacman para o siste # Definir Layout de teclado (vconsole) _VCKeymapTitle="Definir Console Virtual" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Um console virtual é um prompt do shell em um ambiente não-gráfico. Seu layout de teclado é independente de um ambiente de desktop / terminal." # Definir Xkbmap (ambiente) diff --git a/data/translations/portuguese_brasil.trans b/data/translations/portuguese_brasil.trans index 0f062f4..108cdc7 100644 --- a/data/translations/portuguese_brasil.trans +++ b/data/translations/portuguese_brasil.trans @@ -19,13 +19,15 @@ _ErrTitle="Erro" _PassErrBody="As senhas digitadas não coincidem. Por favor, tente novamente." # Basics -_SelLang="Select Language" # translate me ! -_Lang="Language" # translate me ! -_NoCon="No Internet Detected." # translate me ! -_EstCon="Establish connection?" # translate me ! -_Config="Configure" # translate me ! -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_SelLang="Select Language" # translate me ! +_Lang="Language" # translate me ! +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! +_NoCon="No Internet Detected." # translate me ! +_EstCon="Establish connection?" # translate me ! +_Config="Configure" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Segurança e Ajustes @@ -154,7 +156,6 @@ _MIrrorPacQ="Utilizar o arquivo de configuração editado do pacman para o siste # Definir layout de teclado (vconsole) _VCKeymapTitle="Definir console virtual" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Um console virtual é um prompt do shell em um ambiente não-gráfico. Seu layout de teclado é independente de um ambiente de desktop / terminal." # Definir Xkbmap (ambiente) diff --git a/data/translations/russian.trans b/data/translations/russian.trans index 83f6fc3..75cb239 100644 --- a/data/translations/russian.trans +++ b/data/translations/russian.trans @@ -21,6 +21,8 @@ _PassErrBody="Введеные пароли не совпадают. Пожал # Basics _SelLang="Выбрать язык" _Lang="Язык" +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! _NoCon="Интернет не найден." _EstCon="Установить соединение?" _Config="Настроить" @@ -154,7 +156,6 @@ _MIrrorPacQ="Использовать отредактированный кон # Set Keymap (vconsole) _VCKeymapTitle="Настройка виртуальной консоли" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Виртуальная консоль представляет собой оболочку командной строки в неграфической среде. Ее раскладка не зависит от среды рабочего стола / терминала." # Set Xkbmap (environment) diff --git a/data/translations/spanish.trans b/data/translations/spanish.trans index fa3e5f9..025526d 100644 --- a/data/translations/spanish.trans +++ b/data/translations/spanish.trans @@ -19,13 +19,15 @@ _ErrTitle="Error" _PassErrBody="Las contraseñas introducidas no coinciden. Vuelva a intentarlo." # Basics -_SelLang="Select Language" # translate me ! -_Lang="Language" # translate me ! -_NoCon="No Internet Detected." # translate me ! -_EstCon="Establish connection?" # translate me ! -_Config="Configure" # translate me ! -_ApplySet="Apply language settings ..." # translate me ! -_ChMenu="Select Menu" # translate me ! +_SelLang="Select Language" # translate me ! +_Lang="Language" # translate me ! +_Keymap="Keymap" # translate me ! +_Change="Would you like to change the settings?" # translate me ! +_NoCon="No Internet Detected." # translate me ! +_EstCon="Establish connection?" # translate me ! +_Config="Configure" # translate me ! +_ApplySet="Apply language settings ..." # translate me ! +_ChMenu="Select Menu" # translate me ! _ChMenuBody="The Regular Menu will guide you through the installation of a pre-configured Manjaro Environment with some additional choices.\n\nThe Advanced Menu can be used to install unconfigured desktops or Manjaro development profiles and also includes an additional selection of network and multimedia applications and some advanced options for system and security configuration." # translate me ! # Seguridad y ajustes @@ -154,7 +156,6 @@ _MIrrorPacQ="¿Utilizar el archivo de configuración de 'pacman' editado para el # Seleccionar distribución de teclado de la consola virtual (vconsole) _VCKeymapTitle="Seleccionar distribución de teclado de la consola virtual" _DefKeymap="The default keymap for your selected language is" # translate me ! -_Change="Change" # translate me ! _VCKeymapBody="Una consola virtual es un intérprete de comandos en un entorno no gráfico. Su distribución de teclado es independiente de un entorno de escritorio o terminal." # Seleccionar Xkbmap (entorno) diff --git a/lib/util.sh b/lib/util.sh index 589a4b9..a45271b 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -217,7 +217,7 @@ set_language() { import $DATADIR/translations/$TRANS.trans # does user want to change the old settings? - DIALOG " $_SelLang " --yesno "\nLanguage: [ ${TRANS} ]\n Keymap: [ ${KEYMAP} ].\n\n${_Change}?\n " 0 0 && select_language + DIALOG " $_SelLang " --yesno "\n${_Lang}: [ ${TRANS^} ]\n$_Keymap: [ ${KEYMAP} ]\n\n${_Change}?\n " 0 0 && select_language fi # Generate locale and set language @@ -235,7 +235,7 @@ set_language() { setfont $FONT 2>$ERR check_for_error "set font $FONT" $? - ini system.font "$FONT" + ini linux.font "$FONT" # store settings for re-use in target install ## to be accomplished via ini in the future echo -e "KEYMAP=${KEYMAP}\nFONT=${FONT}" > /tmp/vconsole.conf @@ -328,7 +328,7 @@ select_language() { ini linux.font "$FONT" # does user want to change the default keymap? - DIALOG " $_VCKeymapTitle " --yesno "\n$_DefKeymap [ ${KEYMAP} ].\n\n${_Change}?\n " 0 0 && select_keymap + DIALOG " $_VCKeymapTitle " --yesno "\n${_DefKeymap}:\n[ ${KEYMAP} ].\n\n${_Change}\n " 0 0 && select_keymap } select_keymap() { From ef38de0e056e27139631c1c52205777799eb75c2 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 21 Mar 2017 13:36:29 +0100 Subject: [PATCH 09/10] little corrections --- lib/util.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util.sh b/lib/util.sh index a45271b..eaf638c 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -215,9 +215,10 @@ set_language() { FONT="$(grep font /var/log/m-a.ini | cut -d' ' -f3)" TRANS="$(grep translation /var/log/m-a.ini | cut -d' ' -f3)" import $DATADIR/translations/$TRANS.trans + ini translation "$TRANS" # does user want to change the old settings? - DIALOG " $_SelLang " --yesno "\n${_Lang}: [ ${TRANS^} ]\n$_Keymap: [ ${KEYMAP} ]\n\n${_Change}?\n " 0 0 && select_language + DIALOG " $_SelLang " --yesno "\n${_Lang}: [ ${TRANS^} ]\n$_Keymap: [ ${KEYMAP} ]\n\n${_Change}\n " 0 0 && select_language fi # Generate locale and set language @@ -225,7 +226,6 @@ set_language() { sed -i "s/#${CURR_LOCALE}/${CURR_LOCALE}/" /etc/locale.gen locale-gen >/dev/null 2>$ERR export LANG=${CURR_LOCALE} - check_for_error "set LANG=${CURR_LOCALE}" $? ini system.lang "$CURR_LOCALE" @@ -245,7 +245,7 @@ set_language() { # set locale, keymap and font and source translation file for installer select_language() { - fl="1" # terminus-font variation supporting most languages, to be processed in set_keymap() + fl="1" # terminus-font variation supporting most languages DIALOG " Select Language " --default-item '3' --menu "\n " 0 0 11 \ "1" $"Danish|(da_DK)" \ "2" $"Dutch|(nl_NL)" \ From 4af00c825df1befb55c4b4fff1f7bb8eba1937ba Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 21 Mar 2017 13:43:05 +0100 Subject: [PATCH 10/10] correction German and dialog formatting --- data/translations/german.trans | 2 +- lib/util.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/translations/german.trans b/data/translations/german.trans index eb95ccc..809a6ea 100644 --- a/data/translations/german.trans +++ b/data/translations/german.trans @@ -154,7 +154,7 @@ _MIrrorPacQ="Die editierte Pacman-Konfiguration für das installierte System nut # Set Keymap (vconsole) _VCKeymapTitle="Konsolensprache einstellen" -_DefKeymap="Die automatisch ausgewählte Tastaturbelegung für Kommandozeilen-Interface ist" +_DefKeymap="Die automatisch ausgewählte Tastaturbelegung ist" _VCKeymapBody="Eine virtuelle Konsole ist das Kommandozeilen-Interface einer nicht-graphischen Umgebung.\nIhr Tastaturlayout ist unabhängig von der Desktop-Umgebung." # Set Xkbmap (environment) diff --git a/lib/util.sh b/lib/util.sh index eaf638c..fa6c4bf 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -218,7 +218,7 @@ set_language() { ini translation "$TRANS" # does user want to change the old settings? - DIALOG " $_SelLang " --yesno "\n${_Lang}: [ ${TRANS^} ]\n$_Keymap: [ ${KEYMAP} ]\n\n${_Change}\n " 0 0 && select_language + DIALOG " $_SelLang " --yesno "\n${_Lang}: [ ${TRANS^} ]\n${_Keymap}: [ ${KEYMAP} ]\n\n${_Change}\n " 0 0 && select_language fi # Generate locale and set language @@ -328,7 +328,7 @@ select_language() { ini linux.font "$FONT" # does user want to change the default keymap? - DIALOG " $_VCKeymapTitle " --yesno "\n${_DefKeymap}:\n[ ${KEYMAP} ].\n\n${_Change}\n " 0 0 && select_keymap + DIALOG " $_VCKeymapTitle " --yesno "\n${_DefKeymap}:\n\n[ ${KEYMAP} ]\n\n${_Change}\n " 0 0 && select_keymap } select_keymap() {