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.
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
Title |
|
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;
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...
@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
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...
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.
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
oh great another php linter in use
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-01 23:02:34 |
Closed_By | ⇒ | brianteeman |
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 muchIndeed missing version.
Agree the packs should be checked before making them available...