From ddef0da72494253ca7ab447765d0f397a32e34d0 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 24 Oct 2012 15:14:39 +0200 Subject: [PATCH] - locale: since focus deutsch.locale isn't longer the masterfile --- data/locale/Makefile.am | 37 ++++++++++++++++------------- data/locale/_readme.txt | 9 ++++--- data/locale/check.locale.files | 2 +- data/locale/create-locals-update.pl | 2 +- data/locale/create.locals.h | 2 +- data/locale/create.locals_intern.h | 2 +- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/data/locale/Makefile.am b/data/locale/Makefile.am index 4efec5237..a88f19957 100644 --- a/data/locale/Makefile.am +++ b/data/locale/Makefile.am @@ -26,23 +26,28 @@ install_DATA += $(locale_unmaintained) if MAINTAINER_MODE +master.locale=english.locale + locals: sort-locals locals.h locals_intern.h install-locals -sort-locals: $(top_srcdir)/data/locale/deutsch.locale $(top_srcdir)/data/locale/english.locale - cat $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq > deutsch.locale - cat $(top_srcdir)/data/locale/english.locale | LC_ALL=C sort | uniq > english.locale - cp -f deutsch.locale english.locale $(top_srcdir)/data/locale +sort-locals: $(top_srcdir)/data/locale/$(master.locale) + for locale in $(locale); do \ + cat $(top_srcdir)/data/locale/$${locale} | LC_ALL=C sort | uniq > $${locale}; \ + done + cp -f $(locale) $(top_srcdir)/data/locale -ordercheck: $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq > /tmp/log - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | uniq | diff - /tmp/log || \ - (echo "ERROR: deutsch.locale not ordered or contains empty lines" && false) +ordercheck: $(top_srcdir)/data/locale/$(master.locale) + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq > /tmp/log + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | uniq | diff - /tmp/log || \ + (echo "ERROR: $(master.locale) not ordered or contains empty lines" && false) -locals.h: ordercheck $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | $(top_srcdir)/data/locale/create.locals.h +locals.h: ordercheck + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | \ + $(top_srcdir)/data/locale/create.locals.h -locals_intern.h: ordercheck $(top_srcdir)/data/locale/deutsch.locale - cut -d' ' -f1 $(top_srcdir)/data/locale/deutsch.locale | LC_ALL=C sort | uniq | $(top_srcdir)/data/locale/create.locals_intern.h +locals_intern.h: ordercheck + cut -d' ' -f1 $(top_srcdir)/data/locale/$(master.locale) | LC_ALL=C sort | uniq | \ + $(top_srcdir)/data/locale/create.locals_intern.h check: locals.h locals_intern.h diff locals.h $(top_srcdir)/src/system @@ -50,11 +55,11 @@ check: locals.h locals_intern.h install-locals: locals.h locals_intern.h cp locals.h locals_intern.h $(top_srcdir)/src/system - @echo "Consider committing src/system/[locals.h,locals_intern.h]" - cp -f deutsch.locale english.locale $(top_srcdir)/data/locale - @echo "Consider committing data/locale/[deutsch.locale,english.locale]" + @echo "Consider committing src/system/[locals.h locals_intern.h]" + cp -f $(locale) $(top_srcdir)/data/locale + @echo "Consider committing data/locale/[$(locale)]" locals-clean: - rm -f locals.h locals_intern.h deutsch.locale english.locale + rm -f locals.h locals_intern.h $(locale) endif diff --git a/data/locale/_readme.txt b/data/locale/_readme.txt index cd4366866..ca063f2fb 100644 --- a/data/locale/_readme.txt +++ b/data/locale/_readme.txt @@ -12,7 +12,7 @@ directory: /var/tuxbox/config/locale or /share/tuxbox/neutrino/locale Master file: ------------ -deutsch.locale is considered the master file. +english.locale is considered the master file. Verfication of .locale files: @@ -27,15 +27,14 @@ Use the check.locale.files shell script for detecting How do I add a new locale string? --------------------------------- 1.) -First of all, add the new string to deutsch.locale while preserving +First of all, add the new string to english.locale while preserving the ordering. Do not add any empty lines. 2.) Enter the directory build_tmp/neutrino-hd/data/locale. 3.) -Use for sorting (deutsch.locale,english.locale) 'make sort-locals', use 'make ordercheck' to for -verification. +Use for sorting 'make sort-locals', use 'make ordercheck' to for verification. 4.) Create new versions of the files src/system/locals.h and src/system/locals_intern.h @@ -60,7 +59,7 @@ locale-files, src/system/locals.h, and src/system/locals_intern.h. Useful tools: ------------- -- emacs (add '(file-coding-system-alist (quote (("\\.locale\\'" . utf-8-unix) ("" undecided)))) to .emacs or use "C-x c utf-8 C-x C-f deutsch.locale") +- emacs (add '(file-coding-system-alist (quote (("\\.locale\\'" . utf-8-unix) ("" undecided)))) to .emacs or use "C-x c utf-8 C-x C-f english.locale") - iconv - sort - uxterm diff --git a/data/locale/check.locale.files b/data/locale/check.locale.files index ef63e8cfd..5b3cf27d1 100755 --- a/data/locale/check.locale.files +++ b/data/locale/check.locale.files @@ -1,5 +1,5 @@ #!/bin/sh -cut -d' ' -f1 deutsch.locale | sort | uniq > /tmp/log +cut -d' ' -f1 english.locale | sort | uniq > /tmp/log for i in *.locale; do \ echo $i:; \ echo "----------------"; \ diff --git a/data/locale/create-locals-update.pl b/data/locale/create-locals-update.pl index 7abc7aaad..91c0705f9 100755 --- a/data/locale/create-locals-update.pl +++ b/data/locale/create-locals-update.pl @@ -7,7 +7,7 @@ # Written by Barf on 2005-12-10. -$masterfilename = "deutsch.locale"; +$masterfilename = "english.locale"; $#ARGV == 0 || die("Usage: create-locals-update.pl file.locale."); diff --git a/data/locale/create.locals.h b/data/locale/create.locals.h index 6f0bbb788..11fe2fd20 100755 --- a/data/locale/create.locals.h +++ b/data/locale/create.locals.h @@ -1,5 +1,5 @@ #!/bin/bash -# usage: cut -d' ' -f1 deutsch.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./create.locals.h +# usage: cut -d' ' -f1 english.locale | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | ./create.locals.h cat > locals.h < locals_intern.h <