Skip to content

Commit

Permalink
fix(docs): mix of single and singular/plural locales
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 15, 2022
1 parent 01e5703 commit dc8f38c
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions inc/abstractitiltarget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ protected function showOLASettings() {

protected function showCategorySettings($rand) {
echo '<tr>';
echo '<td width="15%">' . __('Category', 'formcreator') . '</td>';
echo '<td width="15%">' . PluginFormcreatorCategory::getTypeName(1) . '</td>';
echo '<td width="25%">';
Dropdown::showFromArray(
'category_rule',
Expand All @@ -963,8 +963,8 @@ protected function showCategorySettings($rand) {
echo Html::scriptBlock("plugin_formcreator_changeCategory($rand);");
echo '</td>';
echo '<td width="15%">';
echo '<span id="category_specific_title" style="display: none">' . __('Category', 'formcreator') . '</span>';
echo '<span id="category_question_title" style="display: none">' . __('Question', 'formcreator') . '</span>';
echo '<span id="category_specific_title" style="display: none">' . PluginFormcreatorCategory::getTypeName(1) . '</span>';
echo '<span id="category_question_title" style="display: none">' . PluginFormcreatorQuestion::getTypeName(1) . '</span>';
echo '</td>';
echo '<td width="25%">';
echo '<div id="category_question_value" style="display: none">';
Expand Down Expand Up @@ -1001,7 +1001,7 @@ protected function showUrgencySettings($rand) {
echo Html::scriptBlock("plugin_formcreator_changeUrgency($rand);");
echo '</td>';
echo '<td width="15%">';
echo '<span id="urgency_question_title" style="display: none">' . __('Question', 'formcreator') . '</span>';
echo '<span id="urgency_question_title" style="display: none">' . PluginFormcreatorQuestion::getTypeName(1) . '</span>';
echo '<span id="urgency_specific_title" style="display: none">' . __('Urgency ', 'formcreator') . '</span>';
echo '</td>';
echo '<td width="25%">';
Expand Down Expand Up @@ -1210,7 +1210,7 @@ protected function showLocationSettings($rand) {
echo Html::scriptBlock("plugin_formcreator_change_location($rand)");
echo '</td>';
echo '<td width="15%">';
echo '<span id="location_question_title" style="display: none">' . __('Question', 'formcreator') . '</span>';
echo '<span id="location_question_title" style="display: none">' . PluginFormcreatorQuestion::getTypeName(1) . '</span>';
echo '<span id="location_specific_title" style="display: none">' . __('Location ', 'formcreator') . '</span>';
echo '</td>';
echo '<td width="25%">';
Expand Down Expand Up @@ -1291,7 +1291,7 @@ protected function showValidationSettings($rand) {

$display = $validation_rule == self::COMMONITIL_VALIDATION_RULE_ANSWER_USER || $validation_rule == self::COMMONITIL_VALIDATION_RULE_ANSWER_GROUP ? "" : "display: none";
echo "<span id='commonitil_validation_from_question_title' style='$display'>";
echo __('Question', 'formcreator');
echo PluginFormcreatorQuestion::getTypeName(1);
echo "</span>";

echo '</td>';
Expand Down
2 changes: 1 addition & 1 deletion inc/entityconfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public function rawSearchOptions() {
$tab[] = [
'id' => '8',
'table' => self::getTable(),
'name' => __('Header', 'formcreator'),
'name' => _n('Header', 'Headers', 1, 'formcreator'),
'field' => 'header',
'datatype' => 'text',
'nosearch' => true,
Expand Down
4 changes: 2 additions & 2 deletions inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class DropdownField extends PluginFormcreatorAbstractField

public function getEnumEntityRestriction() {
return [
self::ENTITY_RESTRICT_USER => __('User', 'formcreator'),
self::ENTITY_RESTRICT_FORM => __('Form', 'formcreator'),
self::ENTITY_RESTRICT_USER => User::getTypeName(1),
self::ENTITY_RESTRICT_FORM => PluginFormcreatorForm::getTypeName(1),
self::ENTITY_RESTRICT_BOTH => __('User and form', 'formcreator'),
];
}
Expand Down
4 changes: 2 additions & 2 deletions inc/filter/entityfilter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class EntityFilter

public static function getEnumEntityRestriction() {
return [
self::ENTITY_RESTRICT_USER => __('User', 'formcreator'),
self::ENTITY_RESTRICT_FORM => __('Form', 'formcreator'),
self::ENTITY_RESTRICT_USER => User::getTypeName(1),
self::ENTITY_RESTRICT_FORM => PluginFormcreatorForm::getTypeName(1),
self::ENTITY_RESTRICT_BOTH => __('User and form', 'formcreator'),
];
}
Expand Down
6 changes: 3 additions & 3 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function rawSearchOptions() {
'id' => '5',
'table' => 'glpi_entities',
'field' => 'completename',
'name' => __('Entity'),
'name' => Entity::getTypeName(1),
'datatype' => 'dropdown',
'massiveaction' => false
];
Expand Down Expand Up @@ -227,7 +227,7 @@ public function rawSearchOptions() {
'id' => '10',
'table' => PluginFormcreatorCategory::getTable(),
'field' => 'name',
'name' => __('Form category', 'formcreator'),
'name' => PluginFormcreatorCategory::getTypeName(1),
'datatype' => 'dropdown',
'massiveaction' => true
];
Expand Down Expand Up @@ -500,7 +500,7 @@ public function showTargets($ID, $options = []) {
echo '<table class="tab_cadrehov">';
echo '<tr>';
echo '<th>'._n('Target', 'Targets', 2, 'formcreator').'</th>';
echo '<th>'.__('Type', 'formcreator').'</th>';
echo '<th>'._n('Type', 'Types', 1).'</th>';
echo '<th class="right">'.__('Actions', 'formcreator').'</th>';
echo '</tr>';

Expand Down
2 changes: 1 addition & 1 deletion inc/form_language.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public function showTranslations($options = []) {
$header = '<tr>';
$header.= '<th>' . Html::getCheckAllAsCheckbox("translation_list$rand", $rand) . '</th>';
$header.= '<th>' . __('Original string', 'formcreator') . '</th>';
$header.= '<th>' . __('Translation', 'formcreator') . '</th>';
$header.= '<th>' . PluginFormcreatorTranslation::getTypeName(1) . '</th>';
$header.= '</tr>';
echo $header;
echo '</thead>';
Expand Down
6 changes: 3 additions & 3 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function rawSearchOptions() {
'id' => '3',
'table' => 'glpi_plugin_formcreator_forms',
'field' => 'name',
'name' => __('Form', 'formcreator'),
'name' => PluginFormcreatorForm::getTypeName(1),
'searchtype' => 'contains',
'datatype' => 'string',
'massiveaction' => false
Expand All @@ -216,7 +216,7 @@ public function rawSearchOptions() {
'id' => '4',
'table' => 'glpi_users',
'field' => 'name',
'name' => __('Requester'),
'name' => _n('Requester', 'Requesters', 1),
'datatype' => 'itemlink',
'massiveaction' => false,
'linkfield' => 'requester_id'
Expand Down Expand Up @@ -615,7 +615,7 @@ public function showForm($ID, $options = []) {

//add requester info
echo '<div class="form-group">';
echo '<label for="requester">' . __('Requester', 'formcreator') . '</label>';
echo '<label for="requester">' . _n('Requester', 'Requesters', 1) . '</label>';
echo Dropdown::getDropdownName('glpi_users', $this->fields['requester_id']);
echo '</div>';

Expand Down
6 changes: 3 additions & 3 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public function rawSearchOptions() {
'id' => '3',
'table' => self::getTable(),
'field' => 'itemtype',
'name' => __('Type'),
'name' => _n('Type', 'Types', 1),
'searchtype' => [
'0' => 'equals',
'1' => 'notequals'
Expand Down Expand Up @@ -583,7 +583,7 @@ public function rawSearchOptions() {
'id' => '7',
'table' => 'glpi_entities',
'field' => 'completename',
'name' => __('Entity'),
'name' => _n('Entity', 'Entities', 1),
'datatype' => 'dropdown',
'massiveaction' => false
];
Expand All @@ -593,7 +593,7 @@ public function rawSearchOptions() {
'table' => 'glpi_users',
'field' => 'name',
'linkfield' => 'requester_id',
'name' => __('Requester'),
'name' => _n('Requester', 'Requesters', 1),
'datatype' => 'dropdown',
'massiveaction' => false
];
Expand Down
4 changes: 2 additions & 2 deletions inc/notificationtargetformanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public function getTags() {
$tags = [
'formcreator.form_id' => __('Form #', 'formcreator'),
'formcreator.form_name' => __('Form name', 'formcreator'),
'formcreator.form_requester' => __('Requester', 'formcreator'),
'formcreator.form_validator' => __('Validator', 'formcreator'),
'formcreator.form_requester' => _n('Requester', 'Requesters', 1),
'formcreator.form_validator' => _x('tag', 'Validator', 'formcreator'),
'formcreator.form_creation_date' => __('Creation date'),
'formcreator.form_full_answers' => __('Full form answers', 'formcreator'),
'formcreator.validation_comment' => __('Refused comment', 'formcreator'),
Expand Down
2 changes: 1 addition & 1 deletion inc/target_actor.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static function getEnumActorType() {

static function getEnumRole() {
return [
self::ACTOR_ROLE_REQUESTER => __('Requester'),
self::ACTOR_ROLE_REQUESTER => _n('Requester', 'Requesters', 1),
self::ACTOR_ROLE_OBSERVER => __('Observer'),
self::ACTOR_ROLE_ASSIGNED => __('Assigned to'),
// TODO : support ACTOR_ROLE_SUPPLIER
Expand Down
2 changes: 1 addition & 1 deletion inc/targetchange.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$tab = [
1 => __('Properties', 'formcreator'),
2 => __('Actors', 'formcreator'),
3 => __('Condition', 'formcreator'),
3 => PluginFormcreatorCondition::getTypeName(1),
];
// if ((new Plugin)->isActivated('fields')) {
// $tab[4] = __('Fields plugin', 'formcreator');
Expand Down
2 changes: 1 addition & 1 deletion inc/targetproblem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$tab = [
1 => __('Properties', 'formcreator'),
2 => __('Actors', 'formcreator'),
3 => __('Condition', 'formcreator'),
3 => PluginFormcreatorCondition::getTypeName(1),
];
// if ((new Plugin)->isActivated('fields')) {
// $tab[4] = __('Fields plugin', 'formcreator');
Expand Down
6 changes: 3 additions & 3 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$tab = [
1 => __('Properties', 'formcreator'),
2 => __('Actors', 'formcreator'),
3 => __('Condition', 'formcreator'),
3 => PluginFormcreatorCondition::getTypeName(1),
];
// if ((new Plugin)->isActivated('fields')) {
// $tab[4] = __('Fields plugin', 'formcreator');
Expand Down Expand Up @@ -1103,7 +1103,7 @@ protected function showTargetType($rand) {
echo Html::scriptBlock("plugin_formcreator_changeRequestType($rand);");
echo '</td>';
echo '<td width="15%">';
echo '<span id="requesttype_question_title" style="display: none">' . __('Question', 'formcreator') . '</span>';
echo '<span id="requesttype_question_title" style="display: none">' . PluginFormcreatorQuestion::getTypeName(1) . '</span>';
echo '<span id="requesttype_specific_title" style="display: none">' . __('Type ', 'formcreator') . '</span>';
echo '</td>';
echo '<td width="25%">';
Expand Down Expand Up @@ -1142,7 +1142,7 @@ protected function showAssociateSettings($rand) {
echo Html::scriptBlock("plugin_formcreator_change_associate($rand)");
echo '</td>';
echo '<td width="15%">';
echo '<span id="plugin_formcreator_associate_question_title" style="display: none">' . __('Question', 'formcreator') . '</span>';
echo '<span id="plugin_formcreator_associate_question_title" style="display: none">' . PluginFormcreatorQuestion::getTypeName(1) . '</span>';
echo '<span id="plugin_formcreator_associate_specific_title" style="display: none">' . __('Item ', 'formcreator') . '</span>';
echo '</td>';
echo '<td width="25%">';
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

{{ fields.textField('description', item.fields['description'], __('Description')) }}

{{ fields.textareaField('content', item.fields['content'], __('Header', 'formcreator'), { 'enable_richtext': true }) }}
{{ fields.textareaField('content', item.fields['content'], _n('Header', 'Headers', 1, 'formcreator'), { 'enable_richtext': true }) }}

{{ fields.dropdownYesNo('is_default', item.fields['is_default'], __('Default form in service catalog', 'formcreator')) }}

Expand Down
2 changes: 1 addition & 1 deletion templates/pages/question.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
'PluginFormcreatorSection',
'plugin_formcreator_sections_id',
item.fields['plugin_formcreator_sections_id'],
__('Section', 'formcreator'),
_n('Section', 'Sections', 1, 'formcreator'),
{
'display_emptychoice': false,
'condition': {'plugin_formcreator_forms_id': section.fields['plugin_formcreator_forms_id']},
Expand Down

0 comments on commit dc8f38c

Please sign in to comment.