aboutsummaryrefslogtreecommitdiff
path: root/i18n
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2021-04-23 15:53:36 +0200
committerMagneFire <idanlcontact@gmail.com>2021-05-17 13:03:38 +0200
commitb3cf236b34c386a9cbff81ffc1631554bd60ee1b (patch)
tree77ffa5a21e36a10b8d79fddc020c51e9c4235fb8 /i18n
parente974ad13edb44d6705e3f934193f253bc631ff83 (diff)
Port to CMake
Qt is slowly deprecating QMake. They have stopped building Qt itself with QMake and moved Qt6 to CMake instead. Although QMake is still around, it's clear the focus has shifted and it would be good for applications to switch over to an alternative build system as well So hereby, switch the build system to CMake
Diffstat (limited to '')
-rw-r--r--i18n/asteroid-compass.desktop.h3
-rwxr-xr-xi18n/generate-desktop.sh61
2 files changed, 2 insertions, 62 deletions
diff --git a/i18n/asteroid-compass.desktop.h b/i18n/asteroid-compass.desktop.h
index ec23110..076160c 100644
--- a/i18n/asteroid-compass.desktop.h
+++ b/i18n/asteroid-compass.desktop.h
@@ -2,4 +2,5 @@
* will be integrated to i18n/.ts files, translated on Weblate and then merged
* back with the .desktop.template file into a single .desktop file. */
-QObject::tr("Compass");
+//% "Compass"
+qtTrId("id-app-launcher-name");
diff --git a/i18n/generate-desktop.sh b/i18n/generate-desktop.sh
deleted file mode 100755
index f4c8a3e..0000000
--- a/i18n/generate-desktop.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-# This script is used to extract the translated app names found inevery .ts file
-# and gather those strings with the .desktop.template file in a single .desktop
-
-if [ "$#" -ne 2 ]; then
- echo "usage: $0 src_directory output.desktop"
- exit 1
-fi
-
-SRC_DIR=$1
-OUTPUT_DESKTOP_FILE=$2
-if [ ! -f "${SRC_DIR}/${OUTPUT_DESKTOP_FILE}.template" ]; then
- echo "${SRC_DIR}/${OUTPUT_DESKTOP_FILE}.template not found"
- exit 2
-fi
-if [ ! -f "${SRC_DIR}/i18n/${OUTPUT_DESKTOP_FILE}.h" ]; then
- echo "${SRC_DIR}/i18n/${OUTPUT_DESKTOP_FILE}.h not found"
- exit 2
-fi
-
-DEFAULT_NAME=`grep -oP 'QObject::tr\("\K[^"]+(?="\);)' ${SRC_DIR}/i18n/${OUTPUT_DESKTOP_FILE}.h`
-if [ -z "$DEFAULT_NAME" ]; then
- echo "Default name can not be found in ${SRC_DIR}/i18n/${OUTPUT_DESKTOP_FILE}.h"
- exit 3
-fi
-
-cat ${SRC_DIR}/${OUTPUT_DESKTOP_FILE}.template > ${OUTPUT_DESKTOP_FILE}
-echo "Name=$DEFAULT_NAME" >> $OUTPUT_DESKTOP_FILE
-
-for FILE in ${SRC_DIR}/i18n/*.ts; do
- echo "Processing $FILE..."
-
- PROCESSED_LANG=`grep -oP 'language="\K[^"]+(?=")' $FILE`
- if [ -z "$PROCESSED_LANG" ]; then
- echo "> Couldn't find a corresponding language id, aborting"
- continue
- fi
- echo "> Language: $PROCESSED_LANG detected"
-
- TRANSLATION_LINE=`grep -A 2 '<location.*desktop\.h" ' $FILE | grep '<translation'`
- if [ -z "$TRANSLATION_LINE" ]; then
- echo "> Couldn't find a corresponding desktop.h translation, aborting"
- continue
- fi
-
- LINE_IS_UNFINISHED=`echo $TRANSLATION_LINE | grep unfinished`
- if [ ! -z "$LINE_IS_UNFINISHED" ]; then
- echo "> Translation line has been found but is marked as unfinished, aborting"
- continue
- fi
-
- TRANSLATED_NAME=`echo $TRANSLATION_LINE | grep -oP '>\K[^<]*(?=</translation>)'`
- if [ -z "$TRANSLATED_NAME" ]; then
- echo "> Translation is empty, aborting"
- continue
- fi
- echo "> Translation '$TRANSLATED_NAME' found, filling $OUTPUT_DESKTOP_FILE"
-
- echo "Name[$PROCESSED_LANG]=$TRANSLATED_NAME" >> $OUTPUT_DESKTOP_FILE
-done