File: update_pro.sh

package info (click to toggle)
raysession 0.17.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,196 kB
  • sloc: python: 44,463; sh: 1,538; makefile: 213; xml: 86
file content (40 lines) | stat: -rwxr-xr-x 830 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# This is a little script for refresh raysession.pro and update .ts files.
# TRANSLATOR: if you want to translate the program, you don't need to run it !

contents=""

this_script=`realpath "$0"`
locale_root=`dirname "$this_script"`
code_root=`dirname "$locale_root"`
cd "$code_root/resources/ui/"

for file in *.ui;do
    contents+="FORMS += ../resources/ui/$file
"
done


for dir in daemon gui shared;do
    cd "$code_root/src/$dir"
    
    for file in *.py;do
        [[ "$file" =~ ^ui_ ]] && continue
        
        if cat "$file"|grep -q _translate;then
            contents+="SOURCES += ../src/$dir/${file}
"
        fi
    done
done

contents+="
TRANSLATIONS += raysession_en.ts
TRANSLATIONS += raysession_fr.ts
"

echo "$contents" > "$locale_root/raysession.pro"

pylupdate5 "$locale_root/raysession.pro"