diff --git a/tests/phpunit/data/languages/admin-en_GB.mo b/tests/phpunit/data/languages/admin-en_GB.mo new file mode 100644 index 0000000000..690efdb2c2 Binary files /dev/null and b/tests/phpunit/data/languages/admin-en_GB.mo differ diff --git a/tests/phpunit/data/languages/admin-en_GB.po b/tests/phpunit/data/languages/admin-en_GB.po new file mode 100644 index 0000000000..f51e83103e --- /dev/null +++ b/tests/phpunit/data/languages/admin-en_GB.po @@ -0,0 +1,34 @@ +# Translation of Administration in English (UK) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-07 10:23:11+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Administration\n" + +#: wp-admin/about.php:42 wp-admin/credits.php:23 wp-admin/freedoms.php:22 +msgid "Thank you for updating! WordPress %s makes your site more connected and responsive." +msgstr "Thank you for updating! WordPress %s makes your site more connected and responsive." + +#. translators: 1: WP_Term class name, WP_Comment class name, WP_Network class +#. name +#: wp-admin/about.php:185 +msgid "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." +msgstr "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." + +#. translators: WP_Comment_Query class name +#: wp-admin/about.php:178 +msgid "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." +msgstr "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." + +#: wp-admin/about.php:182 +msgid "Term, comment, and network objects" +msgstr "Term, comment, and network objects" + +#: wp-admin/about.php:175 +msgid "Comment query improvements" +msgstr "Comment query improvements" diff --git a/tests/phpunit/data/languages/admin-es_ES.mo b/tests/phpunit/data/languages/admin-es_ES.mo new file mode 100644 index 0000000000..01e87d2ed8 Binary files /dev/null and b/tests/phpunit/data/languages/admin-es_ES.mo differ diff --git a/tests/phpunit/data/languages/admin-es_ES.po b/tests/phpunit/data/languages/admin-es_ES.po new file mode 100644 index 0000000000..445396872f --- /dev/null +++ b/tests/phpunit/data/languages/admin-es_ES.po @@ -0,0 +1,34 @@ +# Translation of Administration in Spanish (Spain) +# This file is distributed under the same license as the Administration package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-22 20:26:46+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Administration\n" + +#: wp-admin/about.php:42 wp-admin/credits.php:23 wp-admin/freedoms.php:22 +msgid "Thank you for updating! WordPress %s makes your site more connected and responsive." +msgstr "¡Gracias por actualizar! WordPress %s hace que tu sitio esté más conectado y sea más adaptable." + +#. translators: 1: WP_Term class name, WP_Comment class name, WP_Network class +#. name +#: wp-admin/about.php:185 +msgid "New %1$s, %2$s, and %3$s objects make interacting with terms, comments, and networks more predictable and intuitive in code." +msgstr "Ahora los objetos %1$s, %2$s y %3$s hacen que interactuar con términos, comentarios y redes sea más predecible y que el código sea más intuitivo." + +#. translators: WP_Comment_Query class name +#: wp-admin/about.php:178 +msgid "Comment queries now have cache handling to improve performance. New arguments in %s make crafting robust comment queries simpler." +msgstr "Las consultas de comentarios ahora tiene una caché que mejora el rendimiento. Nuevos argumentos en %s hacen que sea más fácil crear consultas robustas." + +#: wp-admin/about.php:182 +msgid "Term, comment, and network objects" +msgstr "Objetos de término, comentario y red" + +#: wp-admin/about.php:175 +msgid "Comment query improvements" +msgstr "Mejoras en las consultas de comentarios" diff --git a/tests/phpunit/data/languages/admin-network-en_GB.mo b/tests/phpunit/data/languages/admin-network-en_GB.mo new file mode 100644 index 0000000000..e74c830635 Binary files /dev/null and b/tests/phpunit/data/languages/admin-network-en_GB.mo differ diff --git a/tests/phpunit/data/languages/admin-network-en_GB.po b/tests/phpunit/data/languages/admin-network-en_GB.po new file mode 100644 index 0000000000..3fb0935010 --- /dev/null +++ b/tests/phpunit/data/languages/admin-network-en_GB.po @@ -0,0 +1,32 @@ +# Translation of Network Admin in English (UK) +# This file is distributed under the same license as the Network Admin package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-11-26 00:00:19+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Network Admin\n" + +#: wp-admin/network/site-users.php:329 wp-admin/network/user-new.php:106 +msgid "A password reset link will be sent to the user via email." +msgstr "A password reset link will be sent to the user via email." + +#. translators: 1: NOBLOGREDIRECT 2: wp-config.php +#: wp-admin/network/settings.php:142 +msgid "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." +msgstr "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." + +#: wp-admin/network/site-users.php:42 +msgid "Site users list" +msgstr "Site users list" + +#: wp-admin/network/site-users.php:41 +msgid "Site users list navigation" +msgstr "Site users list navigation" + +#: wp-admin/network/sites.php:51 +msgid "Sites list" +msgstr "Sites list" diff --git a/tests/phpunit/data/languages/admin-network-es_ES.mo b/tests/phpunit/data/languages/admin-network-es_ES.mo new file mode 100644 index 0000000000..0e67cad091 Binary files /dev/null and b/tests/phpunit/data/languages/admin-network-es_ES.mo differ diff --git a/tests/phpunit/data/languages/admin-network-es_ES.po b/tests/phpunit/data/languages/admin-network-es_ES.po new file mode 100644 index 0000000000..037f8792bc --- /dev/null +++ b/tests/phpunit/data/languages/admin-network-es_ES.po @@ -0,0 +1,32 @@ +# Translation of Network Admin in Spanish (Spain) +# This file is distributed under the same license as the Network Admin package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-11-26 00:00:19+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Network Admin\n" + +#: wp-admin/network/site-users.php:329 wp-admin/network/user-new.php:106 +msgid "A password reset link will be sent to the user via email." +msgstr "Se te enviará un enlace por email para que puedas cambiar la contraseña." + +#. translators: 1: NOBLOGREDIRECT 2: wp-config.php +#: wp-admin/network/settings.php:142 +msgid "If registration is disabled, please set %1$s in %2$s to a URL you will redirect visitors to if they visit a non-existent site." +msgstr "Si el registro de usuarios está desactivado , establece como valor de %1$s en %2$s una URL donde redirigir a los visitantes que accedan a un sitio inexistente." + +#: wp-admin/network/site-users.php:41 +msgid "Site users list navigation" +msgstr "Navegación por la lista de usuarios del sitio" + +#: wp-admin/network/site-users.php:42 +msgid "Site users list" +msgstr "Lista de usuarios del sitio" + +#: wp-admin/network/sites.php:50 +msgid "Sites list navigation" +msgstr "Navegación por la lista de sitios" diff --git a/tests/phpunit/data/languages/continents-cities-es_ES.mo b/tests/phpunit/data/languages/continents-cities-es_ES.mo new file mode 100644 index 0000000000..504d237e33 Binary files /dev/null and b/tests/phpunit/data/languages/continents-cities-es_ES.mo differ diff --git a/tests/phpunit/data/languages/continents-cities-es_ES.po b/tests/phpunit/data/languages/continents-cities-es_ES.po new file mode 100644 index 0000000000..5c7ce1c6c5 --- /dev/null +++ b/tests/phpunit/data/languages/continents-cities-es_ES.po @@ -0,0 +1,31 @@ +# Translation of Continents & Cities in Spanish (Spain) +# This file is distributed under the same license as the Continents & Cities package. +msgid "" +msgstr "" +"PO-Revision-Date: 2015-12-29 10:06:29+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Continents & Cities\n" + +#: wp-admin/includes/continents-cities.php:140 +msgid "Vincennes" +msgstr "Vincennes" + +#: wp-admin/includes/continents-cities.php:141 +msgid "Winamac" +msgstr "Winamac" + +#: wp-admin/includes/continents-cities.php:142 +msgid "Inuvik" +msgstr "Inuvik" + +#: wp-admin/includes/continents-cities.php:143 +msgid "Iqaluit" +msgstr "Iqaluit" + +#: wp-admin/includes/continents-cities.php:144 +msgid "Jamaica" +msgstr "Jamaica" diff --git a/tests/phpunit/data/languages/en_GB.mo b/tests/phpunit/data/languages/en_GB.mo new file mode 100644 index 0000000000..b569b3b2c5 Binary files /dev/null and b/tests/phpunit/data/languages/en_GB.mo differ diff --git a/tests/phpunit/data/languages/en_GB.po b/tests/phpunit/data/languages/en_GB.po new file mode 100644 index 0000000000..aeb7f01a0d --- /dev/null +++ b/tests/phpunit/data/languages/en_GB.po @@ -0,0 +1,37 @@ +# Translation of Development (4.4.x) in English (UK) +# This file is distributed under the same license as the Development (4.4.x) package. +msgid "" +msgstr "" +"PO-Revision-Date: 2016-01-14 21:14:29+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Development (4.4.x)\n" + +#. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. +#: wp-includes/locale.php:201 +msgctxt "text direction" +msgid "ltr" +msgstr "ltr" + +#: wp-includes/user.php:2132 +msgid "ERROR: Sorry, that username is not allowed." +msgstr "ERROR: Sorry, that username is not allowed." + +#: wp-includes/rest-api/class-wp-rest-request.php:850 +msgid "Invalid parameter." +msgstr "Invalid parameter." + +#. translators: %s: menu name +#: wp-includes/customize/class-wp-customize-nav-menu-control.php:76 +msgctxt "menu location" +msgid "(Current: %s)" +msgstr "(Current: %s)" + +#. translators: %s: menu location slug +#: wp-includes/class-wp-customize-nav-menus.php:340 +msgctxt "menu" +msgid "(Currently set to: %s)" +msgstr "(Currently set to: %s)" diff --git a/tests/phpunit/data/languages/es_ES.mo b/tests/phpunit/data/languages/es_ES.mo new file mode 100644 index 0000000000..921c9a7dc0 Binary files /dev/null and b/tests/phpunit/data/languages/es_ES.mo differ diff --git a/tests/phpunit/data/languages/es_ES.po b/tests/phpunit/data/languages/es_ES.po new file mode 100644 index 0000000000..005ae62c3b --- /dev/null +++ b/tests/phpunit/data/languages/es_ES.po @@ -0,0 +1,37 @@ +# Translation of Development (4.4.x) in Spanish (Spain) +# This file is distributed under the same license as the Development (4.4.x) package. +msgid "" +msgstr "" +"PO-Revision-Date: 2016-01-07 18:35:45+0000\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: GlotPress/1.0-alpha-1100\n" +"Project-Id-Version: Development (4.4.x)\n" + +#. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. +#: wp-includes/locale.php:201 +msgctxt "text direction" +msgid "ltr" +msgstr "ltr" + +#: wp-includes/user.php:2132 +msgid "ERROR: Sorry, that username is not allowed." +msgstr "ERROR: Lo siento, ese nombre de usuario no está permitido." + +#: wp-includes/rest-api/class-wp-rest-request.php:850 +msgid "Invalid parameter." +msgstr "Parámetro no válido. " + +#. translators: %s: menu name +#: wp-includes/customize/class-wp-customize-nav-menu-control.php:76 +msgctxt "menu location" +msgid "(Current: %s)" +msgstr "(Actual: %s)" + +#. translators: %s: menu location slug +#: wp-includes/class-wp-customize-nav-menus.php:340 +msgctxt "menu" +msgid "(Currently set to: %s)" +msgstr "(Actualmente fijado en: %s)" diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 19aa9a446c..d85799a910 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -26,6 +26,8 @@ require_once $config_file_path; define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' ); +define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' ); + if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) define( 'WP_TESTS_FORCE_KNOWN_BUGS', false ); diff --git a/tests/phpunit/tests/l10n.php b/tests/phpunit/tests/l10n.php index 62e89ceac9..2d55bb282b 100644 --- a/tests/phpunit/tests/l10n.php +++ b/tests/phpunit/tests/l10n.php @@ -46,4 +46,26 @@ class Tests_L10n extends WP_UnitTestCase { __( 'just some string', 'wp-tests-domain' ); $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) ); } + + /** + * @ticket 35284 + */ + function test_wp_get_installed_translations_for_core() { + $installed_translations = wp_get_installed_translations( 'core' ); + $this->assertInternalType( 'array', $installed_translations ); + $textdomains_expected = array( 'admin', 'admin-network', 'continents-cities', 'default' ); + $this->assertEqualSets( $textdomains_expected, array_keys( $installed_translations ) ); + + $this->assertNotEmpty( $installed_translations['default']['en_GB'] ); + $data_en_GB = $installed_translations['default']['en_GB']; + $this->assertEquals( '2016-01-14 21:14:29+0000', $data_en_GB['PO-Revision-Date'] ); + $this->assertEquals( 'Development (4.4.x)', $data_en_GB['Project-Id-Version'] ); + $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_en_GB['X-Generator'] ); + + $this->assertNotEmpty( $installed_translations['admin']['es_ES'] ); + $data_es_ES = $installed_translations['admin']['es_ES']; + $this->assertEquals( '2015-12-22 20:26:46+0000', $data_es_ES['PO-Revision-Date'] ); + $this->assertEquals( 'Administration', $data_es_ES['Project-Id-Version'] ); + $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_es_ES['X-Generator'] ); + } }