Skip to content

Commit c4e4f8e

Browse files
committed
Update sh
1 parent 00b589d commit c4e4f8e

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

tools/extract_template.sh

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
#!/bin/bash
22

3-
soft='GLPI - satisfaction plugin'
4-
version='1.1.0'
5-
email='glpi-translation@gna.org'
6-
copyright='INDEPNET Development Team'
3+
# Recherche tous les fichiers PHP récursivement
4+
find . -name '*.php' > php_files.list
75

8-
#xgettext *.php */*.php -copyright-holder='$copyright' --package-name=$soft --package-version=$version --msgid-bugs-address=$email -o locales/en_GB.po -L PHP --from-code=UTF-8 --force-po -i --keyword=_n:1,2 --keyword=__ --keyword=_e
9-
10-
# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed)
11-
12-
xgettext *.php */*.php -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \
13-
--keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \
14-
--keyword=_sx:1c,2,3t --keyword=_nx:1c,2,3,5t
15-
16-
### for using tx :
17-
##tx set --execute --auto-local -r GLPI_satisfaction.glpi_satisfaction-version-110 'locales/<lang>.po' --source-lang en --source-file locales/glpi.pot
18-
## tx push -s
19-
## tx pull -a
6+
# Extraction avec xgettext
7+
xgettext --files-from=php_files.list \
8+
--copyright-holder='Satisfaction Development Team' \
9+
--package-name='Satisfaction - Accounts plugin' \
10+
-o locales/glpi.pot \
11+
-L PHP \
12+
--add-comments=TRANS \
13+
--from-code=UTF-8 \
14+
--force-po \
15+
--keyword=_n:1,2,4t \
16+
--keyword=__s:1,2t \
17+
--keyword=__:1,2t \
18+
--keyword=_e:1,2t \
19+
--keyword=_x:1c,2,3t \
20+
--keyword=_ex:1c,2,3t \
21+
--keyword=_nx:1c,2,3,5t \
22+
--keyword=_sx:1c,2,3t
2023

24+
# Nettoyage
25+
rm php_files.list
2126

0 commit comments

Comments
 (0)