-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update translation scripts to avoid committing messages.pot
- Loading branch information
1 parent
4590633
commit becf2bc
Showing
4 changed files
with
25 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
#!/bin/bash | ||
#This script scans the source code for any translatable strings and updates the po/messages.pot file accordingly | ||
#This script scans the source code for any translatable strings and create the build/messages.pot | ||
|
||
#Change to repository root and exit on failure | ||
set -e | ||
cd "$( cd "$( dirname "$0" )" && pwd )/.." || exit 1 | ||
cd "extension" || exit 1 | ||
|
||
#Set build directory if missing, and create it | ||
if [[ "$BUILD_DIR" == "" ]]; then | ||
BUILD_DIR="build" | ||
fi | ||
mkdir -p "$BUILD_DIR" | ||
|
||
#Update the template file with the strings from the source files | ||
xgettext --from-code=UTF-8 \ | ||
--add-comments=Translators \ | ||
--copyright-holder="Stuart Hayhurst" \ | ||
--package-name="privacy-menu-extension" \ | ||
--output=po/messages.pot \ | ||
-- *.js ui/*/*.ui | ||
--output="$BUILD_DIR/messages.pot" \ | ||
-- extension/*.js extension/ui/*/*.ui | ||
|
||
#Replace some lines of the header with our own | ||
sed -i '1s/.*/# <LANGUAGE> translation for the Privacy Quick Settings GNOME Shell Extension./' po/messages.pot | ||
sed -i "2s/.*/# Copyright (C) $(date +%Y) Stuart Hayhurst/" po/messages.pot | ||
sed -i '17s/CHARSET/UTF-8/' po/messages.pot | ||
sed -i '1s/.*/# <LANGUAGE> translation for the Privacy Quick Settings GNOME Shell Extension./' "$BUILD_DIR/messages.pot" | ||
sed -i "2s/.*/# Copyright (C) $(date +%Y) Stuart Hayhurst/" "$BUILD_DIR/messages.pot" | ||
sed -i '17s/CHARSET/UTF-8/' "$BUILD_DIR/messages.pot" | ||
|
||
echo "Generated translation list" |