-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
158 additions
and
36 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 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
DOMAIN=vgrep | ||
BASEDIR=$(dirname $0) | ||
OUTPUT_FILE=${BASEDIR}/po/${DOMAIN}.pot | ||
|
||
echo "Extracting translatable strings... " | ||
|
||
# Extract the strings from D source code. Since xgettext does not support D | ||
# as a language we use Vala, which works reasonable well. | ||
find ${BASEDIR}/source -name '*.d' | xgettext \ | ||
--join-existing \ | ||
--output $OUTPUT_FILE \ | ||
--files-from=- \ | ||
--directory=$BASEDIR \ | ||
--language=Vala \ | ||
--from-code=utf-8 | ||
|
||
xgettext \ | ||
--join-existing \ | ||
--output $OUTPUT_FILE \ | ||
--default-domain=$DOMAIN \ | ||
--package-name=$DOMAIN \ | ||
--directory=$BASEDIR \ | ||
--foreign-user \ | ||
--language=Desktop \ | ||
${BASEDIR}/pkg/desktop/com.gexperts.VisualGrep.desktop.in | ||
|
||
# Merge the messages with existing po files | ||
echo "Merging with existing translations... " | ||
for file in ${BASEDIR}/po/*.po | ||
do | ||
echo -n $file | ||
msgmerge --update $file $OUTPUT_FILE | ||
done |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env sh | ||
|
||
if [ -z "$1" ]; then | ||
export PREFIX=/usr | ||
# Make sure only root can run our script | ||
if [ "$(id -u)" != "0" ]; then | ||
echo "This script must be run as root" 1>&2 | ||
exit 1 | ||
fi | ||
else | ||
export PREFIX=$1 | ||
fi | ||
|
||
echo "Installing to prefix ${PREFIX}" | ||
|
||
# Compile po files | ||
echo "Copying and installing localization files" | ||
for f in po/*.po; do | ||
echo "Processing $f" | ||
LOCALE=$(basename "$f" .po) | ||
mkdir -p ${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES | ||
msgfmt $f -o ${PREFIX}/share/locale/${LOCALE}/LC_MESSAGES/vgrep.mo | ||
done | ||
|
||
# Generate desktop file | ||
msgfmt --desktop --template=pkg/desktop/com.gexperts.VisualGrep.desktop.in -d po -o pkg/desktop/com.gexperts.VisualGrep.desktop | ||
|
||
# Copy executable and desktop file | ||
mkdir -p ${PREFIX}/bin | ||
cp vgrep ${PREFIX}/bin/vgrep | ||
mkdir -p ${PREFIX}/share/applications | ||
cp pkg/desktop/com.gexperts.VisualGrep.desktop ${PREFIX}/share/applications |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export VGREP_ARCHIVE_PATH="/tmp/vgrep/archive"; | ||
|
||
rm -rf ${VGREP_ARCHIVE_PATH} | ||
|
||
CURRENT_DIR=$(pwd) | ||
|
||
echo "Building application..." | ||
cd .. | ||
dub build --build=release | ||
|
||
./install.sh ${VGREP_ARCHIVE_PATH}/usr | ||
|
||
echo "Creating archive" | ||
cd ${VGREP_ARCHIVE_PATH} | ||
zip -r vgrep.zip * | ||
|
||
cp vgrep.zip ${CURRENT_DIR}/vgrep.zip | ||
cd ${CURRENT_DIR} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Desktop Entry] | ||
Name=Visual Grep | ||
Comment=A simple GTK3 GUI for grep | ||
Exec=vgrep | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=Utilities | ||
Icon=search | ||
Name[en_US]=com.gexperts.VisualGrep.desktop.in |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Desktop Entry] | ||
Name=Visual Grep | ||
Comment=A simple GTK3 GUI for grep | ||
Exec=vgrep | ||
Terminal=false | ||
Type=Application | ||
StartupNotify=true | ||
Categories=Utilities | ||
Icon=search | ||
Name[en_US]=com.gexperts.VisualGrep.desktop.in |
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
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
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
Oops, something went wrong.