Skip to content

Commit

Permalink
Use curly brackets for translation placeholders instead of sprintf style
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kleiner committed May 21, 2023
1 parent 42b26d6 commit 7cef5d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ en:
PublicDefinition_Description: 'Shown to users on the front-end; a brief definition of the term for those who view taxonomy terms as tags or filters.'
URLSegment_Description: 'A unique identifier used by the CMS (e.g. in URL filter parameters), which must be unique across all terms and taxonomies. It will be automatically generated from <i><b>Name</b></i>, if left blank. Use lower case, URL-safe characters, no spaces. Avoid parentheses. Required.'
InternalOnly_Description: 'When enabled, the taxonomy will be available for tagging by authors, and in various CMS configuration settings, but won’t be shown or made directly accessible to users. If disabled, the terms in this taxonomy will be displayed throughout the site as tags, labels and within filter options (e.g. during the listing and searching of content).'
SingleSelect_Checked_Readonly_Description: 'This taxonomy has been permanently configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. If you wish to enable multi-select, all tags from the taxonomy must be removed from all content (not recommended). Currently, at least one %s has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Checked_Readonly_Description: 'This taxonomy has been permanently configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. If you wish to enable multi-select, all tags from the taxonomy must be removed from all content (not recommended). Currently, at least one {taggedClass} has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Checked_Description: 'This taxonomy has been configured to prevent more than one term being tagged to any individual content item. Typically, this is due to the mutually exclusive nature of the terms. As soon as any term from the associated taxonomy is tagged to any content item, this option will become permanently set. As none of the terms have yet been used as tags, you can still disable this option.'
SingleSelect_Readonly_Description: 'This taxonomy type has been permanently configured to allow more than one term to be tagged to any individual content item. Typically, this is due to the synergistic nature of the terms. If you wish to enable single select, all tags from this taxonomy must be removed from all content (not recommended). Currently, at least one %s has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Readonly_Description: 'This taxonomy type has been permanently configured to allow more than one term to be tagged to any individual content item. Typically, this is due to the synergistic nature of the terms. If you wish to enable single select, all tags from this taxonomy must be removed from all content (not recommended). Currently, at least one {taggedClass} has been tagged, possibly others. You might want to consider creating a new taxonomy instead.'
SingleSelect_Description: 'If your taxonomy includes mutually exclusive terms or concepts, you <b>might</b> want to enable this option. It will restrict authors from applying more than one tag at a time to any individual content item. Caution: once enabled, this option is not intended to be turned off again; once content has been tagged with single select taxonomy terms, this option becomes permanently enabled.'
RequiredTypes_Description: 'Required taxonomies will prompt admins to select a term from these other taxonomies, too, when this current term is assigned to a page, block or file etc. If required taxonomies are set on the root term, then all descendant terms will inherit the requirements. Inheritance can be manually overridden, and further requirements set, on individual terms.'
Terms_Description: 'This is a flattened (non-hierarchical) list of all the descendant terms within this taxonomy. This is useful when you need a quick view of all the terms, as it saves you navigating through multiple child term screens.'
7 changes: 4 additions & 3 deletions src/Models/TaxonomyTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ public function getCMSFields()
// provide description for different combination of states from the lang file
$singleSelectDescription = _t(
static::class
. '.SingleSelect' . ($checked ? '_Checked' : '') . ($readonly ? '_Readonly' : '') . '_Description'
);
$singleSelectField->setDescription(sprintf($singleSelectDescription, $taggedClass));
. '.SingleSelect' . ($checked ? '_Checked' : '') . ($readonly ? '_Readonly' : '') . '_Description',
null,
['taggedClass' => $taggedClass]);
$singleSelectField->setDescription($singleSelectDescription);
}


Expand Down

0 comments on commit 7cef5d2

Please sign in to comment.