diff --git a/.github/workflows/generatemo.yml b/.github/workflows/generatemo.yml new file mode 100644 index 0000000..9fbb377 --- /dev/null +++ b/.github/workflows/generatemo.yml @@ -0,0 +1,37 @@ +name: Generate MO +on: + push: + branches: [ master ] + paths: + - '**.po' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + run: + + name: Generate mo + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Setup Perl environment + # You may pin to the exact commit or the version. + # uses: shogo82148/actions-setup-perl@8d2e3d59a9516b785ed32169d48a4888eaa9b514 + uses: shogo82148/actions-setup-perl@v1.7.2 + - name: msgfmt + # You may pin to the exact commit or the version. + # uses: whtsky/msgfmt-action@6b2181f051b002182d01a1e1f1aff216230c5a4d + uses: whtsky/msgfmt-action@20190305 + - name: Generate mo + run: perl tools/update_mo.pl; + + - name: Commit changes + uses: EndBug/add-and-commit@v5.1.0 + with: + + message: "Generate mo" + - name: Push changes + + uses: actions-go/push@v1 + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c09b1ba..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -on: [push, pull_request] -name: Main -jobs: - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml deleted file mode 100644 index 3abbc65..0000000 --- a/.github/workflows/php-lint.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: PHP Linting -on: pull_request -jobs: - phplint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: michaelw90/PHP-Lint@master diff --git a/.github/workflows/updatepot.yml b/.github/workflows/updatepot.yml new file mode 100644 index 0000000..982c459 --- /dev/null +++ b/.github/workflows/updatepot.yml @@ -0,0 +1,34 @@ +name: Update POT +on: + push: + branches: [ master ] + paths-ignore: + - 'locales/**' + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + run: + + name: Update POT + + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: install xgettext + + run: sudo apt-get install gettext; + - name: Update POT + run: sh tools/extract_template.sh; + + + - name: Commit changes + uses: EndBug/add-and-commit@v5.1.0 + with: + message: "Update POT" + - name: Push changes + + uses: actions-go/push@v1 + diff --git a/README.md b/README.md index ca791cd..71b64d6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ Room Management plugin for [GLPI](www.glpi-project.org) + +This is a fork of the official plugin, fixed for glpi 9.5 and glpi 10 (glpi_9.5-fixes and glpi-10 branches, respectively) + ======================================================= This is a plugin to add room management feature to [**GLPI** assets inventory @@ -11,9 +14,6 @@ This plugin allows you to manage the rooms and the elements that are included in. A room is not the same as a location that already exists in GLPI because it can not contain items nor be loaned (which a room can be). -GLPI 9.5.1 compatibility added and tested. Translation fixed (gettext domain). -I also added a basic hungarian translation :) - Installation ------------ diff --git a/locales/room.pot b/locales/room.pot index 9fb3db5..a2b861a 100644 --- a/locales/room.pot +++ b/locales/room.pot @@ -1,13 +1,14 @@ -# GLPI - Room Management plugin -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Rooms Development Team +# This file is distributed under the same license as the GLPI - Rooms plugin package. # FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: GLPI - Room plugin 3.2.0-jb\n\n" +"Project-Id-Version: GLPI - Rooms plugin\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-30 18:48+0200\n" +"POT-Creation-Date: 2022-04-11 10:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,7 +22,7 @@ msgstr "" msgid "Error during the database update" msgstr "" -#: hook.php:276 hook.php:284 hook.php:362 front/room.form.php:82 +#: hook.php:276 hook.php:284 hook.php:362 index.php:11 front/room.form.php:82 #: front/room.php:11 inc/profile.class.php:145 msgid "Room Management" msgstr "" @@ -57,14 +58,11 @@ msgstr "" msgid "General" msgstr "" -#: inc/roomaccesscond.class.php:14 inc/room.class.php:113 -#: inc/room.class.php:330 -msgid "Conditions of Access" -msgstr "" - -#: inc/room.class.php:61 inc/room.class.php:318 +#: inc/room.class.php:61 inc/room.class.php:318 inc/roomtype.class.php:14 msgid "Type" -msgstr "" +msgid_plural "Types" +msgstr[0] "" +msgstr[1] "" #: inc/room.class.php:69 inc/room.class.php:377 msgid "Group in charge of the hardware" @@ -86,6 +84,11 @@ msgstr "" msgid "Seating" msgstr "" +#: inc/room.class.php:113 inc/room.class.php:330 +#: inc/roomaccesscond.class.php:14 +msgid "Conditions of Access" +msgstr "" + #: inc/room.class.php:121 inc/room.class.php:387 msgid "Date of purchase" msgstr "" diff --git a/tools/extract_template.sh b/tools/extract_template.sh new file mode 100755 index 0000000..20e0457 --- /dev/null +++ b/tools/extract_template.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed) + +xgettext *.php */*.php */*.php --copyright-holder='Rooms Development Team' --package-name='GLPI - Rooms plugin' -o locales/room.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \ + --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 --keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t + + +