avatar brianteeman
brianteeman
28 Aug 2021

Helping to answer an issue on the forum https://forum.joomla.org/viewtopic.php?f=812&t=987956&p=3637790#p3637790 which has been identified as an issue in the Swedish language pack in the localise.php

I have identified that the error is php syntax error.

  1. The issue is apparently known by the TT and they didnt know how to fix it, so why is the language still available for download
  2. As this is a php file and it was a relatively simple syntax error can the language packs not be checked by drone before made available

There is an additional error in the language pack as it has an empty version in the xml

<version/>

this is based on the information provided to me in the forum

avatar brianteeman brianteeman - open - 28 Aug 2021
avatar infograf768
infograf768 - comment - 28 Aug 2021

I downloaded the pack
It's localise.php not locale.php.
That pack has plural errors in the strings compared to the ones defined in localise.php
The localise.php has a } too much
Indeed missing version.

Agree the packs should be checked before making them available...

avatar brianteeman brianteeman - change - 28 Aug 2021
Title
[4.0] language pack locale.php
[4.0] language pack localise.php
avatar brianteeman brianteeman - edited - 28 Aug 2021
avatar brianteeman brianteeman - change - 28 Aug 2021
The description was changed
avatar brianteeman brianteeman - edited - 28 Aug 2021
avatar csbalazs
csbalazs - comment - 4 Sep 2021

I also got this error in the Hungarian language pack, but I fixed it. The Joomla 3 Hungarian language pack includes an hu-HU.localise.php, which has a transliterate function that uses JString, but Joomla 4 no longer includes JString.
In the transliterate function I replaced the following line:
$str = JString::strtolower($string);
for this line:
$str = StringHelper::strtolower($string);
Also, after the header, I added the following line:
use Joomla\String\StringHelper;

avatar dgrammatiko
dgrammatiko - comment - 5 Sep 2021

How hard is it to clone the codeception tests here: https://github.com/joomla/core-translations and adjust them so that it's obvious if something is ok or not? Just wondering...

avatar HLeithner
HLeithner - comment - 5 Sep 2021

@dgrammatiko core-translations doesn't hold joomla, so it would need it's own workflow to download/checkout joomla, built the language package (which it doesn't have, it only has all files), install the package (should work in joomla-browser) and then do some useful integration tests.

what easily could be possible to add is a php syntax check for the php file, of course this is only true if they use crowdin or create PRs against the core-translation repo

avatar dgrammatiko
dgrammatiko - comment - 5 Sep 2021

what easily could be possible to add is a php syntax check for the php file, of course this is only true if they use crowdin or create PRs against the core-translation repo

You have some Github action already in this repo, add the syntax checks there as an extra step.
I'm really in favour of having tests in the other repo but I see the point that it also needs a build step. Meh someone needs to bite the bullet...

avatar HLeithner
HLeithner - comment - 5 Sep 2021

You have some Github action already in this repo, add the syntax checks there as an extra step.

Added to the todo list, would simply add find . -name *.php -exec php -l "{}" ; to the right action.

avatar conconnl
conconnl - comment - 7 Sep 2021

You have some Github action already in this repo, add the syntax checks there as an extra step.

Added to the todo list, would simply add find . -name *.php -exec php -l "{}" ; to the right action.

For the direct Get actions:
find ./joomla_${SYNC_VERION}/translations/package/${LANGUAGE_CODE}/ -name "*.php" -exec php -l {} \; | fgrep -i "No syntax errors detected" || exit 1

Check on PRs which are created by others
https://github.com/joomla/core-translations/blob/main/.github/workflows/_check-php-code.yml

avatar brianteeman
brianteeman - comment - 7 Sep 2021

oh great another php linter in use

avatar brianteeman brianteeman - change - 1 Feb 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-02-01 23:02:34
Closed_By brianteeman
avatar brianteeman brianteeman - close - 1 Feb 2022

Add a Comment

Login with GitHub to post a comment