code review

This commit is contained in:
Jean-Christian Denis 2023-11-04 22:03:58 +01:00
parent d63eaeb95a
commit fe476152d2
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
7 changed files with 21 additions and 15 deletions

View file

@ -1,3 +1,9 @@
translater 2023.11.04
===========================================================
* Require Dotclear 2.28
* Require PHP 8.1
* Cosmetic code review
translater 2023.10.21
===========================================================
* Require Dotclear 2.28

View file

@ -1,8 +1,8 @@
# README
[![Release](https://img.shields.io/badge/release-2023.10.21-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/translater/releases)
![Date](https://img.shields.io/badge/date-2023.10.21-c44d58.svg)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.27-137bbb.svg)](https://fr.dotclear.org/download)
[![Release](https://img.shields.io/badge/release-2023.11.04-a2cbe9.svg)](https://git.dotclear.watch/JcDenis/translater/releases)
![Date](https://img.shields.io/badge/date-2023.11.04-c44d58.svg)
[![Dotclear](https://img.shields.io/badge/dotclear-v2.28-137bbb.svg)](https://fr.dotclear.org/download)
[![Dotaddict](https://img.shields.io/badge/dotaddict-official-9ac123.svg)](https://plugins.dotaddict.org/dc2/details/translater)
[![License](https://img.shields.io/badge/license-GPL--2.0-ececec.svg)](https://git.dotclear.watch/JcDenis/translater/src/branch/master/LICENSE)
@ -10,7 +10,7 @@
_translater_ is a plugin for the open-source web publishing software called [Dotclear](https://www.dotclear.org).
> It helps dev to translate plugin and theme.
> Help dev to translate plugin and theme.
## REQUIREMENTS

View file

@ -17,7 +17,7 @@ $this->registerModule(
'Translater',
'Translate your Dotclear plugins and themes',
'Jean-Christian Denis & contributors',
'2023.10.21',
'2023.11.04',
[
'requires' => [['core', '2.28']],
'permissions' => 'My',

View file

@ -2,10 +2,10 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="translater">
<name>Translater</name>
<version>2023.10.21</version>
<version>2023.11.04</version>
<author>Jean-Christian Denis &amp; contributors</author>
<desc>Translate your Dotclear plugins and themes</desc>
<file>https://git.dotclear.watch/JcDenis/translater/releases/download/v2023.10.21/plugin-translater.zip</file>
<file>https://git.dotclear.watch/JcDenis/translater/releases/download/v2023.11.04/plugin-translater.zip</file>
<da:dcmin>2.28</da:dcmin>
<da:details>https://git.dotclear.watch/JcDenis/translater/src/branch/master/README.md</da:details>
<da:support>https://git.dotclear.watch/JcDenis/translater/issues</da:support>

View file

@ -120,7 +120,7 @@ class Config extends Process
// parse_userinfo
(new Para())->items([
(new Label(__('User info:')))->for('parse_userinfo'),
(new Input('parse_userinfo'))->size(65)->maxlenght(255)->value($s->parse_userinfo),
(new Input('parse_userinfo'))->size(65)->maxlength(255)->value($s->parse_userinfo),
]),
(new Note())->text(sprintf(
__('Following informations can be used: %s'),
@ -136,7 +136,7 @@ class Config extends Process
// export_filename
(new Para())->items([
(new Label(__('Name of exported package:')))->for('export_filename'),
(new Input('export_filename'))->size(65)->maxlenght(255)->value($s->export_filename),
(new Input('export_filename'))->size(65)->maxlength(255)->value($s->export_filename),
]),
]),
(new Fieldset())->class('fieldset')->legend((new Legend(__('Backups'))))->fields([

View file

@ -525,7 +525,7 @@ class Manage extends Process
(new Select(['entries[' . $i . '][group]']))->default($rs['group'])->items(My::l10nGroupsCombo())->disabled($in_dc)->render(),
Html::escapeHTML($msgid),
(new Hidden(['entries[' . $i . '][msgid]'], Html::escapeHTML($msgid)))->render() .
(new Input(['entries[' . $i . '][msgstr][0]']))->size(48)->maxlenght(255)->value(Html::escapeHTML($rs['msgstr'][0]))->disabled($in_dc)->render(),
(new Input(['entries[' . $i . '][msgstr][0]']))->size(48)->maxlength(255)->value(Html::escapeHTML($rs['msgstr'][0]))->disabled($in_dc)->render(),
implode('', $t_msgstr),
implode('', $t_files)
);
@ -556,7 +556,7 @@ class Manage extends Process
sprintf(__('Plural "%s"'), $plural),
sprintf(__('Plural form of "%s"'), $rs['plural']),
(new Hidden(['entries[' . $i . '][msgid_plural]'], Html::escapeHTML($rs['plural'])))->render() .
(new Input(['entries[' . $i . '][msgstr][' . ($j + 1) . ']']))->size(48)->maxlenght(255)->value(Html::escapeHTML($rs['msgstr'][$j + 1] ?? ''))->disbaled($in_dc)->render(),
(new Input(['entries[' . $i . '][msgstr][' . ($j + 1) . ']']))->size(48)->maxlength(255)->value(Html::escapeHTML($rs['msgstr'][$j + 1] ?? ''))->disabled($in_dc)->render(),
implode('', $t_msgstr),
''
);
@ -569,8 +569,8 @@ class Manage extends Process
' offline',
(new Checkbox(['entries[' . $i . '][check]']))->value(1)->render(),
(new Select(['entries[' . $i . '][group]']))->items(My::l10nGroupsCombo())->default('main')->render(),
(new Input(['entries[' . $i . '][msgid]']))->size(48)->maxlenght(255)->render(),
(new Input(['entries[' . $i . '][msgstr][0]']))->size(48)->maxlenght(255)->render(),
(new Input(['entries[' . $i . '][msgid]']))->size(48)->maxlength(255)->render(),
(new Input(['entries[' . $i . '][msgstr][0]']))->size(48)->maxlength(255)->render(),
'',
''
);

View file

@ -25,8 +25,8 @@ class My extends MyPlugin
public static function checkCustomContext(int $context): ?bool
{
return match ($context) {
// Limit to super admin
return match($context) {
self::MODULE => App::auth()->isSuperAdmin(),
default => null,
};