[COMPONENTS][Posting] Added language help text

[COMPONENTS][Tag] Added Posting form canonical tags field help text
This commit is contained in:
Eliseu Amaro 2021-12-08 14:28:58 +00:00
parent a4f18b937e
commit a285128dab
No known key found for this signature in database
GPG Key ID: 96DA09D4B97BC2D5
4 changed files with 6 additions and 5 deletions

View File

@ -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: _m('Note language:')),
FormFields::language($actor, $context_actor, label: _m('Note language:'), help: _m('The selected language will be federated and added as a lang attribute, preferred language can be set up in settings')),
];
if (\count($available_content_types) > 1) {

View File

@ -9,9 +9,9 @@
{% set blocks = handle_event('AppendRightPostingBlock', request) %}
{% if blocks['post_form'] is defined %}
<section class="section-widget" title={{ 'Create a new note.' | trans }}>
<section class="section-widget" title="{{ 'Create a new note.' | trans }}">
<details class="section-widget-title-details" open="open"
title={{ 'Expand if you want to access more options.' | trans }}>
title="{{ 'Expand if you want to access more options.' | trans }}">
<summary class="section-title-summary">
{{ "Create a note" | trans }}{{ icon('arrow-down', 'icon icon-details-open') | raw }}
</summary>
@ -31,6 +31,7 @@
{{ form_row(blocks['post_form'].language) }}
{{ form_row(blocks['post_form'].tag_use_canonical) }}
</details>
{{ form_rest(blocks['post_form']) }}
{{ form_end(blocks['post_form']) }}
</fieldset>
</div>

View File

@ -177,7 +177,7 @@ class Tag extends Component
public function onPostingAddFormEntries(Request $request, Actor $actor, array &$form_params)
{
$form_params[] = ['tag_use_canonical', CheckboxType::class, ['required' => false, 'data' => true, 'label' => _m('Make note tags canonical')]];
$form_params[] = ['tag_use_canonical', CheckboxType::class, ['required' => false, 'data' => true, 'label' => _m('Make note tags canonical'), 'help' => _m('Canonical tags will be treated as a version of an existing tag with the same root/stem (e.g. \'#great_tag\' will be considered as a version of \'#great\', if it already exists)')]];
return Event::next;
}

View File

@ -9,7 +9,7 @@
{% block body %}
{% if tag_name is defined and tag_name is not null %}
{% if tag_name is instanceof('string') %}
<h2>{% trans %}People with tag: %tag_name%{% endtrans %}</h2>
<h2>{% trans %}Notes with tag: %tag_name%{% endtrans %}</h2>
{% else %}
{% set tags = tag_name|join(', ') %} {# TODO Not ideal, hard to translate #}
<h2>{% trans %}People with tags: %tags%{% endtrans %}</h2>