Skip to content

Commit

Permalink
build(gui): remove build-locale output dir arg
Browse files Browse the repository at this point in the history
Rather than outputting to a different location, the output should be
copied from the default output location (gui/share/)
  • Loading branch information
Oppzippy committed May 15, 2024
1 parent 87aa9d5 commit 4193cc0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions gui/scripts/build-locale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ PROJECT_NAME="com.oppzippy.OpenSCQ30"
script_path="$(readlink -f -- "$0")"
script_dir="$(dirname -- "$script_path")"
gui_dir="$script_dir/.."
out_dir=$1

if [[ -z $out_dir ]]; then
out_dir="$gui_dir"
fi


existing_locales=$(find "$gui_dir/po" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')

# Default locale is en
echo "Building en"
mkdir -p "$out_dir/share/locale/en/LC_MESSAGES"
msgfmt --output-file "$out_dir/share/locale/en/LC_MESSAGES/$PROJECT_NAME.mo" "$gui_dir/po/$PROJECT_NAME.pot"
mkdir -p "$gui_dir/share/locale/en/LC_MESSAGES"
msgfmt --output-file "$gui_dir/share/locale/en/LC_MESSAGES/$PROJECT_NAME.mo" "$gui_dir/po/$PROJECT_NAME.pot"

while read -r locale; do
echo "Building $locale"
mkdir -p "$out_dir/share/locale/$locale/LC_MESSAGES"
msgfmt --output-file "$out_dir/share/locale/$locale/LC_MESSAGES/$PROJECT_NAME.mo" "$gui_dir/po/$locale/$PROJECT_NAME.po"
mkdir -p "$gui_dir/share/locale/$locale/LC_MESSAGES"
msgfmt --output-file "$gui_dir/share/locale/$locale/LC_MESSAGES/$PROJECT_NAME.mo" "$gui_dir/po/$locale/$PROJECT_NAME.po"
done <<< "$existing_locales"

0 comments on commit 4193cc0

Please sign in to comment.