Skip to content

Commit

Permalink
TASK: Translate editmode to interfacelanguage
Browse files Browse the repository at this point in the history
Resolves: #11
  • Loading branch information
Sebobo committed Jun 18, 2018
1 parent 8cf677b commit 1185eeb
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
29 changes: 29 additions & 0 deletions Classes/FusionObjects/InterfaceLanguageImplementation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
namespace Shel\Neos\YoastSeo\FusionObjects;

use Neos\Flow\Annotations as Flow;
use Neos\Fusion\FusionObjects\AbstractFusionObject;
use Neos\Neos\Service\UserService;

/**
* Object to retrieve the current backend users interface language
*/
class InterfaceLanguageImplementation extends AbstractFusionObject
{

/**
* @Flow\Inject
* @var UserService
*/
protected $userService;

/**
* Returns the interface language as string
*
* @return string
*/
public function evaluate()
{
return $this->userService->getInterfaceLanguage();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Components/Header.fusion
Original file line number Diff line number Diff line change
@@ -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)}
}
3 changes: 3 additions & 0 deletions Resources/Private/Fusion/Documents/YoastSeoView.fusion
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
prototype(Shel.Neos.YoastSeo:InterfaceLanguage) {
@class = 'Shel\\Neos\\YoastSeo\\FusionObjects\\InterfaceLanguageImplementation'
}
29 changes: 29 additions & 0 deletions Resources/Private/Translations/de/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,35 @@
<source>Focus Keyword</source>
<target>Fokus Schlüsselwort</target>
</trans-unit>

<trans-unit id="inspector.loading">
<source>Loading…</source>
<target>Lädt…</target>
</trans-unit>
<trans-unit id="inspector.title">
<source>Title</source>
<target>Titel</target>
</trans-unit>
<trans-unit id="inspector.description">
<source>Description</source>
<target>Beschreibung</target>
</trans-unit>
<trans-unit id="inspector.results">
<source>Results</source>
<target>Ergebnisse</target>
</trans-unit>
<trans-unit id="inspector.seoScore">
<source>SEO Score</source>
<target>SEO Bewertung</target>
</trans-unit>
<trans-unit id="inspector.contentScore">
<source>Content Score</source>
<target>Inhaltsbewertung</target>
</trans-unit>
<trans-unit id="inspector.showAllResults">
<source>Show all results</source>
<target>Alle Ergebnisse zeigen</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 1185eeb

Please sign in to comment.