Browse Source

Remove the need to use gencat for Alpine systems

signals
Gavin Howard 3 years ago
parent
commit
b2230162f6
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 1
      .gitignore
  2. 4
      Makefile.in
  3. 7
      README.md
  4. 39
      catalogs.sh
  5. 12
      locales.sh
  6. BIN
      locales/catalogs/en.cat
  7. 1
      locales/catalogs/en_US.cat

1
.gitignore vendored

@ -39,4 +39,3 @@ perf.data.old
*.gcov
*.html
*.profraw
*.cat

4
Makefile.in

@ -114,6 +114,7 @@ SAFE_INSTALL = ./safe-install.sh
LINK = ./link.sh
KARATSUBA = ./karatsuba.py
LOCALES_INSTALL = ./locales.sh
CATALOGS = ./catalogs.sh
VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
RONN_ARGS = --roff --organization="Gavin D. Howard" --manual="General Commands Manual"
@ -227,6 +228,9 @@ manpages:
ronn $(RONN_ARGS) $(BC_RONN)
ronn $(RONN_ARGS) $(DC_RONN)
catalogs:
$(CATALOGS)
clean:
@printf 'Cleaning files...\n'
@$(RM) -f $(OBJ)

7
README.md

@ -109,8 +109,11 @@ To see what algorithms this `bc` uses, see the [algorithms manual][7].
## Locales
Currently, this `bc` only has support for English (and US English) locales.
Patches are welcome for translations; use the existing files in `locales/` as a
starting point.
Patches are welcome for translations; use the existing `*.msg` files in
`locales/` as a starting point.
When submitting a translations, you need to run `make catalogs` before
committing; this will generate `*.cat` files for all of the translations.
## Other Projects

39
catalogs.sh

@ -0,0 +1,39 @@
#! /bin/sh
#
# Copyright 2018 Gavin D. Howard
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
script="$0"
scriptdir=$(dirname "$script")
. "$scriptdir/tests/functions.sh"
localedir="$scriptdir/locales"
for file in $localedir/*.msg; do
base=$(basename "$file")
name=$(echo "$base" | cut -f 1 -d '.')
f="$localedir/catalogs/$name.cat"
if [ -L "$file" ]; then
link=$(readlink "$file")
link=$(echo "$link" | cut -f 1 -d '.')
rm -rf "$localedir/catalogs/$name.cat"
ln -s "$link.cat" "$localedir/catalogs/$name.cat"
else
gencat "$f" "$file"
fi
done

12
locales.sh

@ -33,21 +33,17 @@ shift
mkdir -p "$installdir"
localedir="$scriptdir/locales"
catalogdir="$scriptdir/locales/catalogs"
for file in $localedir/*.msg; do
for file in $catalogdir/*.cat; do
base=$(basename "$file")
name=$(echo "$base" | cut -f 1 -d '.')
f="$localedir/$name.cat"
if [ -L "$file" ]; then
link=$(readlink "$file")
link=$(echo "$link" | cut -f 1 -d '.')
"$INSTALL" -Dlm 755 "$link.cat" "$installdir/$name.cat"
"$INSTALL" -Dlm 755 "$link" "$installdir/$base"
else
gencat "$f" "$file"
"$INSTALL" -Dm 755 "$f" "$installdir/$name.cat"
"$INSTALL" -Dm 755 "$file" "$installdir/$base"
fi
done

BIN
locales/catalogs/en.cat

Binary file not shown.

1
locales/catalogs/en_US.cat

@ -0,0 +1 @@
en.cat
Loading…
Cancel
Save