Skip to content

Commit

Permalink
pkp#8598 Code Base locale changes
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Feb 8, 2023
1 parent 6d3bcb2 commit 2b6427c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classes/cliTool/InstallTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function readParams()

// Locale Settings
$this->printTitle('installer.localeSettings');
$this->readParamOptions('locale', 'locale.primary', $installForm->supportedLocales, 'en_US');
$this->readParamOptions('locale', 'locale.primary', $installForm->supportedLocales, 'en');
$this->readParamOptions('additionalLocales', 'installer.additionalLocales', $installForm->supportedLocales, '', true);

// File Settings
Expand Down
2 changes: 1 addition & 1 deletion classes/i18n/interfaces/LocaleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
interface LocaleInterface extends \Illuminate\Contracts\Translation\Translator
{
/** Keeps the default locale of the application */
public const DEFAULT_LOCALE = 'en_US';
public const DEFAULT_LOCALE = 'en';

/** Regular expression to validate and extract pieces of a locale, variants can be composed of five to eight letters, or of four characters starting with a digit */
public const LOCALE_EXPRESSION = '/^(?P<language>[a-z]{2})(?:_(?P<country>[A-Z]{2}))?(?:@(?P<script>[A-Za-z\d]{5,8}|\d[A-Za-z\d]{3}))?$/';
Expand Down
2 changes: 1 addition & 1 deletion classes/install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Installer
public const INSTALLER_ERROR_DB = 2;

public const INSTALLER_DATA_DIR = 'dbscripts/xml';
public const INSTALLER_DEFAULT_LOCALE = 'en_US';
public const INSTALLER_DEFAULT_LOCALE = 'en';

/** @var string descriptor path (relative to INSTALLER_DATA_DIR) */
public $descriptor;
Expand Down
4 changes: 2 additions & 2 deletions classes/migration/install/CommonMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function up(): void
$table->bigInteger('redirect')->default(0)->comment('If not 0, redirect to the specified journal/conference/... site.');
$table->string('primary_locale', 14)->comment('Primary locale for the site.');
$table->smallInteger('min_password_length')->default(6);
$table->string('installed_locales', 1024)->default('en_US')->comment('Locales for which support has been installed.');
$table->string('installed_locales', 1024)->default('en')->comment('Locales for which support has been installed.');
$table->string('supported_locales', 1024)->comment('Locales supported by the site (for hosted journals/conferences/...).')->nullable();
$table->string('original_style_file_name', 255)->nullable();
});
Expand Down Expand Up @@ -196,7 +196,7 @@ public function up(): void
// Default data for email templates.
Schema::create('email_templates_default_data', function (Blueprint $table) {
$table->string('email_key', 255)->comment('Unique identifier for this email.');
$table->string('locale', 14)->default('en_US');
$table->string('locale', 14)->default('en');
$table->string('name', 255);
$table->string('subject', 255);
$table->text('body')->nullable();
Expand Down
2 changes: 1 addition & 1 deletion tests/config/config.TEMPLATE.mysql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
web_cache_hours = 1

[i18n]
locale = en_US
locale = en
connection_charset = utf8

[files]
Expand Down
2 changes: 1 addition & 1 deletion tools/buildSwagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function execute()
exit;
}

$locales = ['en_US', 'fr_CA'];
$locales = ['en', 'fr_CA'];

$apiSchema = json_decode($source);
foreach ($apiSchema->definitions as $definitionName => $definition) {
Expand Down
4 changes: 2 additions & 2 deletions xml/schema/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</field>
<field name="installed_locales" type="C2" size="1024">
<NOTNULL/>
<DEFAULT VALUE="en_US"/>
<DEFAULT VALUE="en"/>
<descr>Locales for which support has been installed.</descr>
</field>
<field name="supported_locales" type="C2" size="1024">
Expand Down Expand Up @@ -456,7 +456,7 @@
</field>
<field name="locale" type="C2" size="14">
<NOTNULL />
<DEFAULT VALUE="en_US"/>
<DEFAULT VALUE="en"/>
</field>
<field name="subject" type="C2" size="120">
<NOTNULL/>
Expand Down

0 comments on commit 2b6427c

Please sign in to comment.