mirror of
https://github.com/tips-of-mine/GLPI-Plugin-CVE-Prototype.git
synced 2025-06-28 07:08:44 +02:00
Start repository
This commit is contained in:
22
tools/extract_template.sh
Normal file
22
tools/extract_template.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Extract localization template from GLPI CVE Plugin
|
||||
|
||||
# Define variables
|
||||
NAME="GLPI CVE Plugin"
|
||||
POTFILE=plugin_cve.pot
|
||||
BASEDIR=..
|
||||
|
||||
# Extract strings
|
||||
cd ${BASEDIR}/inc/
|
||||
xgettext *.php *.class.php -o ../locales/${POTFILE} -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po --copyright-holder="${NAME}" --package-name="${NAME}" --package-version="1.0.0" --msgid-bugs-address="development@yourdomain.com" --keyword=__:1,2t --keyword=_e:1,2t --keyword=_n:1,2,4t --keyword=_s:1,2t --keyword=_sx:1,2,3t --keyword=_nx:1,2,4,5t
|
||||
|
||||
cd ${BASEDIR}/front/
|
||||
xgettext *.php -o ../locales/${POTFILE} -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po --join-existing --copyright-holder="${NAME}" --package-name="${NAME}" --package-version="1.0.0" --msgid-bugs-address="development@yourdomain.com" --keyword=__:1,2t --keyword=_e:1,2t --keyword=_n:1,2,4t --keyword=_s:1,2t --keyword=_sx:1,2,3t --keyword=_nx:1,2,4,5t
|
||||
|
||||
cd ${BASEDIR}/ajax/
|
||||
xgettext *.php -o ../locales/${POTFILE} -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po --join-existing --copyright-holder="${NAME}" --package-name="${NAME}" --package-version="1.0.0" --msgid-bugs-address="development@yourdomain.com" --keyword=__:1,2t --keyword=_e:1,2t --keyword=_n:1,2,4t --keyword=_s:1,2t --keyword=_sx:1,2,3t --keyword=_nx:1,2,4,5t
|
||||
|
||||
cd ${BASEDIR}/
|
||||
xgettext *.php -o locales/${POTFILE} -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po --join-existing --copyright-holder="${NAME}" --package-name="${NAME}" --package-version="1.0.0" --msgid-bugs-address="development@yourdomain.com" --keyword=__:1,2t --keyword=_e:1,2t --keyword=_n:1,2,4t --keyword=_s:1,2t --keyword=_sx:1,2,3t --keyword=_nx:1,2,4,5t
|
||||
|
||||
echo "Localization template generated at locales/${POTFILE}"
|
17
tools/generate_mo.sh
Normal file
17
tools/generate_mo.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Generate MO files from PO files for GLPI CVE Plugin
|
||||
|
||||
# Define base directory
|
||||
BASEDIR=../locales
|
||||
|
||||
# For each PO file
|
||||
for pofile in ${BASEDIR}/*.po; do
|
||||
# Get language code
|
||||
lang=$(basename "$pofile" .po)
|
||||
echo "Processing $lang..."
|
||||
|
||||
# Generate MO file
|
||||
msgfmt -v -o ${BASEDIR}/${lang}.mo ${pofile}
|
||||
done
|
||||
|
||||
echo "MO files generation completed"
|
18
tools/update_po.sh
Normal file
18
tools/update_po.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Update PO files from POT template for GLPI CVE Plugin
|
||||
|
||||
# Define variables
|
||||
POTFILE=plugin_cve.pot
|
||||
BASEDIR=../locales
|
||||
|
||||
# For each PO file
|
||||
for pofile in ${BASEDIR}/*.po; do
|
||||
# Get language code
|
||||
lang=$(basename "$pofile" .po)
|
||||
echo "Updating $lang..."
|
||||
|
||||
# Update PO file from template
|
||||
msgmerge --update --no-fuzzy-matching --backup=off ${pofile} ${BASEDIR}/${POTFILE}
|
||||
done
|
||||
|
||||
echo "PO files update completed"
|
Reference in New Issue
Block a user