Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions translations-desktop/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

MAINTAINER Morris Jobke <[email protected]>

Expand All @@ -12,7 +12,6 @@ RUN apt-get update -q && \
curl \
openssh-client \
ca-certificates \
qttools5-dev-tools \
qt6-tools-dev-tools \
&& apt-get clean

Expand All @@ -22,7 +21,7 @@ RUN update-ca-certificates
RUN cd /root
RUN curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash

ENV PATH=${PATH}:/
ENV PATH=${PATH}:/usr/lib/qt6/bin:/

RUN mkdir -p /app

Expand Down
19 changes: 14 additions & 5 deletions translations-desktop/handleDesktopTranslations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,23 @@ do
crashreporter=""
fi

lupdate src/gui/ src/cmd/ src/common/ $crashreporter src/csync/ src/libsync/ $resources -ts /branches/$version.ts
# copy existing translation file from the branch, this allows `lupdate` to e.g. keep existing plural forms
cp "translations/client_en.ts" "/branches/$version.ts"

lupdate -no-obsolete src/gui/ src/cmd/ src/common/ $crashreporter src/csync/ src/libsync/ $resources -ts /branches/$version.ts
done

# Merge source translation files and filter duplicates
# This will be used as the source file for Transifex, it contains all translatable strings from each branch
lconvert -i /branches/*.ts -o /merged_en.ts

# Fix missing <numerusform> elements (always two are required but lconvert strips out one)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the <numerusform> workaround doesn't seem to be required anymore with the more recent Qt version in Ubuntu 24.04

# Fix paths, changed by lconvert
sed -e 's/<numerusform><\/numerusform>/<numerusform><\/numerusform><numerusform><\/numerusform>/' -e 's/app\/desktop\/src/src/' /merged_en.ts > translations/client_en.ts
# Fix paths, changed by lupdate/lconvert. Needs to be done for all branch-specific translations and the combined one
for ts_file in /merged_en.ts /branches/*.ts; do
sed -i -e 's,app/desktop/src,src,' "$ts_file"
done

# push sources
# Copy merged translation to the repo to let `tx` use it as a source file, and push it to Transifex.
cp /merged_en.ts translations/client_en.ts
tx push -s

# undo local changes
Expand All @@ -91,6 +97,9 @@ do
mv translations/client_de_DE.ts translations/client_de.ts
rm -rf nextcloud.client-desktop/de_translation.desktop
mv nextcloud.client-desktop/de_DE_translation.desktop nextcloud.client-desktop/de_translation.desktop
if [ -f "/branches/$version.ts" ]; then
cp "/branches/$version.ts" translations/client_en.ts
fi

# create git commit and push it
git add .
Expand Down
Loading