Quantcast
Viewing all articles
Browse latest Browse all 293221

Replace instances of the deprecated LOCALE_PLURAL_DELIMITER const with Drupal\Core\StringTranslation\PluralTranslatableMarkup::DELIMITER

Problem/Motivation

Various parts of code are using the deprecated LOCALE_PLURAL_DELIMITER const instead of Drupal\Core\StringTranslation\PluralTranslatableMarkup\PluralTranslatableMarkup::DELIMITER which the former just points to anyway.

The reason it should be changed sooner rather than later is that this makes unit testing certain classes much more difficult. For example, when trying to unit test a subclass of Drupal\views\Plugin\views\field\NumericField, I received the following error:

Use of undefined constant LOCALE_PLURAL_DELIMITER - assumed 'LOCALE_PLURAL_DELIMITER'

There are ways around this, but the work has already been done and this issue should just be fixed in core.

Proposed resolution

Replace all instances of LOCALE_PLURAL_DELIMITER with Drupal\Core\StringTranslation\PluralTranslatableMarkup\PluralTranslatableMarkup::DELIMITER. The former already points to the latter anyway, so the current tests should suffice and no additional work should be needed.


Viewing all articles
Browse latest Browse all 293221

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>