Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ $config = [
*/
'language.available' => [
'en', 'no', 'nn', 'se', 'da', 'de', 'sv', 'fi', 'es', 'ca', 'fr', 'it', 'nl', 'lb',
'cs', 'sk', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt-br', 'tr', 'ja', 'zh', 'zh-tw',
'cs', 'sk', 'sl', 'lt', 'hr', 'hu', 'pl', 'pt', 'pt_BR', 'tr', 'ja', 'zh', 'zh_TW',
'ru', 'et', 'he', 'id', 'sr', 'lv', 'ro', 'eu', 'el', 'af', 'zu', 'xh', 'st',
],
'language.rtl' => ['ar', 'dv', 'fa', 'ur', 'he'],
Expand Down
7 changes: 5 additions & 2 deletions docs/simplesamlphp-upgrade-notes-2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ The following properties were marked `deprecated` and will be removed in a next

## BC break

Plain-text admin-passwords are no longer allowed.
Please use the `bin/pwgen.php` script to generate a secure password hash.
- Plain-text admin-passwords are no longer allowed.
Please use the `bin/pwgen.php` script to generate a secure password hash.

- The language codes `pt-br` and `zh-tw` have been renamed to `pt_BR` and `zh_TW`.
Please update your configuration to match the new names.
10 changes: 5 additions & 5 deletions src/SimpleSAML/Locale/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace SimpleSAML\Locale;

use SimpleSAML\{Configuration, Logger, Utils};
use Symfony\Component\Intl\Languages;
use Symfony\Component\Intl\Locales;

use function array_fill_keys;
use function array_key_exists;
Expand Down Expand Up @@ -114,7 +114,7 @@ public function __construct(
/**
* Filter configured (available) languages against installed languages.
*
* @return string[] The set of languages both in 'language.available' and Languages::getNames().
* @return string[] The set of languages both in 'language.available' and Locales::getNames().
*/
private function getInstalledLanguages(): array
{
Expand All @@ -124,7 +124,7 @@ private function getInstalledLanguages(): array
);
$availableLanguages = [];
foreach ($configuredAvailableLanguages as $code) {
if (Languages::exists($code)) {
if (Locales::exists($code)) {
$availableLanguages[] = $code;
} else {
Logger::error("Language \"$code\" not installed. Check config.");
Expand Down Expand Up @@ -219,8 +219,8 @@ public function getLanguage(): string
*/
public function getLanguageLocalizedName(string $code): ?string
{
if (Languages::exists($code)) {
return Languages::getName($code);
if (Locales::exists($code)) {
return Locales::getName($code);
}
Logger::error("Name for language \"$code\" not found. Check config.");
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleSAML/Locale/Localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use Gettext\Loader\{MoLoader, PoLoader};
use Gettext\{Translations, Translator, TranslatorFunctions};
use SimpleSAML\{Configuration, Logger};
use Symfony\Component\HttpFoundation\File\File;
use SimpleSAML\Locale\Translate;
use Symfony\Component\HttpFoundation\File\File;

use function explode;
use function is_dir;
Expand Down