diff --git a/tests/phpunit/data/languages/ja_JP.mo b/tests/phpunit/data/languages/ja_JP.mo
new file mode 100644
index 0000000000..1399898aa7
Binary files /dev/null and b/tests/phpunit/data/languages/ja_JP.mo differ
diff --git a/tests/phpunit/data/languages/ja_JP.po b/tests/phpunit/data/languages/ja_JP.po
new file mode 100644
index 0000000000..f71a737714
--- /dev/null
+++ b/tests/phpunit/data/languages/ja_JP.po
@@ -0,0 +1,42 @@
+# Translation of 5.0.x in Japanese
+# This file is distributed under the same license as the 4.6.x package.
+msgid ""
+msgstr ""
+"PO-Revision-Date: 2018-04-21 18:27+0900\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Poedit 1.8.10\n"
+"Project-Id-Version: 5.0.x\n"
+"Language: ja_JP\n"
+
+#. translators: Translate this to the correct language tag for your locale, see
+#. https://www.w3.org/International/articles/language-tags/ for reference. Do
+#. not translate into your own language.
+#: wp-includes/general-template.php:716
+msgid "html_lang_attribute"
+msgstr "ja"
+
+#. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress.
+#: wp-includes/class-wp-locale.php:223
+msgctxt "text direction"
+msgid "ltr"
+msgstr "ltr"
+
+#. translators: $dec_point argument for https://secure.php.net/number_format,
+#. default is .
+#: wp-includes/class-wp-locale.php:215
+msgid "number_format_decimal_point"
+msgstr "number_format_decimal_point"
+
+#. translators: $thousands_sep argument for
+#. https://secure.php.net/number_format, default is ,
+#: wp-includes/class-wp-locale.php:202
+msgid "number_format_thousands_sep"
+msgstr "number_format_thousands_sep"
+
+#. translators: %s: Plugin name and version
+#: wp-includes/script-loader.php:620
+msgid "Update %s now"
+msgstr "今すぐ %s を更新"
diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php
index 5cfd3d4f53..4746d32be9 100644
--- a/tests/phpunit/tests/db.php
+++ b/tests/phpunit/tests/db.php
@@ -90,7 +90,7 @@ class Tests_DB extends WP_UnitTestCase {
$current_locales = explode( ';', setlocale( LC_ALL, 0 ) );
// Switch to Russian
- $flag = setlocale( LC_ALL, 'ru_RU.utf8', 'rus', 'fr_FR.utf8', 'fr_FR', 'de_DE.utf8', 'de_DE', 'es_ES.utf8', 'es_ES' );
+ $flag = setlocale( LC_ALL, 'ru_RU.utf8', 'rus', 'fr_FR.utf8', 'fr_FR', 'de_DE.utf8', 'de_DE', 'es_ES.utf8', 'es_ES', 'ja_JP.utf8', 'ja_JP' );
if ( false === $flag ) {
$this->markTestSkipped( 'No European languages available for testing' );
}
diff --git a/tests/phpunit/tests/formatting/BlogInfo.php b/tests/phpunit/tests/formatting/BlogInfo.php
index 3c6f03cbdf..8d513a3ccc 100644
--- a/tests/phpunit/tests/formatting/BlogInfo.php
+++ b/tests/phpunit/tests/formatting/BlogInfo.php
@@ -29,6 +29,7 @@ class Tests_Formatting_BlogInfo extends WP_UnitTestCase {
array( 'de_DE_formal', 'de-DE-formal' ),
array( 'oci', 'oci' ),
array( 'pt_PT_ao1990', 'pt-PT-ao1990' ),
+ array( 'ja_JP', 'ja-JP' ),
);
}
diff --git a/tests/phpunit/tests/l10n.php b/tests/phpunit/tests/l10n.php
index bb0f43d3ce..5173621d2c 100644
--- a/tests/phpunit/tests/l10n.php
+++ b/tests/phpunit/tests/l10n.php
@@ -53,7 +53,7 @@ class Tests_L10n extends WP_UnitTestCase {
$this->assertEmpty( $array );
$array = get_available_languages( DIR_TESTDATA . '/languages/' );
- $this->assertEquals( array( 'de_DE', 'en_GB', 'es_ES' ), $array );
+ $this->assertEquals( array( 'de_DE', 'en_GB', 'es_ES', 'ja_JP' ), $array );
}
/**
@@ -97,6 +97,7 @@ class Tests_L10n extends WP_UnitTestCase {
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
}
/**
@@ -120,6 +121,7 @@ class Tests_L10n extends WP_UnitTestCase {
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
}
/**
@@ -141,6 +143,53 @@ class Tests_L10n extends WP_UnitTestCase {
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
$this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ }
+
+ /**
+ * Add site default language to ja_JP in dropdown
+ */
+ function test_wp_dropdown_languages_site_default_ja_JP() {
+ $args = array(
+ 'id' => 'foo',
+ 'name' => 'bar',
+ 'languages' => array( 'ja_JP' ),
+ 'translations' => $this->wp_dropdown_languages_filter(),
+ 'selected' => 'ja_JP',
+ 'echo' => false,
+ 'show_option_site_default' => true,
+ );
+ $actual = wp_dropdown_languages( $args );
+
+ $this->assertContains( 'id="foo"', $actual );
+ $this->assertContains( 'name="bar"', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ }
+
+ /**
+ * Select dropdown language from de_DE to ja_JP
+ */
+ function test_wp_dropdown_languages_ja_JP_selected() {
+ $args = array(
+ 'id' => 'foo',
+ 'name' => 'bar',
+ 'languages' => array( 'de_DE' ),
+ 'translations' => $this->wp_dropdown_languages_filter(),
+ 'selected' => 'ja_JP',
+ 'echo' => false,
+ );
+ $actual = wp_dropdown_languages( $args );
+
+ $this->assertContains( 'id="foo"', $actual );
+ $this->assertContains( 'name="bar"', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
+ $this->assertContains( '', $actual );
}
/**
@@ -160,6 +209,11 @@ class Tests_L10n extends WP_UnitTestCase {
'native_name' => 'Italiano',
'iso' => array( 'it', 'ita' ),
),
+ 'ja_JP' => array(
+ 'language' => 'ja_JP',
+ 'native_name' => '日本語',
+ 'iso' => array( 'ja' ),
+ ),
);
}
diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js
index fd20726c9d..4e7c172421 100644
--- a/tests/qunit/fixtures/wp-api-generated.js
+++ b/tests/qunit/fixtures/wp-api-generated.js
@@ -2570,7 +2570,8 @@ mockedApiResponse.Schema = {
"en_US",
"de_DE",
"en_GB",
- "es_ES"
+ "es_ES",
+ "ja_JP"
],
"description": "Locale for the user.",
"type": "string"
@@ -2697,7 +2698,8 @@ mockedApiResponse.Schema = {
"en_US",
"de_DE",
"en_GB",
- "es_ES"
+ "es_ES",
+ "ja_JP"
],
"description": "Locale for the user.",
"type": "string"
@@ -2834,7 +2836,8 @@ mockedApiResponse.Schema = {
"en_US",
"de_DE",
"en_GB",
- "es_ES"
+ "es_ES",
+ "ja_JP"
],
"description": "Locale for the user.",
"type": "string"