Skip to content

Commit

Permalink
Revert "Improve range formatting"
Browse files Browse the repository at this point in the history
This reverts commit 4f16229.

Fixes #11980
  • Loading branch information
brandonkelly committed Sep 21, 2022
1 parent 329bcfa commit 41517b3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
- Fixed a bug where the “New category” button could be missing from the Categories index page. ([#11977](https://github.com/craftcms/cms/issues/11977))
- Fixed a bug where `Craft::t()` and the `|t` Twig filter were modifying digit-dash-digit sequences. ([#11980](https://github.com/craftcms/cms/issues/11980))

## 3.7.55 - 2022-09-20

Expand Down
3 changes: 0 additions & 3 deletions src/i18n/I18N.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,6 @@ public function translate($category, $message, $params, $language)
}
}

// Normalize ranges to use thin spaces and en-dashes (see https://clagnut.com/blog/2419)
$translation = preg_replace('/(?<=\d) ?(?:-|–|—) ?(?=\d)/', ' – ', $translation);

if ($this->_shouldAddTranslationDebugOutput()) {
switch ($category) {
case 'site':
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/web/assets/cp/src/js/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ $.extend(Craft, {
}

if (params) {
message = this.formatMessage(message, params);
return this.formatMessage(message, params);
}

// Normalize ranges to use thin spaces and en-dashes (see https://clagnut.com/blog/2419)
return message.replace(/(\d) ?(?:-|–|—) ?(\d)/, '$1 – $2', message);
return message;
},

formatMessage: function (pattern, args) {
Expand Down

0 comments on commit 41517b3

Please sign in to comment.