diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index b9675f3983..edd19fb297 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -28,11 +28,11 @@ use App\Core\DB\DB; use App\Core\Event; use App\Core\Form; use App\Core\GSFile; -use App\Core\Router\Router; -use App\Entity\Activity; use function App\Core\I18n\_m; use App\Core\Modules\Component; +use App\Core\Router\Router; use App\Core\Security; +use App\Entity\Activity; use App\Entity\Actor; use App\Entity\ActorToAttachment; use App\Entity\Attachment; @@ -101,7 +101,7 @@ class Posting extends Component ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'multiple' => false, 'expanded' => false, 'data' => 'public', 'choices' => [_m('Public') => 'public', _m('Instance') => 'instance', _m('Private') => 'private']]], ['content', TextareaType::class, ['label' => _m('Content:'), 'data' => $initial_content, 'attr' => ['placeholder' => _m($placeholder)], 'constraints' => [new Length(['max' => Common::config('site', 'text_limit')])]]], ['attachments', FileType::class, ['label' => _m('Attachments:'), 'multiple' => true, 'required' => false, 'invalid_message' => _m('Attachment not valid.')]], - FormFields::language($actor, $context_actor, label: 'Note language:', help: 'The language in which you wrote this note, so others can see it'), + FormFields::language($actor, $context_actor, label: _m('Note language:')), ]; if (\count($available_content_types) > 1) { @@ -193,12 +193,12 @@ class Posting extends Component } $act = Activity::create([ - 'actor_id' => $actor->getId(), - 'verb' => 'create', + 'actor_id' => $actor->getId(), + 'verb' => 'create', 'object_type' => 'note', - 'object_id' => $note->getId(), - 'is_local' => true, - 'source' => 'web', + 'object_id' => $note->getId(), + 'is_local' => true, + 'source' => 'web', ]); DB::persist($act); @@ -211,7 +211,7 @@ class Posting extends Component } } - Event::handle('NewNotification', [$actor, $act, ['object' => $mentioned], "{$actor->getNickname()} created note {$note->getUrl()}", ]); + Event::handle('NewNotification', [$actor, $act, ['object' => $mentioned], "{$actor->getNickname()} created note {$note->getUrl()}"]); return $note; } @@ -220,7 +220,7 @@ class Posting extends Component { switch ($content_type) { case 'text/plain': - $rendered = Formatting::renderPlainText($content, $language); + $rendered = Formatting::renderPlainText($content, $language); [$rendered, $mentions] = Formatting::linkifyMentions($rendered, $author, $language); return Event::stop; case 'text/html': diff --git a/plugins/Reply/Controller/Reply.php b/plugins/Reply/Controller/Reply.php index 36404eb1f4..ce5e50d5b1 100644 --- a/plugins/Reply/Controller/Reply.php +++ b/plugins/Reply/Controller/Reply.php @@ -74,7 +74,7 @@ class Reply extends Controller // TODO shouldn't this be the posting form? $form = Form::create([ ['content', TextareaType::class, ['label' => _m('Reply'), 'label_attr' => ['class' => 'section-form-label'], 'help' => _m('Please input your reply.')]], - FormFields::language($user->getActor(), context_actor: $note->getActor(), label: 'Note language', help: null), + FormFields::language($user->getActor(), context_actor: $note->getActor(), label: _m('Note language')), ['attachments', FileType::class, ['label' => ' ', 'multiple' => true, 'required' => false]], ['replyform', SubmitType::class, ['label' => _m('Submit')]], ]); diff --git a/src/Controller/UserPanel.php b/src/Controller/UserPanel.php index a92bf207e4..cf0289a67c 100644 --- a/src/Controller/UserPanel.php +++ b/src/Controller/UserPanel.php @@ -42,8 +42,8 @@ use App\Core\Controller; use App\Core\DB\DB; use App\Core\Event; use App\Core\Form; +use function App\Core\I18n\_m; use App\Core\Log; -use App\Entity\ActorCircle; use App\Entity\ActorLanguage; use App\Entity\Language; use App\Util\Common; @@ -66,7 +66,6 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; -use function App\Core\I18n\_m; // }}} Imports @@ -109,7 +108,7 @@ class UserPanel extends Controller ['self_tags', TextType::class, ['label' => _m('Self Tags'), 'required' => false, 'help' => _m('Tags for yourself (letters, numbers, -, ., and _), comma- or space-separated.'), 'transformer' => ArrayTransformer::class]], ['save_personal_info', SubmitType::class, ['label' => _m('Save personal info')]], ]; - $extra_step = function ($data, $extra_args) use ($user, $actor) { + $extra_step = function ($data, $extra_args) use ($user) { $user->setNickname($data['nickname']); }; return Form::handle($form_definition, $request, $actor, $extra, $extra_step, [['self_tags' => $extra['self_tags']]]); @@ -128,7 +127,7 @@ class UserPanel extends Controller ['incoming_email', TextType::class, ['label' => _m('Incoming email'), 'required' => false, 'help' => _m('Change the email you use to contact us (for posting, for instance)')]], ['old_password', TextType::class, ['label' => _m('Old password'), 'required' => false, 'help' => _m('Enter your old password for verification'), 'attr' => ['placeholder' => '********']]], FormFields::repeated_password(['required' => false]), - FormFields::language($user->getActor(), context_actor: null, label: 'Languages', help: 'The languages you understand, so you can see primarily content in those', multiple: true, required: false, use_short_display: false), + FormFields::language($user->getActor(), context_actor: null, label: _m('Languages'), help: _m('The languages you understand, so you can see primarily content in those'), multiple: true, required: false, use_short_display: false), ['phone_number', PhoneNumberType::class, ['label' => _m('Phone number'), 'required' => false, 'help' => _m('Your phone number'), 'data_class' => null]], ['save_account_info', SubmitType::class, ['label' => _m('Save account info')]], ]); diff --git a/src/Util/Form/FormFields.php b/src/Util/Form/FormFields.php index 2413046afd..065c69757a 100644 --- a/src/Util/Form/FormFields.php +++ b/src/Util/Form/FormFields.php @@ -87,12 +87,12 @@ abstract class FormFields 'language' . ($multiple ? 's' : ''), ChoiceType::class, [ - 'label' => _m($label), + 'label' => $label, 'preferred_choices' => $preferred_language_choices, 'choices' => $language_choices, 'required' => $required, 'multiple' => $multiple, - 'help' => _m($help), + 'help' => $help, ], ]; }