]> BookStack Code Mirror - bookstack/commitdiff
Removed old Translation Service + Provider
authorDan Brown <redacted>
Fri, 18 Oct 2019 23:02:20 +0000 (00:02 +0100)
committerDan Brown <redacted>
Fri, 18 Oct 2019 23:04:49 +0000 (00:04 +0100)
Was no longer needed due to only being there to perform
language extension for de_informal but now this is done by crowdin
instead so it's redundant. Same goes for checking and formatting
scripts.

Also removed comment advising deletion form settings.php language list
since this is now auto-copied to languages anyway.

Related to #1261

28 files changed:
app/Config/app.php
app/Providers/TranslationServiceProvider.php [deleted file]
app/Translation/Translator.php [deleted file]
resources/lang/ar/settings.php
resources/lang/check.php [deleted file]
resources/lang/cs/settings.php
resources/lang/de/settings.php
resources/lang/de_informal/settings.php
resources/lang/en/settings.php
resources/lang/es/settings.php
resources/lang/es_AR/settings.php
resources/lang/format.php [deleted file]
resources/lang/fr/settings.php
resources/lang/hu/settings.php
resources/lang/it/settings.php
resources/lang/ja/settings.php
resources/lang/ko/settings.php
resources/lang/nl/settings.php
resources/lang/pl/settings.php
resources/lang/pt_BR/settings.php
resources/lang/ru/settings.php
resources/lang/sk/settings.php
resources/lang/sv/settings.php
resources/lang/tr/settings.php
resources/lang/uk/settings.php
resources/lang/zh_CN/settings.php
resources/lang/zh_TW/settings.php
tests/LanguageTest.php

index 85b89246502bbd41732e3d8fd00c845379398809..f2c90c5bb25bddb216588ac63115e2aa1a3cac4a 100755 (executable)
@@ -96,6 +96,7 @@ return [
         Illuminate\Redis\RedisServiceProvider::class,
         Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
         Illuminate\Session\SessionServiceProvider::class,
+        Illuminate\Translation\TranslationServiceProvider::class,
         Illuminate\Validation\ValidationServiceProvider::class,
         Illuminate\View\ViewServiceProvider::class,
         Illuminate\Notifications\NotificationServiceProvider::class,
@@ -109,7 +110,6 @@ return [
 
         // BookStack replacement service providers (Extends Laravel)
         BookStack\Providers\PaginationServiceProvider::class,
-        BookStack\Providers\TranslationServiceProvider::class,
 
         // BookStack custom service providers
         BookStack\Providers\AuthServiceProvider::class,
diff --git a/app/Providers/TranslationServiceProvider.php b/app/Providers/TranslationServiceProvider.php
deleted file mode 100644 (file)
index 7d51cc7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php namespace BookStack\Providers;
-
-use BookStack\Translation\Translator;
-
-class TranslationServiceProvider extends \Illuminate\Translation\TranslationServiceProvider
-{
-    /**
-     * Register the service provider.
-     *
-     * @return void
-     */
-    public function register()
-    {
-        $this->registerLoader();
-
-        $this->app->singleton('translator', function ($app) {
-            $loader = $app['translation.loader'];
-
-            // When registering the translator component, we'll need to set the default
-            // locale as well as the fallback locale. So, we'll grab the application
-            // configuration so we can easily get both of these values from there.
-            $locale = $app['config']['app.locale'];
-
-            $trans = new Translator($loader, $locale);
-
-            $trans->setFallback($app['config']['app.fallback_locale']);
-
-            return $trans;
-        });
-    }
-}
diff --git a/app/Translation/Translator.php b/app/Translation/Translator.php
deleted file mode 100644 (file)
index 032f43f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php namespace BookStack\Translation;
-
-class Translator extends \Illuminate\Translation\Translator
-{
-
-    /**
-     * Mapping of locales to their base locales
-     * @var array
-     */
-    protected $baseLocaleMap = [
-        'de_informal' => 'de',
-    ];
-
-    /**
-     * Get the translation for a given key.
-     *
-     * @param  string  $key
-     * @param  array   $replace
-     * @param  string  $locale
-     * @return string|array|null
-     */
-    public function trans($key, array $replace = [], $locale = null)
-    {
-        $translation = $this->get($key, $replace, $locale);
-
-        if (is_array($translation)) {
-            $translation = $this->mergeBackupTranslations($translation, $key, $locale);
-        }
-
-        return $translation;
-    }
-
-    /**
-     * Merge the fallback translations, and base translations if existing,
-     * into the provided core key => value array of translations content.
-     * @param array $translationArray
-     * @param string $key
-     * @param null $locale
-     * @return array
-     */
-    protected function mergeBackupTranslations(array $translationArray, string $key, $locale = null)
-    {
-        $fallback = $this->get($key, [], $this->fallback);
-        $baseLocale = $this->getBaseLocale($locale ?? $this->locale);
-        $baseTranslations = $baseLocale ? $this->get($key, [], $baseLocale) : [];
-
-        return array_replace_recursive($fallback, $baseTranslations, $translationArray);
-    }
-
-    /**
-     * Get the array of locales to be checked.
-     *
-     * @param  string|null  $locale
-     * @return array
-     */
-    protected function localeArray($locale)
-    {
-        $primaryLocale = $locale ?: $this->locale;
-        return array_filter([$primaryLocale, $this->getBaseLocale($primaryLocale), $this->fallback]);
-    }
-
-    /**
-     * Get the locale to extend for the given locale.
-     *
-     * @param string $locale
-     * @return string|null
-     */
-    protected function getBaseLocale($locale)
-    {
-        return $this->baseLocaleMap[$locale] ?? null;
-    }
-}
index d886bc54db535087797c20832a33885f41679e55..d867e30b51301e6f3f247a3986991830248ffd46 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'تم ربط حساب :socialAccount بملفك بنجاح.',
     'users_social_disconnected' => 'تم فصل حساب :socialAccount من ملفك بنجاح.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
diff --git a/resources/lang/check.php b/resources/lang/check.php
deleted file mode 100755 (executable)
index 92a7b1e..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/**
- * Compares translation files to find missing and redundant content.
- */
-
-$args = array_slice($argv, 1);
-
-if (count($args) === 0) {
-    errorOut("Please provide a language code as the first argument (./check.php fr)");
-}
-
-
-// Get content from files
-$lang = formatLang($args[0]);
-$enContent = loadLang('en');
-$langContent = loadLang($lang);
-
-if (count($langContent) === 0) {
-    errorOut("No language content found for '{$lang}'");
-}
-
-info("Checking '{$lang}' translation content against 'en'");
-
-// Track missing lang strings
-$missingLangStrings = [];
-foreach ($enContent as $enKey => $enStr) {
-    if (strpos($enKey, 'settings.language_select.') === 0) {
-        unset($langContent[$enKey]);
-        continue;
-    }
-    if (!isset($langContent[$enKey])) {
-        $missingLangStrings[$enKey] = $enStr;
-        continue;
-    }
-    unset($langContent[$enKey]);
-}
-
-if (count($missingLangStrings) > 0) {
-    info("\n========================");
-    info("Missing language content");
-    info("========================");
-    outputFlatArray($missingLangStrings, $lang);
-}
-
-if (count($langContent) > 0) {
-    info("\n==========================");
-    info("Redundant language content");
-    info("==========================");
-    outputFlatArray($langContent, $lang);
-}
-
-function outputFlatArray($arr, $lang) {
-    $grouped = [];
-    foreach ($arr as $key => $val) {
-        $explodedKey = explode('.', $key);
-        $group = $explodedKey[0];
-        $path = implode('.', array_slice($explodedKey, 1));
-        if (!isset($grouped[$group])) $grouped[$group] = [];
-        $grouped[$group][$path] = $val;
-    }
-    foreach ($grouped as $filename => $arr) {
-        echo "\e[36m" . $lang . '/' . $filename . ".php\e[0m\n";
-        echo json_encode($arr, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE) . "\n";
-    }
-}
-
-function formatLang($lang) {
-    $langParts = explode('_', strtoupper($lang));
-    $langParts[0] = strtolower($langParts[0]);
-    return implode('_', $langParts);
-}
-
-function loadLang(string $lang) {
-    $dir = __DIR__ . "/{$lang}";
-    if (!file_exists($dir)) {
-       errorOut("Expected directory '{$dir}' does not exist");
-    }
-    $files = scandir($dir);
-    $data = [];
-    foreach ($files as $file) {
-        if (substr($file, -4) !== '.php') continue;
-        $fileData = include ($dir . '/' . $file);
-        $name = substr($file, 0, -4);
-        $data[$name] = $fileData;
-    }
-    return flattenArray($data);
-}
-
-function flattenArray(array $arr) {
-    $data = [];
-    foreach ($arr as $key => $arrItem) {
-        if (!is_array($arrItem)) {
-            $data[$key] = $arrItem;
-            continue;
-        }
-
-        $toUse = flattenArray($arrItem);
-        foreach ($toUse as $innerKey => $item) {
-            $data[$key . '.' . $innerKey] = $item;
-        }
-    }
-    return $data;
-}
-
-function info($text) {
-    echo "\e[34m" . $text . "\e[0m\n";
-}
-
-function errorOut($text) {
-    echo "\e[31m" . $text . "\e[0m\n";
-    exit(1);
-}
\ No newline at end of file
index 7a29bd477c5d5f7c6c46bf9d7f9e8bcdd45b3fca..bb6e6be09ac8e9a90f8d0cf3cf129949dbde1bce 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'Účet :socialAccount byl úspěšně přidružen k vašemu profilu.',
     'users_social_disconnected' => 'Přidružení účtu :socialAccount k vašemu profilu bylo úspěšně zrušeno.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 244b9af0760ecbd1a6c4cd26e4086364ee43c841..fa7df43f8893c8eaeab6487d112e09612a190cda 100644 (file)
@@ -138,9 +138,8 @@ Hinweis: Benutzer können ihre E-Mail Adresse nach erfolgreicher Registrierung 
     'users_social_connected' => ':socialAccount-Konto wurde erfolgreich mit dem Profil verknüpft.',
     'users_social_disconnected' => ':socialAccount-Konto wurde erfolgreich vom Profil gelöst.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index aecf5c977baf92744d52c823aa1e18328302b9fe..ed8d8a11fc76aa4f873d12eebf617756bbc9804a 100644 (file)
@@ -138,9 +138,8 @@ Hinweis: Benutzer können ihre E-Mail Adresse nach erfolgreicher Registrierung 
     'users_social_connected' => ':socialAccount-Konto wurde erfolgreich mit dem Profil verknüpft.',
     'users_social_disconnected' => ':socialAccount-Konto wurde erfolgreich vom Profil gelöst.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 14e5ae3b021eeef16b65fc1e26cafe359ac6295b..63b6f6d43b28303bdebb430578233044920e172d 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount account was successfully attached to your profile.',
     'users_social_disconnected' => ':socialAccount account was successfully disconnected from your profile.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 1a3329b940be1934eb56065407ca6cd07365291d..f448bdd22e9834e626d73c49682012e6df2d416d 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'La cuenta :socialAccount ha sido añadida éxitosamente a su perfil.',
     'users_social_disconnected' => 'La cuenta :socialAccount ha sido desconectada éxitosamente de su perfil.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 3b369857467382efb0d12e4efddd7507d833ef0b..e9aad712896cb43d303c8f2525dab00d4dc9fbb8 100644 (file)
@@ -136,9 +136,8 @@ return [
     'users_social_connected' => 'La cuenta :socialAccount ha sido exitosamente añadida a su perfil.',
     'users_social_disconnected' => 'La cuenta :socialAccount ha sido desconectada exitosamente de su perfil.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
diff --git a/resources/lang/format.php b/resources/lang/format.php
deleted file mode 100755 (executable)
index 45d0b48..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/**
- * Format a language file in the same way as the EN equivalent.
- * Matches the line numbers of translated content.
- * Potentially destructive, Ensure you have a backup of your translation content before running.
- */
-
-$args = array_slice($argv, 1);
-
-if (count($args) < 2) {
-    errorOut("Please provide a language code as the first argument and a translation file name, or '--all', as the second (./format.php fr activities)");
-}
-
-$lang = formatLocale($args[0]);
-$fileName = explode('.', $args[1])[0];
-$fileNames = [$fileName];
-if ($fileName === '--all') {
-    $fileNames = getTranslationFileNames();
-}
-
-foreach ($fileNames as $fileName) {
-    $formatted = formatFileContents($lang, $fileName);
-    writeLangFile($lang, $fileName, $formatted);
-}
-
-
-/**
- * Format the contents of a single translation file in the given language.
- * @param string $lang
- * @param string $fileName
- * @return string
- */
-function formatFileContents(string $lang, string $fileName) : string {
-    $enLines = loadLangFileLines('en', $fileName);
-    $langContent = loadLang($lang, $fileName);
-    $enContent = loadLang('en', $fileName);
-
-    // Calculate the longest top-level key length
-    $longestKeyLength = calculateKeyPadding($enContent);
-
-    // Start formatted content
-    $formatted = [];
-    $mode = 'header';
-    $skipArray = false;
-    $arrayKeys = [];
-
-    foreach ($enLines as $index => $line) {
-        $trimLine = trim($line);
-        if ($mode === 'header') {
-            $formatted[$index] = $line;
-            if (str_replace(' ', '', $trimLine) === 'return[') $mode = 'body';
-        }
-
-        if ($mode === 'body') {
-            $matches = [];
-            $arrayEndMatch = preg_match('/]\s*,\s*$/', $trimLine);
-
-            if ($skipArray) {
-                if ($arrayEndMatch) $skipArray = false;
-                continue;
-            }
-
-            // Comment to ignore
-            if (strpos($trimLine, '//!') === 0) {
-                $formatted[$index] = "";
-                continue;
-            }
-
-            // Comment
-            if (strpos($trimLine, '//') === 0) {
-                $formatted[$index] = "\t" . $trimLine;
-                continue;
-            }
-
-            // Arrays
-            $arrayStartMatch = preg_match('/^\'(.*)\'\s+?=>\s+?\[(\],)?\s*?$/', $trimLine, $matches);
-
-            $indent = count($arrayKeys) + 1;
-            if ($arrayStartMatch === 1) {
-                if ($fileName === 'settings' && $matches[1] === 'language_select') {
-                    $skipArray = true;
-                    continue;
-                }
-                $arrayKeys[] = $matches[1];
-                $formatted[$index] = str_repeat(" ", $indent * 4) . str_pad("'{$matches[1]}'", $longestKeyLength) . "=> [";
-                if ($arrayEndMatch !== 1) continue;
-            }
-            if ($arrayEndMatch === 1) {
-                unsetArrayByKeys($langContent, $arrayKeys);
-                array_pop($arrayKeys);
-                if (isset($formatted[$index])) {
-                    $formatted[$index] .= '],';
-                } else {
-                    $formatted[$index] = str_repeat(" ", ($indent-1) * 4) . "],";
-                }
-                continue;
-            }
-
-            // Translation
-            $translationMatch = preg_match('/^\'(.*)\'\s+?=>\s+?[\'"](.*)?[\'"].+?$/', $trimLine, $matches);
-            if ($translationMatch === 1) {
-                $key = $matches[1];
-                $keys = array_merge($arrayKeys, [$key]);
-                $langVal = getTranslationByKeys($langContent, $keys);
-                if (empty($langVal)) continue;
-
-                $keyPad = $longestKeyLength;
-                if (count($arrayKeys) === 0) {
-                    unset($langContent[$key]);
-                } else {
-                    $keyPad = calculateKeyPadding(getTranslationByKeys($enContent, $arrayKeys));
-                }
-
-                $formatted[$index] = formatTranslationLine($key, $langVal, $indent, $keyPad);
-                continue;
-            }
-        }
-
-    }
-
-    // Fill missing lines
-    $arraySize = max(array_keys($formatted));
-    $formatted = array_replace(array_fill(0, $arraySize, ''), $formatted);
-
-    // Add remaining translations
-    $langContent = array_filter($langContent, function($item) {
-        return !is_null($item) && !empty($item);
-    });
-    if (count($langContent) > 0) {
-        $formatted[] = '';
-        $formatted[] = "\t// Unmatched";
-    }
-    foreach ($langContent as $key => $value) {
-        if (is_array($value)) {
-            $formatted[] = formatTranslationArray($key, $value);
-        } else {
-            $formatted[] = formatTranslationLine($key, $value);
-        }
-    }
-
-    // Add end line
-    $formatted[] = '];';
-    return implode("\n", $formatted);
-}
-
-/**
- * Format a translation line.
- * @param string $key
- * @param string $value
- * @param int $indent
- * @param int $keyPad
- * @return string
- */
-function formatTranslationLine(string $key, string $value, int $indent = 1, int $keyPad = 1) : string {
-    $start = str_repeat(" ", $indent * 4) . str_pad("'{$key}'", $keyPad, ' ');
-    if (strpos($value, "\n") !== false) {
-        $escapedValue = '"' .  str_replace("\n", '\n', $value)  . '"';
-        $escapedValue = '"' .  str_replace('"', '\"', $escapedValue)  . '"';
-    } else {
-        $escapedValue = "'" . str_replace("'", "\\'", $value) . "'";
-    }
-    return "{$start} => {$escapedValue},";
-}
-
-/**
- * Find the longest key in the array and provide the length
- * for all keys to be used when printed.
- * @param array $array
- * @return int
- */
-function calculateKeyPadding(array $array) : int {
-    $top = 0;
-    foreach ($array as $key => $value) {
-        $keyLen = strlen($key);
-        $top = max($top, $keyLen);
-    }
-    return min(35, $top + 2);
-}
-
-/**
- * Format an translation array with the given key.
- * Simply prints as an old-school php array.
- * Used as a last-resort backup to save unused translations.
- * @param string $key
- * @param array $array
- * @return string
- */
-function formatTranslationArray(string $key, array $array) : string {
-    $arrayPHP = var_export($array, true);
-    return "    '{$key}' => {$arrayPHP},";
-}
-
-/**
- * Find a string translation value within a multi-dimensional array
- * by traversing the given array of keys.
- * @param array $translations
- * @param array $keys
- * @return string|array
- */
-function getTranslationByKeys(array $translations, array $keys)  {
-    $val = $translations;
-    foreach ($keys as $key) {
-        $val = $val[$key] ?? '';
-        if ($val === '') return '';
-    }
-    return $val;
-}
-
-/**
- * Unset an inner item of a multi-dimensional array by
- * traversing the given array of keys.
- * @param array $input
- * @param array $keys
- */
-function unsetArrayByKeys(array &$input, array $keys) {
-    $val = &$input;
-    $lastIndex = count($keys) - 1;
-    foreach ($keys as $index => &$key) {
-        if ($index === $lastIndex && is_array($val)) {
-            unset($val[$key]);
-        }
-        if (!is_array($val)) return;
-        $val = &$val[$key] ?? [];
-    }
-}
-
-/**
- * Write the given content to a translation file.
- * @param string $lang
- * @param string $fileName
- * @param string $content
- */
-function writeLangFile(string $lang, string $fileName, string $content) {
-    $path = __DIR__ . "/{$lang}/{$fileName}.php";
-    if (!file_exists($path)) {
-        errorOut("Expected translation file '{$path}' does not exist");
-    }
-    file_put_contents($path, $content);
-}
-
-/**
- * Load the contents of a language file as an array of text lines.
- * @param string $lang
- * @param string $fileName
- * @return array
- */
-function loadLangFileLines(string $lang, string $fileName) : array {
-    $path = __DIR__ . "/{$lang}/{$fileName}.php";
-    if (!file_exists($path)) {
-        errorOut("Expected translation file '{$path}' does not exist");
-    }
-    $lines = explode("\n", file_get_contents($path));
-    return array_map(function($line) {
-        return trim($line, "\r");
-    }, $lines);
-}
-
-/**
- * Load the contents of a language file
- * @param string $lang
- * @param string $fileName
- * @return array
- */
-function loadLang(string $lang, string $fileName) : array {
-    $path = __DIR__ . "/{$lang}/{$fileName}.php";
-    if (!file_exists($path)) {
-        errorOut("Expected translation file '{$path}' does not exist");
-    }
-
-    $fileData = include($path);
-    return $fileData;
-}
-
-/**
- * Fetch an array containing the names of all translation files without the extension.
- * @return array
- */
-function getTranslationFileNames() : array {
-    $dir = __DIR__ . "/en";
-    if (!file_exists($dir)) {
-        errorOut("Expected directory '{$dir}' does not exist");
-    }
-    $files = scandir($dir);
-    $fileNames = [];
-    foreach ($files as $file) {
-        if (substr($file, -4) === '.php') {
-            $fileNames[] = substr($file, 0, strlen($file) - 4);
-        }
-    }
-    return $fileNames;
-}
-
-/**
- * Format a locale to follow the lowercase_UPERCASE standard
- * @param string $lang
- * @return string
- */
-function formatLocale(string $lang) : string {
-    $langParts = explode('_', strtoupper($lang));
-    $langParts[0] = strtolower($langParts[0]);
-    return implode('_', $langParts);
-}
-
-/**
- * Dump a variable then die.
- * @param $content
- */
-function dd($content) {
-    print_r($content);
-    exit(1);
-}
-
-/**
- * Log out some information text in blue
- * @param $text
- */
-function info($text) {
-    echo "\e[34m" . $text . "\e[0m\n";
-}
-
-/**
- * Log out an error in red and exit.
- * @param $text
- */
-function errorOut($text) {
-    echo "\e[31m" . $text . "\e[0m\n";
-    exit(1);
-}
\ No newline at end of file
index aca9dd04e4b31be2f8abf339be583b31a0e458c4..fc25fb22c5797e28eaa47dce65838335b74caf7c 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'Votre compte :socialAccount a été ajouté avec succès.',
     'users_social_disconnected' => 'Votre compte :socialAccount a été déconnecté avec succès',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 83a75dfb3ed3f1a89a318d3e7249f47c07c35866..058784dc7e59d19f44a28231713e0025b56c0338 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount fiók sikeresen csatlakoztatva a profilhoz.',
     'users_social_disconnected' => ':socialAccount fiók sikeresen lecsatlakoztatva a profilról.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index e6a49f1f5f79b475f86c3b52f18cf8943b391fc6..fe312796525388a826e4ba818cc2d62fe13d025f 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'L\'account :socialAccount è stato connesso correttamente al tuo profilo.',
     'users_social_disconnected' => 'L\'account :socialAccount è stato disconnesso correttamente dal tuo profilo.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index d848247f6e9352243fd799db5832304154b0331a..34eb469e96d1984ad9faadcb0d63d92f0ee43203 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => '「:socialAccount」がプロフィールに接続されました。',
     'users_social_disconnected' => '「:socialAccount」がプロフィールから接続解除されました。',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 588ae99581e954615ffc542d230823a63521641a..346e7f6a8462d08ea8adc38b91b72f33d8f47770 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount 계정이 당신의 프로필에 연결되었습니다.',
     'users_social_disconnected' => ':socialAccount 계정이 당신의 프로필에서 연결해제되었습니다.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 11f52175ba32da8ec08aaeed8c292018c3e32148..dc5521797a90f997498bea516471457fbc12757d 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount account is succesvol aan je profiel gekoppeld.',
     'users_social_disconnected' => ':socialAccount account is succesvol ontkoppeld van je profiel.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 49a537b6c5530c55e00aa023007b0a98f323a515..2c17657e4f057a4c88c878d0084ddca205e680bf 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount zostało dodane do Twojego profilu.',
     'users_social_disconnected' => ':socialAccount zostało odłączone od Twojego profilu.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index c819a6c49f6be779b67b42c3387d8aef29756aee..03283d752e8d4d1b8a020a65e0ab3b8c2aeb9a32 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'Conta :socialAccount foi conectada com sucesso ao seu perfil.',
     'users_social_disconnected' => 'Conta :socialAccount foi desconectada com sucesso de seu perfil.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 505c92a82d19f0053c8e7e0dbe83ab10571af256..f268c7e4ca48e522c803aa1456148c08ad2006c4 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount аккаунт упешно подключен к вашему профилю.',
     'users_social_disconnected' => ':socialAccount аккаунт успешно отключен от вашего профиля.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 304c1c0f16f37d2b8aa28bffe89fe708db0118f3..dc1e06bc58f01dd82d7bef8ab78c9757632d5009 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount účet bol úspešne pripojený k Vášmu profilu.',
     'users_social_disconnected' => ':socialAccount účet bol úspešne odpojený od Vášho profilu.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 12e345ee0902d07059d47a519b45543f91b2b933..c848ac65148840b7ec9fcea22dde6a092c89da3b 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount har kopplats till ditt konto.',
     'users_social_disconnected' => ':socialAccount har kopplats bort från ditt konto.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 041180ac68331a64eba01ead597ecfcfa23a142d..bb35fe3237eea8166921b07c9a3da0a7e3457770 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount hesabı profilinize başarıyla bağlandı.',
     'users_social_disconnected' => ':socialAccount hesabınızın profilinizle ilişiği başarıyla kesildi.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 324663b42e80930a9b4446ca838c6277ed8b831f..d11b6393c23e522104234b36d41f13444deaafbd 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => 'Обліковий запис :socialAccount успішно додано до вашого профілю.',
     'users_social_disconnected' => 'Обліковий запис :socialAccount був успішно відключений від вашого профілю.',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index da6c6e64f96749422a055990e9c5dfe8c1f08607..bc489376c21a67624ddeaf863167e18a1aad42d0 100755 (executable)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount 账户已经成功绑定到您的资料。',
     'users_social_disconnected' => ':socialAccount 账户已经成功解除绑定。',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index 1c2bb69f7f5393bb29dd88ade6f2fb7aef21bc94..0ad899a27e0da558b4e427067d19a3518747d528 100644 (file)
@@ -135,9 +135,8 @@ return [
     'users_social_connected' => ':socialAccount 帳號已經成功連結到您的資料。',
     'users_social_disconnected' => ':socialAccount 帳號已經成功解除連結。',
 
-    //! Since these labels are already localized this array does not need to be
-    //! translated in the language-specific files.
-    //! DELETE BELOW IF COPIED FROM EN
+    //! If editing translations files directly please ignore this in all
+    //! languages apart from en. Content will be auto-copied from en.
     //!////////////////////////////////
     'language_select' => [
         'en' => 'English',
index c8bc4445117a5819fe3c7561f043bd742b5d7182..cd68756ae4365ad27ef4499f6a363b96570b474a 100644 (file)
@@ -66,21 +66,4 @@ class LanguageTest extends TestCase
         $this->assertTrue(config('app.rtl'), "App RTL config should have been set to true by middleware");
     }
 
-    public function test_de_informal_falls_base_to_de()
-    {
-        // Base de back value
-        $deBack = trans()->get('common.cancel', [], 'de', false);
-        $this->assertEquals('Abbrechen', $deBack);
-        // Ensure de_informal has no value set
-        $this->assertEquals('common.cancel', trans()->get('common.cancel', [], 'de_informal', false));
-        // Ensure standard trans falls back to de
-        $this->assertEquals($deBack, trans('common.cancel', [], 'de_informal'));
-        // Ensure de_informal gets its own values where set
-        $deEmailActionHelp = trans()->get('common.email_action_help', [], 'de', false);
-        $enEmailActionHelp = trans()->get('common.email_action_help', [], 'en', false);
-        $deInformalEmailActionHelp = trans()->get('common.email_action_help', [], 'de_informal', false);
-        $this->assertNotEquals($deEmailActionHelp, $deInformalEmailActionHelp);
-        $this->assertNotEquals($enEmailActionHelp, $deInformalEmailActionHelp);
-    }
-
 }
\ No newline at end of file