From 1185eebe3bdf8070e491763671e39813eab23d34 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 18 Jun 2018 22:07:31 +0200 Subject: [PATCH] TASK: Translate editmode to interfacelanguage Resolves: #11 --- .../InterfaceLanguageImplementation.php | 29 +++++++++++++++++++ .../Components/AbstractEditableField.fusion | 2 +- .../Private/Fusion/Components/Header.fusion | 2 +- .../Fusion/Documents/YoastSeoView.fusion | 3 ++ .../FusionObjects/InterfaceLanguage.fusion | 3 ++ Resources/Private/Translations/de/Main.xlf | 29 +++++++++++++++++++ 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 Classes/FusionObjects/InterfaceLanguageImplementation.php create mode 100644 Resources/Private/Fusion/FusionObjects/InterfaceLanguage.fusion diff --git a/Classes/FusionObjects/InterfaceLanguageImplementation.php b/Classes/FusionObjects/InterfaceLanguageImplementation.php new file mode 100644 index 0000000..f69fe33 --- /dev/null +++ b/Classes/FusionObjects/InterfaceLanguageImplementation.php @@ -0,0 +1,29 @@ +userService->getInterfaceLanguage(); + } +} diff --git a/Resources/Private/Fusion/Components/AbstractEditableField.fusion b/Resources/Private/Fusion/Components/AbstractEditableField.fusion index b7b089a..f0a4673 100644 --- a/Resources/Private/Fusion/Components/AbstractEditableField.fusion +++ b/Resources/Private/Fusion/Components/AbstractEditableField.fusion @@ -12,7 +12,7 @@ prototype(Shel.Neos.YoastSeo:Component.AbstractEditableField) < prototype(Neos.F content = Neos.Fusion:Array { label = Neos.Fusion:Tag { tagName = 'label' - content = ${I18n.translate('Shel.Neos.YoastSeo:Main:field.' + fieldName)} + content = ${I18n.translate('field.' + fieldName, null, [], 'Main', 'Shel.Neos.YoastSeo', null, interfaceLanguage)} } value = Neos.Fusion:Tag { diff --git a/Resources/Private/Fusion/Components/Header.fusion b/Resources/Private/Fusion/Components/Header.fusion index bad081f..42082cf 100644 --- a/Resources/Private/Fusion/Components/Header.fusion +++ b/Resources/Private/Fusion/Components/Header.fusion @@ -1,4 +1,4 @@ prototype(Shel.Neos.YoastSeo:Component.Header) < prototype(Neos.Fusion:Tag) { tagName = 'h1' - content = ${I18n.translate('Shel.Neos.YoastSeo:Main:header')} + content = ${I18n.translate('header', null, [], 'Main', 'Shel.Neos.YoastSeo', null, interfaceLanguage)} } diff --git a/Resources/Private/Fusion/Documents/YoastSeoView.fusion b/Resources/Private/Fusion/Documents/YoastSeoView.fusion index 5e45e9c..1ad6529 100644 --- a/Resources/Private/Fusion/Documents/YoastSeoView.fusion +++ b/Resources/Private/Fusion/Documents/YoastSeoView.fusion @@ -1,4 +1,7 @@ prototype(Shel.Neos.YoastSeo:Documents.YoastSeoView) < prototype(Neos.Neos:Page) { + + @context.interfaceLanguage = Shel.Neos.YoastSeo:InterfaceLanguage + head { stylesheets > stylesheets = Neos.Fusion:Array { diff --git a/Resources/Private/Fusion/FusionObjects/InterfaceLanguage.fusion b/Resources/Private/Fusion/FusionObjects/InterfaceLanguage.fusion new file mode 100644 index 0000000..bd6e7ce --- /dev/null +++ b/Resources/Private/Fusion/FusionObjects/InterfaceLanguage.fusion @@ -0,0 +1,3 @@ +prototype(Shel.Neos.YoastSeo:InterfaceLanguage) { + @class = 'Shel\\Neos\\YoastSeo\\FusionObjects\\InterfaceLanguageImplementation' +} diff --git a/Resources/Private/Translations/de/Main.xlf b/Resources/Private/Translations/de/Main.xlf index a3a9e07..8fa3dd1 100644 --- a/Resources/Private/Translations/de/Main.xlf +++ b/Resources/Private/Translations/de/Main.xlf @@ -32,6 +32,35 @@ Focus Keyword Fokus Schlüsselwort + + + Loading… + Lädt… + + + Title + Titel + + + Description + Beschreibung + + + Results + Ergebnisse + + + SEO Score + SEO Bewertung + + + Content Score + Inhaltsbewertung + + + Show all results + Alle Ergebnisse zeigen +