Skip to content

Commit 5a9565f

Browse files
committed
Update Github Scripts
1 parent 8c0d123 commit 5a9565f

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

.github/workflows/updatepot.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@ on:
77

88
env:
99
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10-
jobs:
10+
jobs:
1111
run:
1212

1313
name: Update POT
14-
14+
1515
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout repo
18-
uses: actions/checkout@v4
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
1919

20-
- name: install xgettext
21-
22-
run: sudo apt-get install gettext;
23-
- name: Update POT
24-
run: sh tools/extract_template.sh;
20+
- name: install xgettext
21+
22+
run: sudo apt-get install gettext;
23+
- name: Update POT
24+
run: sh tools/extract_template.sh;
2525

26+
- name: Commit changes
27+
uses: EndBug/add-and-commit@v9
28+
with:
29+
message: "Update POT"
2630

27-
- name: Commit changes
28-
uses: EndBug/add-and-commit@v9
29-
with:
30-
message: "Update POT"
31-
- name: Push changes
32-
33-
uses: actions-go/push@master
31+
- name: Push changes
32+
uses: actions-go/push@master
33+
with:
34+
commit-message: ''
3435

tools/extract_template.sh

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

3-
# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed)
4-
5-
xgettext *.php */*.php --copyright-holder='Tasklists Development Team' --package-name='GLPI - Tasklists plugin' -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \
6-
--keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t \
7-
--keyword=_ex:1c,2,3t --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t
3+
# Recherche tous les fichiers PHP récursivement
4+
find . -name '*.php' > php_files.list
85

6+
# Extraction avec xgettext
7+
xgettext --files-from=php_files.list \
8+
--copyright-holder='Tasklists Development Team' \
9+
--package-name='Tasklists - 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
923

24+
# Nettoyage
25+
rm php_files.list
1026

0 commit comments

Comments
 (0)