Skip to content

Commit

Permalink
Merge pull request #25063 from eileenmcnaughton/local
Browse files Browse the repository at this point in the history
Default to supporting partial locales
  • Loading branch information
seamuslee001 authored Feb 6, 2023
2 parents 4a88ef8 + ee051a3 commit 13c4bec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion settings/Localization.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
'name' => 'partial_locales',
'type' => 'Boolean',
'quick_form_type' => 'YesNo',
'default' => '0',
'default' => '1',
'add' => '5.54',
'title' => ts('Partial Locales'),
'is_domain' => 1,
Expand Down
11 changes: 6 additions & 5 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3261,7 +3261,7 @@ public function getThousandSeparators() {
*
* @return array
*/
public function getBooleanDataProvider() {
public function getBooleanDataProvider(): array {
return [[TRUE], [FALSE]];
}

Expand All @@ -3270,14 +3270,15 @@ public function getBooleanDataProvider() {
*
* Note that this only covers some common scenarios.
*
* It does not cater for a situation where the thousand separator is a [space]
* Latter is the Norwegian localization. At least some tests need to
* use setMonetaryDecimalPoint and setMonetaryThousandSeparator directly
* to provide broader coverage.
* Most notably it tests our legacy way of setting currency separators.
*
* It is now preferred to use the locale instead. This test disables partial_locales
* in order to test our legacy method.
*
* @param string $thousandSeparator
*/
protected function setCurrencySeparators(string $thousandSeparator): void {
Civi::settings()->set('partial_locales', FALSE);
Civi::settings()->set('monetaryThousandSeparator', $thousandSeparator);
Civi::settings()->set('monetaryDecimalPoint', ($thousandSeparator === ',' ? '.' : ','));
}
Expand Down

0 comments on commit 13c4bec

Please sign in to comment.