Welcome to mirror list, hosted at ThFree Co, Russian Federation.

handleDesktopTranslations.sh « translations-desktop - github.com/nextcloud/docker-ci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 84386015a7bed296effe81cff3d32b43f563d6f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh

# verbose and exit on error
set -xe

# import GPG keys
gpg --import /gpg/nextcloud-bot.public.asc
gpg --allow-secret-key-import --import /gpg/nextcloud-bot.asc
gpg --list-keys

# fetch git repo
git clone git@github.com:nextcloud/desktop.git
cd desktop

# Generate source translation files for master and stable-x.y branches
mkdir /branches

versions=$(git branch -r | grep "origin\/stable\-[0-9]\.[0-9]$" | cut -f2 -d"/")" master"

# Allow to manually limit translations to specified backport branches within the repo
if [ -f '.tx/backport' ]; then
  versions="$(cat .tx/backport) master"
fi

for version in $versions
do
  # skip if the branch doesn't exist
  if git branch -r | egrep "^\W*origin/$version$" ; then
    echo "Valid branch"
  else
    echo "Invalid branch"
    continue
  fi

  git checkout $version

  # Migrate the transifex config to the new client version
  tx migrate
  git add .tx/config
  rm .tx/config_*
  git commit -am "[tx-robot] Update transifex configuration" -s || true
  git push origin $version

  if [ -f './resources.qrc' ]; then
    resources="resources.qrc"
  else
    resources=""
  fi

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

# Merge source translation files and filter duplicates
lconvert -i /branches/*.ts -o /merged_en.ts

# Fix missing <numerusform> elements (always two are required but lconvert strips out one)
# 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

# Migrate the transifex config to the new client version
tx migrate
# push sources
tx push -s

# undo local changes
git checkout -f --

# apply backports
for version in $versions
do
  # skip if the branch doesn't exist
  if git branch -r | egrep "^\W*origin/$version$" ; then
    echo "Valid branch"
  else
    echo "Invalid branch"
    continue
  fi

  git checkout $version

  # pull translations
  tx pull -f -a --minimum-perc=25

  # create git commit and push it
  git add .
  git commit -am "[tx-robot] updated from transifex" -s || true
  git push origin $version
  echo "done with $version"
done