Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/support/2.13.0' into support/2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Sep 15, 2023
2 parents f106f0c + 6af1766 commit 46e46a9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
ls -l /usr/bin/chromium*
$CHROME_DRIVER_BINARY --version
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: "Run tests"
run: |
GLPI_BRANCH=${{ matrix.glpi-branch }}
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: "Code quality tests"
run: |
. ./tests/script-functions.sh
Expand Down
8 changes: 7 additions & 1 deletion RoboFilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ public function localesExtract() {
* @return void
*/
public function localesPush() {
$this->_exec('python3 `which tx` push -s');
$success = $this->taskExec('tx')
->arg('push')
->arg('-s')
->run();
if ($success->getExitCode() != 0) {
throw new RuntimeException("failed to send source locales to transifex");
}
return $this;
}

Expand Down
8 changes: 8 additions & 0 deletions inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
use GlpiPlugin\Formcreator\Exception\ComparisonException;
use Glpi\Application\View\TemplateRenderer;
use State;
use Plugin;

class DropdownField extends PluginFormcreatorAbstractField
{
Expand Down Expand Up @@ -878,6 +879,9 @@ public function parseObjectProperties(
// We need english locale to search searchOptions by name
$oldLocale = $TRANSLATE->getLocale();
$TRANSLATE->setLocale("en_GB");
if ($plug = isPluginItemType($itemtype)) {
Plugin::loadLang(strtolower($plug['plugin']), "en_GB");
}

$item = new $itemtype;
$item->getFromDB($answer);
Expand Down Expand Up @@ -939,6 +943,10 @@ public function parseObjectProperties(
}
// Put the old locales on succes or if an expection was thrown
$TRANSLATE->setLocale($oldLocale);
if ($plug = isPluginItemType($itemtype)) {
Plugin::loadLang(strtolower($plug['plugin']), $oldLocale);
}

return $content;
}

Expand Down

0 comments on commit 46e46a9

Please sign in to comment.