Skip to content

Commit

Permalink
Merge pull request #86 from openeuropa/OPENEUROPA-2111
Browse files Browse the repository at this point in the history
OPENEUROPA-2111: Remove English translations.
  • Loading branch information
nagyad authored Sep 5, 2019
2 parents 20f098c + 95ae388 commit 1cd1f8e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ The OpenEuropa Multilingual module offers default multilingual features for the
- Enable all 24 official EU languages
- Provide an optional language switcher block on the [OpenEuropa Theme][1] site header region
- Make sure that the administrative interface is always set to English
- Allow English to be translated so that the default English copy may be fixed or improved, if necessary

**Table of contents:**

Expand Down Expand Up @@ -183,6 +182,14 @@ In order to install the OpenEuropa Multilingual demo module follow [the instruct
./vendor/bin/drush en oe_multilingual_demo -y
```

## Known Issues

##### Enabling string English string translation

Enabling English string translation can have unintended consequences when making changes to translatable configuration entities.
If these strings are available in locale, the change would get saved as EN translations.


## Contributing

Please read [the full documentation](https://github.com/openeuropa/openeuropa) for details on our code of conduct, and the process for submitting pull requests to us.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"openeuropa/drupal-core-require-dev": "^8.7",
"openeuropa/task-runner": "~1.0@beta",
"phpunit/phpunit": "~6.0",
"symfony/browser-kit": "~3.0 || ~4.0"
"symfony/browser-kit": "~3.0 || ~4.0",
"behat/mink-selenium2-driver": "1.4.x-dev as 1.3.x-dev"
},
"scripts": {
"post-install-cmd": "./vendor/bin/run drupal:site-setup",
Expand Down
1 change: 0 additions & 1 deletion oe_multilingual.install
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function oe_multilingual_install() {
\Drupal::configFactory()
->getEditable('locale.settings')
->set('translation.import_enabled', FALSE)
->set('translate_english', TRUE)
->save();

// Make sure that English language prefix is set to "en".
Expand Down
4 changes: 3 additions & 1 deletion tests/Behat/InterfaceTranslationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public function translateString(string $string, string $language, string $value)

$source = $locale_storage->findString(['source' => $string]);
if (!$source instanceof SourceString) {
throw new \Exception(sprintf('Missing string to translate: %s', $source));
// We need to make sure the string is available to be translated.
$source = $locale_storage->createString();
$source->setString($string)->save();
}

// Backup existing translation.
Expand Down
4 changes: 2 additions & 2 deletions tests/Kernel/InstallationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public function testInstallation(): void {
// Ensure that remote translations downloading is disabled by default.
$this->assertEquals(FALSE, $config->get('translation.import_enabled'));

// Ensure that the English language is translatable.
$this->assertEquals(TRUE, $config->get('translate_english'));
// Ensure that the English language is not translatable.
$this->assertEquals(FALSE, $config->get('translate_english'));

$interface_settings = [
LanguageNegotiationAdmin::METHOD_ID => -20,
Expand Down

0 comments on commit 1cd1f8e

Please sign in to comment.