-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_transifex_resources.sh
executable file
·51 lines (41 loc) · 1.76 KB
/
create_transifex_resources.sh
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
#!/usr/bin/env bash
###########################################################################
# create_transifex_resources.sh
# ---------------------
# Date : March 2013
# Copyright : (C) 2013 by Tim Sutton
# Email : tim at linfiniti dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
# This script is used to register QGIS translatable resources with Transifex
# http://transifex.com
#
# Note that this script updates or creates entries in .tx/config file
#
# Tim Sutton, March 2013
# TODO: update script to consider qgis_sr@latin and qgis_zh-Han*
LOCALES=$(ls i18n/qgis_*.ts| grep -o "qgis_[a-z\_A-Z]*" | sed 's/qgis_//g' | sort | uniq)
TSFILE='i18n/qgis_en.ts'
RESOURCE='i18n/qgis_<lang>.ts'
#qgis-application because no _ allowed in resource name
set -x
tx set -t QT --minimum-perc=35 --auto-local -r QGIS.qgis-application \
$RESOURCE \
--source-lang en \
--source $TSFILE \
--execute
for LOCALE in $LOCALES
do
LOCALEFILE=$(echo $TSFILE | sed "s/\_en/\_$LOCALE/g")
tx set -r QGIS.qgis-application -l $LOCALE "$LOCALEFILE"
done
#Print out a listing of all registered resources
tx status
# Push all the resources to the tx server
tx push -s -t --skip