Files
recycled-ni-neutrino/data/locale/create-locale
vanhofen 4b97760bb2 locale: rework helpers
Origin commit data
------------------
Commit: d69e119903
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-12-03 (Sat, 03 Dec 2022)

Origin message was:
------------------
- locale: rework helpers
2022-12-03 00:18:09 +01:00

51 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
locale_master="deutsch.locale"
locale="${locale_master} english.locale"
check_locale() {
cut -d' ' -f1 ${locale_master} | LC_ALL=C sort | uniq > /tmp/${locale_master}
for l in ${locale}; do
test $l == ${locale_master} && continue
echo $l:
echo "----------------"
cut -d' ' -f1 $l | diff -u - /tmp/${locale_master}
echo
done
rm /tmp/${locale_master}
}
sort_locale() {
for l in ${locale}; do
cat ${l} | LC_ALL=C sort | uniq > ${l}.tmp
mv ${l}.tmp ${l}
done
}
create_locale_work() {
for l in ${locale}; do
helpers/create-locale-work ${l}
done
}
create_locals_h() {
cut -d' ' -f1 ${locale_master} | LC_ALL=C sort | uniq | tr [:lower:] [:upper:] | tr \. \_ | tr \- \_ | tr -d \? | \
helpers/create-locals_h
mv locals.h ../../src/system
}
create_locals_intern_h() {
cut -d' ' -f1 ${locale_master} | LC_ALL=C sort | uniq | \
helpers/create-locals_intern_h
mv locals_intern.h ../../src/system
}
#check_locale
sort_locale
create_locale_work
create_locals_h
create_locals_intern_h
echo "Consider committing src/system/[locals.h locals_intern.h]"
echo "and data/locale/[${locale}]"