TokenProcessor - If there is a `locale`, then use it
authorTim Otten <totten@civicrm.org>
Tue, 10 Aug 2021 03:55:44 +0000 (20:55 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 10 Aug 2021 23:46:46 +0000 (16:46 -0700)
commit4b7b899badc1312040384e15ffdf23bab7425814
tree97aee4b240d9bcfb81b6b6751cd3a1e2c753de74
parent389aeb7042e4d7e5771f88686d7e69889aaa4ea1
TokenProcessor - If there is a `locale`, then use it

There are two likely ways in which a tokenized email winds up with localized strings - either
the Smarty `{ts}...{/ts}` tags define it, or a custom/hook-based tag uses `ts()`.

This ensures that the locale is set in both cases.

It's hypothetically possible that some other `civi.token.eval` listeners
need to use the `row->context['locale']`.  However, I grepped universe and
couldn't find anything that would be affected.  (There were two contrib
listeners for `civi.token.eval` and neither seemed to be affected.)
Civi/Token/TokenCompatSubscriber.php
Civi/Token/TokenProcessor.php
tests/phpunit/Civi/Token/TokenProcessorTest.php