1 |
commit: 7aaf43b23a0b9bc0bb4a2e726bda344409233176 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 25 10:10:55 2014 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 25 10:10:55 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=7aaf43b2 |
7 |
|
8 |
Suppress C and POSIX as languages in news module; support _<territory>. |
9 |
|
10 |
* modules/news.eselect (accepted_languages): Suppress "C" |
11 |
and "POSIX" in output. Support <language>_<territory>. |
12 |
|
13 |
--- |
14 |
ChangeLog | 5 +++++ |
15 |
modules/news.eselect | 11 ++++++++--- |
16 |
2 files changed, 13 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/ChangeLog b/ChangeLog |
19 |
index 0c7a8cd..6aad604 100644 |
20 |
--- a/ChangeLog |
21 |
+++ b/ChangeLog |
22 |
@@ -1,3 +1,8 @@ |
23 |
+2014-02-25 Ulrich Müller <ulm@g.o> |
24 |
+ |
25 |
+ * modules/news.eselect (accepted_languages): Suppress "C" |
26 |
+ and "POSIX" in output. Support <language>_<territory>. |
27 |
+ |
28 |
2014-02-18 Ulrich Müller <ulm@g.o> |
29 |
|
30 |
* man/news.eselect.5: Update URI of GLEP 42. |
31 |
|
32 |
diff --git a/modules/news.eselect b/modules/news.eselect |
33 |
index 463cbbc..782f81c 100644 |
34 |
--- a/modules/news.eselect |
35 |
+++ b/modules/news.eselect |
36 |
@@ -87,9 +87,14 @@ find_repo_dir() { |
37 |
|
38 |
# return list of accepted languages |
39 |
accepted_languages() { |
40 |
- local lc=${LC_ALL:-${LANG}} |
41 |
- lc=${lc%%[^[:alpha:]]*} |
42 |
- [[ -n ${lc} && ${lc} != en ]] && echo ${lc} |
43 |
+ local lc lct=${LC_ALL:-${LANG}} |
44 |
+ lct=${lct%%[^[:alpha:]_]*} # strip .* @* etc. |
45 |
+ lc=${lct%%_*} # strip _<territory> |
46 |
+ [[ ${lct} != "${lc}" ]] && echo "${lct}" |
47 |
+ case ${lc} in |
48 |
+ ""|C|POSIX|en) ;; |
49 |
+ *) echo "${lc}" ;; |
50 |
+ esac |
51 |
echo en |
52 |
} |