Skip to content

Commit

Permalink
ucfirst → capitalize
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Dec 27, 2024
1 parent 1bfdb2c commit d8f0ee0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

## Development
- The `duration` Twig filter now has a `language` argument. ([#16332](https://github.com/craftcms/cms/pull/16332))
- Deprecated the `ucfirst` Twig filter. `capitalize` should be used instead.

## Extensibility
- `craft\helpers\DateTimeHelper::humanDuration()` now has a `$language` argument. ([#16332](https://github.com/craftcms/cms/pull/16332))
Expand Down
2 changes: 1 addition & 1 deletion src/templates/settings/plugins/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{% switch issue %}
{% case 'wrong_edition' %}
{{ 'This license is for the {name} edition.'|t('app', {
name: config.licensedEdition|ucfirst
name: config.licensedEdition|capitalize,
}) }}
{% case 'no_trials' %}
{{ 'Plugin trials are not allowed on this domain.'|t('app') }}
Expand Down
2 changes: 2 additions & 0 deletions src/web/twig/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,11 @@ public function truncateFilter(string $string, int $length, string $suffix = '
*
* @param mixed $string The multibyte string.
* @return string The string with the first character converted to upercase.
* @deprecated in 4.14.0
*/
public function ucfirstFilter(mixed $string): string
{
Craft::$app->getDeprecator()->log('ucfirst', 'The `|ucfirst` filter has been deprecated. Use `|capitalize` instead.');
return StringHelper::upperCaseFirst((string)$string);
}

Expand Down

0 comments on commit d8f0ee0

Please sign in to comment.