# HG changeset patch # User Aleksej Bobylev # Date 1448488230 -7200 # Node ID 3e742c2981eabbea9a92b57876c690ede1b140e1 # Parent f29d39a9b6f788a64c91157a45318067a222f610 tazlocale: accept only existing locales, show locale description; translations: un-fuzzy already translated messages diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/el.po --- a/po/tazbox/el.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/el.po Wed Nov 25 23:50:30 2015 +0200 @@ -26,7 +26,7 @@ #: tazbox/tazbox:31 msgid "command" -msgstr "" +msgstr "εντολή" #: tazbox/tazbox:33 msgid "Commands:" @@ -113,7 +113,7 @@ #: tazbox/tazbox:88 msgid "CANCEL" -msgstr "" +msgstr "ΜΑΤΑΊΩΣΗ" #: tazbox/tazbox:95 msgid "TazBox Output" @@ -124,7 +124,6 @@ msgstr "Αποσύνδεση από το SliTaz" #: tazbox/tazbox:110 -#, fuzzy msgid "SliTaz Logout - Please choose an action:" msgstr "Παρακαλώ, επιλέξτε μια ενέργεια:" @@ -145,11 +144,10 @@ msgstr "Αρχικές ρυθμίσεις του SliTaz" #: tazbox/tazbox:137 -#, fuzzy msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Εδώ, μπορείτε να ορίσετε τις προτιμήσεις σας\\nγια το locale, το keymap " +"Εδώ, μπορείτε να ορίσετε τις προτιμήσεις σας \\n για το locale, το keymap " "και τη ζώνη ώρας." #: tazbox/tazbox:139 diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/es.po --- a/po/tazbox/es.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/es.po Wed Nov 25 23:50:30 2015 +0200 @@ -74,9 +74,8 @@ msgstr "Crea nuevo fichero o carpeta en el escritorio" #: tazbox/tazbox:45 -#, fuzzy msgid "Display icons of all installed applications" -msgstr "Mostrar íconos de todas las aplicaciónes instaladas." +msgstr "Mostrar íconos de todas las aplicaciónes instaladas" #: tazbox/tazbox:46 msgid "Notify user with a desktop centered box" @@ -123,7 +122,6 @@ msgstr "Salir de SliTaz" #: tazbox/tazbox:110 -#, fuzzy msgid "SliTaz Logout - Please choose an action:" msgstr "Por favor seleccione una acción:" @@ -144,12 +142,11 @@ msgstr "Configuración inicial de SliTaz" #: tazbox/tazbox:137 -#, fuzzy msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" "Aquí puede configurar sus preferencias \\n for localización, teclado, zona " -"horaria" +"horaria." #: tazbox/tazbox:139 msgid "Locale" @@ -173,7 +170,7 @@ #: tazbox/tazbox:170 msgid "Tip: manage locales list by installing/removing locale packages." -msgstr "Consejo: maneje listas de localización (des)instalando paquetes de locale" +msgstr "Consejo: maneje listas de localización (des)instalando paquetes de locale." #: tazbox/tazbox:171 tazbox/tazbox:279 msgid "Flag" @@ -213,7 +210,7 @@ #: tazbox/tazbox:247 msgid "Suggested location:" -msgstr "Ubicación sugerida" +msgstr "Ubicación sugerida:" #: tazbox/tazbox:248 msgid "Are you agreed?" @@ -229,7 +226,7 @@ #: tazbox/tazbox:277 msgid "Tip: manage timezones list by installing/removing locale packages." -msgstr "Consejo: maneje zonas horarias (des)instalando paquetes de locale" +msgstr "Consejo: maneje zonas horarias (des)instalando paquetes de locale." #: tazbox/tazbox:279 msgid "Code" @@ -293,7 +290,7 @@ #: tazbox/tazbox:445 msgid "Install/Remove" -msgstr "(des)instalar" +msgstr "(Des)instalar" #: tazbox/tazbox:461 msgid "TazPkg log" @@ -353,20 +350,20 @@ #: tazbox/tazbox:646 msgid "File manager:" -msgstr "Administrador de ficheros" +msgstr "Administrador de ficheros:" #: tazbox/tazbox:647 msgid "Web browser:" -msgstr "Navegador Web" +msgstr "Navegador Web:" #: tazbox/tazbox:648 msgid "Text editor:" -msgstr "Editor de texto" +msgstr "Editor de texto:" #: tazbox/tazbox:649 msgid "Terminal:" -msgstr "Terminal" +msgstr "Terminal:" #: tazbox/tazbox:650 msgid "Window manager:" -msgstr "Administrador de ventanas" +msgstr "Administrador de ventanas:" diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/fa.po --- a/po/tazbox/fa.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/fa.po Wed Nov 25 23:50:30 2015 +0200 @@ -124,7 +124,7 @@ #: tazbox/tazbox:110 msgid "SliTaz Logout - Please choose an action:" -msgstr " :- لطفا یک عملیات را انتخاب کنید SliTaz خروج از سیست" +msgstr ": لطفا یک عملیات را انتخاب کنید SliTaz خروج از سیست" #: tazbox/tazbox:112 msgid "Close X session" @@ -146,8 +146,8 @@ msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"اینجا میتوانید تنظیمات را انجام دهید\\nمنطقه، حالت صفحه کلید و منطقه " -"زمانیبرای" +"اینجا میتوانید تنظیمات را انجام دهید منطقه، حالت صفحه کلید و منطقه " +"زمانی برای" #: tazbox/tazbox:139 msgid "Locale" diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/fr.po --- a/po/tazbox/fr.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/fr.po Wed Nov 25 23:50:30 2015 +0200 @@ -23,7 +23,7 @@ #: tazbox/tazbox:30 msgid "Usage:" -msgstr "Utilisation:" +msgstr "Utilisation :" #: tazbox/tazbox:31 msgid "command" @@ -31,7 +31,7 @@ #: tazbox/tazbox:33 msgid "Commands:" -msgstr "Commandes:" +msgstr "Commandes :" #: tazbox/tazbox:35 msgid "Display this short help usage" @@ -86,17 +86,16 @@ msgstr "Configure les applications SliTaz par défaut" #: tazbox/tazbox:66 -#, fuzzy msgid "SliTaz admin password" msgstr "Mot de passe administrateur" #: tazbox/tazbox:69 msgid "Please enter root password (default root) to execute:" -msgstr "Veuillez entre le mot de passe root (defaut root) pour exécuter:" +msgstr "Veuillez entre le mot de passe root (defaut root) pour exécuter :" #: tazbox/tazbox:72 msgid "Password:" -msgstr "Mot de passe:" +msgstr "Mot de passe :" #: tazbox/tazbox:73 msgid "Autosave password" @@ -108,7 +107,7 @@ #: tazbox/tazbox:81 msgid "Error: wrong password!" -msgstr "Erreur: mauvais mot de passe!" +msgstr "Erreur: mauvais mot de passe !" #: tazbox/tazbox:88 msgid "CANCEL" @@ -123,9 +122,8 @@ msgstr "Déconnexion" #: tazbox/tazbox:110 -#, fuzzy msgid "SliTaz Logout - Please choose an action:" -msgstr "Veuillez choisir une action:" +msgstr "Fermeture de SliTaz - Veuillez sélectionner votre choix :" #: tazbox/tazbox:112 msgid "Close X session" @@ -144,11 +142,10 @@ msgstr "Réglages initiale de SliTaz" #: tazbox/tazbox:137 -#, fuzzy msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Ici vous pouver régler vos préférences\\npour la langue, le clavier et la " +"Ici vous pouver régler vos préférences \\n pour la langue, le clavier et la " "zone horaire" #: tazbox/tazbox:139 diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/pl.po --- a/po/tazbox/pl.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/pl.po Wed Nov 25 23:50:30 2015 +0200 @@ -125,7 +125,6 @@ msgstr "Wyloguj z SliTaz" #: tazbox/tazbox:110 -#, fuzzy msgid "SliTaz Logout - Please choose an action:" msgstr "Proszę wybrać polecenie:" @@ -146,11 +145,10 @@ msgstr "Wstęþna Konfiguracja SliTaz" #: tazbox/tazbox:137 -#, fuzzy msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Tu można zmienić ustawienia dla języka,\\nukładu klawiatury i " +"Tu można zmienić ustawienia dla języka, \\n układu klawiatury i " "strefy czasowej." #: tazbox/tazbox:139 diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/pt_BR.po --- a/po/tazbox/pt_BR.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/pt_BR.po Wed Nov 25 23:50:30 2015 +0200 @@ -75,7 +75,7 @@ #: tazbox/tazbox:45 msgid "Display icons of all installed applications" -msgstr "Ícones de todos os aplicativos instalados." +msgstr "Ícones de todos os aplicativos instalados" #: tazbox/tazbox:46 msgid "Notify user with a desktop centered box" @@ -145,8 +145,8 @@ msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Aqui você pode definir suas preferências\\npara localização, mapa de " -"teclado e zona horária" +"Aqui você pode definir suas preferências \\n para localização, mapa de " +"teclado e zona horária." #: tazbox/tazbox:139 msgid "Locale" diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/ru.po --- a/po/tazbox/ru.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/ru.po Wed Nov 25 23:50:30 2015 +0200 @@ -102,7 +102,7 @@ #: tazbox/tazbox:72 msgid "Password:" -msgstr "Пароль" +msgstr "Пароль:" #: tazbox/tazbox:73 msgid "Autosave password" @@ -152,8 +152,8 @@ msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Здесь вы можете установить\\nлокаль, раскладку клавиатуры и часовой пояс." +"Здесь вы можете установить \\n локаль, раскладку клавиатуры и часовой " +"пояс." #: tazbox/tazbox:139 msgid "Locale" diff -r f29d39a9b6f7 -r 3e742c2981ea po/tazbox/sv.po --- a/po/tazbox/sv.po Tue Nov 17 17:19:20 2015 +0200 +++ b/po/tazbox/sv.po Wed Nov 25 23:50:30 2015 +0200 @@ -121,7 +121,6 @@ msgstr "SliTaz utloggning" #: tazbox/tazbox:110 -#, fuzzy msgid "SliTaz Logout - Please choose an action:" msgstr "Var god välj ett alternativ:" @@ -142,11 +141,10 @@ msgstr "SliTaz Första Inställning" #: tazbox/tazbox:137 -#, fuzzy msgid "" "Here you can set your preferences \\n for locale, keymap and timezone." msgstr "" -"Här kan du ställa dina inställningar\\nför språk, tangentbord och " +"Här kan du ställa dina inställningar \\n för språk, tangentbord och " "tidszon." #: tazbox/tazbox:139 diff -r f29d39a9b6f7 -r 3e742c2981ea tinyutils/tazlocale --- a/tinyutils/tazlocale Tue Nov 17 17:19:20 2015 +0200 +++ b/tinyutils/tazlocale Wed Nov 25 23:50:30 2015 +0200 @@ -91,8 +91,13 @@ get_locale_name() { for i in $(ls -1 /usr/share/i18n/locales | grep [a-z]_[A-Z]); do - #desc=$(grep ^title /usr/share/i18n/locales/$i | cut -d '"' -f 2) - echo "$i Locale" + echo -n "$i " + desc=$(grep ^title /usr/share/i18n/locales/$i | cut -d '"' -f 2) + if [ -n "$desc" ]; then + echo "$desc" | tr -c '[A-Za-z0-9\n]' '_' + else + echo "Locale" + fi done } @@ -101,20 +106,25 @@ # Run localedef in background to have a faster boot. gen_utf8_locale() { - [ -e /usr/lib/locale/$locale ] || \ - localedef -i $locale -c -f UTF-8 /usr/lib/locale/$locale & + if [ ! -d "/usr/lib/locale/$locale.UTF-8" ]; then + localedef -i "$locale" -c -f 'UTF-8' "/usr/lib/locale/$locale.UTF-8" & + fi } # Config /etc/locale.conf system_config() { - export LC_ALL=$locale - _n 'Setting system locale to: %s' "$locale" - echo -e "LANG=$locale\nLC_ALL=$locale" > /etc/locale.conf + # If locale not defined: show error and exit + ls "/usr/share/i18n/locales/$locale" >/dev/null || return + export LC_ALL="$locale.UTF-8" + action 'Setting system locale to: %s' "$locale.UTF-8" + echo -e "LANG=$locale.UTF-8\nLC_ALL=$locale.UTF-8" > /etc/locale.conf status gen_utf8_locale link_language_files + # Clean TazPanel cached headers in old language + [ -n "$(which tazpanel)" ] && tazpanel cc } @@ -153,6 +163,7 @@ --help|-h) usage ;; info) + . /etc/locale.conf _ 'Config file: %s' '/etc/locale.conf' _ 'Current locale: %s' "$LANG" ;;