From 4c8d58b646ac62e67fc34c12f8cad51e7512bee3 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 5 Apr 2024 15:00:27 -0400 Subject: add en_CAT makefile and use ucfirst/ucwords --- src/web/lang/_bin/transpile.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 src/web/lang/_bin/transpile.sh (limited to 'src/web/lang/_bin/transpile.sh') diff --git a/src/web/lang/_bin/transpile.sh b/src/web/lang/_bin/transpile.sh new file mode 100755 index 0000000..18bb4c4 --- /dev/null +++ b/src/web/lang/_bin/transpile.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +lang_part() { + echo "$1" | awk "{split(\$0,a,\" = \"); print a[$2]}" +} +export -f lang_part + +handle_line() { + line="$1" + left=$(lang_part "$line" 1) + right=$(lang_part "$line" 2) + echo "$left" | grep -Ev '_content|_line' > /dev/null + if [ "$?" -eq 0 ]; then + right=$(echo "$right" | uwuify) + fi; + right=${right%;}; + echo "$left = $right;" +} +export -f handle_line + +transpile() { + file="$1" + out="$2" + printf "" > "$out" + printf " "$out"; + cat "$file" | grep '$lang' | xargs -d'\n' -I {} bash -c 'handle_line "$@"' _ {} >> "$out" +} + +transpile "$1" "$2" -- cgit v1.2.3-freya