From e060756dce8ba78332f97bd3ee1ffceb4bbc756f Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Jan 26 2011 17:50:30 +0000 Subject: Update cli_getLocales.sh: - Add `pt_PT' as valid locale for centos-art.sh script. Since we are using LL_CC format for Portuguese language, we cannot use just LL format for pt, so we need to distinguish pt languages using LL_CC. Remainder: When we use LL_CC format for a language, there is no possible change to use LL format only for that language. The language format evaluation takes place using the most descriptive definition first and the less descriptive definition last (i.e., `LL_CC.ENCONDING', `LL_CC' and `LL'). The first format that match (in that order) is used. --- diff --git a/Scripts/Bash/Functions/cli_getLocales.sh b/Scripts/Bash/Functions/cli_getLocales.sh index ebca15f..85c58f7 100755 --- a/Scripts/Bash/Functions/cli_getLocales.sh +++ b/Scripts/Bash/Functions/cli_getLocales.sh @@ -1,8 +1,8 @@ #!/bin/bash # -# cli_getLocales.sh -- This function outputs locale codes in LL and -# LL_CC format. Combine both ISO639 and ISO3166 specification in order -# to build the final locale list. This function defines which +# cli_getLocales.sh -- This function outputs/verifies locale codes in +# LL and LL_CC format. Combine both ISO639 and ISO3166 specification +# in order to build the final locale list. This function defines which # translation locales are supported inside CentOS Artwork Repository. # # Copyright (C) 2009-2011 Alain Reguera Delgado @@ -43,7 +43,7 @@ function cli_getLocales { # country-specific language locale specification in the following # list using the format LL_CC, where LL is the language code and # CC the country code. - LOCALES="$LOCALES pt_BR bn_IN" + LOCALES="$LOCALES pt_BR pt_PT bn_IN" # Replace spaces by new lines in order to transform the space # separated list of locales into a newline separated list of @@ -51,7 +51,10 @@ function cli_getLocales { # organize the final list of locales. LOCALES=$(echo $LOCALES | sed -r "s![[:space:]]+!\n!g") - # Output locales organized by name and avoiding duplicated lines. - echo "$LOCALES" | sort | uniq + # Organize locales by name and avoid using duplicates values. + LOCALES=$(echo "${LOCALES}" | sort | uniq) + + # Print locales supported by centos-art.sh script. + echo "$LOCALES" }