mirror of
https://github.com/Icinga/L10n.git
synced 2025-07-31 01:34:20 +02:00
bin/update: Re-add the PoEdit header extensions on each update
This commit is contained in:
parent
5b9a44d22d
commit
5a3d40c4d1
15
bin/update
15
bin/update
@ -68,6 +68,21 @@ xgettext --language=PHP \
|
|||||||
--default-domain=icinga \
|
--default-domain=icinga \
|
||||||
--output=icinga.pot
|
--output=icinga.pot
|
||||||
|
|
||||||
|
# Re-add the PoEdit header extensions
|
||||||
|
REPLACE_CODE=$(cat << PYTHON
|
||||||
|
import sys, re
|
||||||
|
result = re.sub(
|
||||||
|
r'msgid \"\"\nmsgstr \"\"(\n\".*\")+',
|
||||||
|
'\g<0>\n'
|
||||||
|
+ '\"X-Poedit-Basepath: ../../../src\\\\\\\\n\"\n'
|
||||||
|
+ '\"X-Poedit-SearchPath-0: sources.d\\\\\\\\n\"',
|
||||||
|
sys.stdin.read()
|
||||||
|
)
|
||||||
|
sys.stdout.write(result)
|
||||||
|
PYTHON
|
||||||
|
)
|
||||||
|
cat icinga.pot | python -c "$REPLACE_CODE" > temp; mv temp icinga.pot
|
||||||
|
|
||||||
# Cleanup created files and directories
|
# Cleanup created files and directories
|
||||||
rm catalog.txt
|
rm catalog.txt
|
||||||
for repo_name in "${FETCHED_REPOS[@]}"; do
|
for repo_name in "${FETCHED_REPOS[@]}"; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user