summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-04-16 13:57:44 (GMT)
committerAlex Pott2014-04-16 13:58:39 (GMT)
commitec9d52ba436dff3564df57989c7833b572ee5fd2 (patch)
treee87ec5fc6cd86c93e18a8af8c910536d3f739b5e
parent85392bfe35bca66508f2b108ff4414f1dd5052ad (diff)
Issue #2017475 by rodrigoaguilera, Outi, balagan: Multilingual tour for interface translation section.
-rw-r--r--core/modules/locale/config/tour.tour.locale.yml77
-rw-r--r--core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslateStringTourTest.php58
2 files changed, 135 insertions, 0 deletions
diff --git a/core/modules/locale/config/tour.tour.locale.yml b/core/modules/locale/config/tour.tour.locale.yml
new file mode 100644
index 0000000..e3f6d8d
--- /dev/null
+++ b/core/modules/locale/config/tour.tour.locale.yml
@@ -0,0 +1,77 @@
+id: locale
+module: locale
+label: 'Translation'
+langcode: en
+routes:
+ - route_name: locale.translate_page
+tips:
+ locale-overview:
+ id: locale-overview
+ plugin: text
+ label: 'User interface translation'
+ body: 'This page allows you to translate the user interface or modify existing translations. If you have installed your site initially in English, you must first add another language on the <a href="[site:url]/admin/config/regional/language">Languages page</a>, in order to use this page.'
+ weight: 1
+
+ locale-language:
+ id: locale-language
+ plugin: text
+ label: 'Translation language'
+ body: 'Choose the language you want to translate.'
+ weight: 2
+ attributes:
+ data-id: edit-langcode
+
+ locale-search:
+ id: locale-search
+ plugin: text
+ label: 'Search'
+ body: 'Enter the specific word or sentence you want to translate, you can also write just a part of a word.'
+ weight: 3
+ attributes:
+ data-id: edit-string
+
+ locale-filter:
+ id: locale-filter
+ plugin: text
+ label: 'Filter the search'
+ body: 'You can search for untranslated strings if you want to translate something that isn''t translated yet. If you want to modify an existing translation, you might want to search only for translated strings.'
+ weight: 4
+ attributes:
+ data-id: edit-translation
+
+ locale-submit:
+ id: locale-submit
+ plugin: text
+ label: 'Apply your search criteria'
+ body: 'To apply your search criteria, click on the <em>Filter</em> button.'
+ weight: 5
+ attributes:
+ data-id: edit-submit
+
+ locale-translate:
+ id: locale-translate
+ plugin: text
+ label: 'Translate'
+ body: 'You can write your own translation in the text fields of the right column. Try to figure out in which context the text will be used in order to translate it in the appropriate way.'
+ weight: 6
+ attributes:
+ data-class: form-type-textarea
+
+ locale-validate:
+ id: locale-validate
+ plugin: text
+ label: 'Validate the translation'
+ body: 'When you have finished your translations, click on the <em>Save translations</em> button. You must save your translations, each time before changing the page or making a new search.'
+ weight: 7
+ attributes:
+ data-id: edit-submit--2
+
+ locale-continue:
+ id: locale-continue
+ plugin: text
+ label: 'Continuing on'
+ body: 'The translations you have made here will be used on your site''s user interface. If you want to use them on another site or modify them on an external translation editor, you can <a href="[site:url]/admin/config/regional/translate/export">export them</a> to a .po file and <a href="[site:url]/admin/config/regional/translate/import">import them</a> later.'
+ weight: 8
+dependencies:
+ module:
+ - locale
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslateStringTourTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslateStringTourTest.php
new file mode 100644
index 0000000..10db3b9
--- /dev/null
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslateStringTourTest.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\locale\Tests\LocaleTranslateStringTourTest.
+ */
+
+namespace Drupal\locale\Tests;
+
+use Drupal\tour\Tests\TourTestBase;
+
+/**
+ * Tests tour functionality.
+ */
+class LocaleTranslateStringTourTest extends TourTestBase {
+
+ /**
+ * An admin user with administrative permissions to translate.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = array('locale', 'tour');
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Translate Interface tour tests',
+ 'description' => 'Tests the Translate Interface tour.',
+ 'group' => 'Tour',
+ );
+ }
+
+ protected function setUp() {
+ parent::setUp();
+ $this->adminUser = $this->drupalCreateUser(array('translate interface', 'access tour', 'administer languages'));
+ $this->drupalLogin($this->adminUser);
+ }
+
+ /**
+ * Tests locale tour tip availability.
+ */
+ public function testTranslateStringTourTips() {
+ // Add Another Language so there is no missing form items
+ $edit = array();
+ $edit['predefined_langcode'] = 'es';
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+
+ $this->drupalGet('admin/config/regional/translate');
+ $this->assertTourTips();
+ }
+
+}