Skip to content

Commit

Permalink
TASK: Improve translations and label identifiers more consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
mficzel committed Apr 11, 2019
1 parent a461f4e commit 581a795
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 222 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ public function deleteVocabularyAction(NodeInterface $vocabulary)
*/
public function newTaxonomyAction(NodeInterface $parent)
{
$flowQuery = new FlowQuery([$parent]);
$vocabulary = $flowQuery->closest('[instanceof ' . $this->taxonomyService->getVocabularyNodeType() . ']')->get(0);
$this->view->assign('vocabulary', $vocabulary);
$this->view->assign('parent', $parent);
}

Expand Down
6 changes: 3 additions & 3 deletions Resources/Private/Partials/TaxonRecursive.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageTaxonomyActions">

<f:link.action action="newTaxonomy" arguments="{parent : taxon.node.contextPath}" title="{f:translate(id: 'module.taxonRecursive.addSubTaxon')}" class="neos-button neos-button-primary">
<f:link.action action="newTaxonomy" arguments="{parent : taxon.node.contextPath}" title="{f:translate(id: 'taxon.createBelow')}" class="neos-button neos-button-primary">
<i class="fas fa-plus"></i>
</f:link.action>

<f:form action="editTaxonomy" class="neos-inline">
<f:form.hidden name="taxonomy" value="{taxon.node.contextPath}" />
<f:form.button title="{f:translate(id: 'module.taxonRecursive.editTaxon')}" data="{neos-toggle: 'tooltip'}" class="neos-button neos-button-primary">
<f:form.button title="{f:translate(id: 'generic.edit')}" data="{neos-toggle: 'tooltip'}" class="neos-button neos-button-primary">
<i class="fas fa-pencil-alt"></i>
</f:form.button>
</f:form>

<f:if condition="{taxon.autoCreated = false}" >
<button class="neos-button neos-button-danger" title="{f:translate(id: 'module.taxonRecursive.deleteTaxon')}" data-toggle="modal" href="#deleteTaxonomx_{taxon.node.identifier}" data-neos-toggle="tooltip">
<button class="neos-button neos-button-danger" title="{f:translate(id: 'generic.delete')}" data-toggle="modal" href="#deleteTaxonomx_{taxon.node.identifier}" data-neos-toggle="tooltip">
<i class="fas fa-trash-alt icon-white"></i>
</button>

Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Templates/Module/EditTaxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<div class="neos-row-fluid">
<div class="neos-span6">
<legend>{f:translate(id: 'module.editTaxonomy')}: {taxonomy.properties.title}</legend>
<legend>{f:translate(id: 'taxon')}: {taxonomy.properties.title}</legend>
</div>
<f:if condition="{defaultTaxonomy}">
<div class="neos-span6">
<legend>{f:translate(id: 'module.baseTaxonomy')}: {defaultTaxonomy.properties.title}</legend>
<legend>{f:translate(id: 'generic.default')}: {defaultTaxonomy.properties.title}</legend>
</div>
</f:if>
</div>
Expand All @@ -28,7 +28,7 @@
</div>
<f:if condition="{defaultTaxonomy}">
<div class="neos-span6">
<input type="text" class="neos-span12" value="{defaultTaxonomy.properties.title}" />
<input type="text" class="neos-span12" value="{defaultTaxonomy.properties.title}" readonly />
</div>
</f:if>
</div>
Expand All @@ -43,13 +43,13 @@
</div>
<f:if condition="{defaultTaxonomy}">
<div class="neos-span6">
<input type="text" class="neos-span12" value="{defaultTaxonomy.properties.description}" />
<input type="text" class="neos-span12" value="{defaultTaxonomy.properties.description}" readonly />
</div>
</f:if>
</div>

<f:link.action class="neos-button" action="vocabulary" arguments="{vocabulary: vocabulary}">{f:translate(id: 'module.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'module.save')}" class="neos-button neos-button-primary" />
<f:link.action class="neos-button" action="vocabulary" arguments="{vocabulary: vocabulary}">{f:translate(id: 'generic.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'generic.save')}" class="neos-button neos-button-primary" />

</fieldset>
</f:form>
Expand Down
16 changes: 8 additions & 8 deletions Resources/Private/Templates/Module/EditVocabulary.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<f:section name="content">
<div class="neos-row-fluid">
<div class="neos-span6">
<legend>{f:translate(id: 'module.editVocabulary')}: {vocabulary.properties.title}</legend>
<legend>{f:translate(id: 'vocabulary')}: {vocabulary.properties.title}</legend>
</div>
<f:if condition="{defaultVocabulary}">
<div class="neos-span6">
<legend>{f:translate(id: 'module.baseVocabulary')}: {defaultVocabulary.properties.title}</legend>
<legend>{f:translate(id: 'generic.default')}: {defaultVocabulary.properties.title}</legend>
</div>
</f:if>
</div>
Expand All @@ -18,7 +18,7 @@

<f:form.hidden name="vocabulary" value="{vocabulary.contextPath}" />

<label class="neos-control-label" for="title">{f:translate(id: 'properties.title', source: 'NodeTypes/Taxonomy')} </label>
<label class="neos-control-label" for="title">{f:translate(id: 'properties.title', source: 'NodeTypes/Vocabulary')}</label>
<div class="neos-row-fluid">
<div class="neos-span6">
<div class="neos-control-group">
Expand All @@ -27,12 +27,12 @@
</div>
<f:if condition="{defaultVocabulary}">
<div class="neos-span6">
<input type="text" class="neos-span12" value="{defaultVocabulary.properties.title}" readonly/>
<input type="text" class="neos-span12" value="{defaultVocabulary.properties.title}" readonly />
</div>
</f:if>
</div>

<label class="neos-control-label" for="description">{f:translate(id: 'properties.description', source: 'NodeTypes/Taxonomy')}</label>
<label class="neos-control-label" for="description">{f:translate(id: 'properties.description', source: 'NodeTypes/Vocabulary')}</label>

<div class="neos-row-fluid">
<div class="neos-span6">
Expand All @@ -42,13 +42,13 @@
</div>
<f:if condition="{defaultVocabulary}">
<div class="neos-span6">
<input type="text" class="neos-span12" value="{defaultVocabulary.properties.description}" readonly/>
<input type="text" class="neos-span12" value="{defaultVocabulary.properties.description}" readonly />
</div>
</f:if>
</div>

<f:link.action class="neos-button" action="index" arguments="{root: taxonomyRoot}">{f:translate(id: 'module.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'module.save')}" class="neos-button neos-button-primary" />
<f:link.action class="neos-button" action="index" arguments="{root: taxonomyRoot}">{f:translate(id: 'generic.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'generic.save')}" class="neos-button neos-button-primary" />

</fieldset>
</f:form>
Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Templates/Module/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div class="neos-row-fluid">
<legend>
{f:translate(id: 'module.index.vocabularies')}
{f:translate(id: 'vocabularies')}
<div class="neos-pull-right">
<f:render partial="LanguageSelection" arguments="{targetAction: 'index', targetProperty: 'root', contentDimensionOptions: contentDimensionOptions, contextNode: taxonomyRoot}" />
</div>
Expand All @@ -25,7 +25,7 @@
<div class="widget-header">
<i class="fas fa-tags neos-pull-left"></i>
<h3>
<f:link.action action="vocabulary" arguments="{vocabulary: vocabulary.node.contextPath}" title="{f:translate(id: 'module.index.showVocabulary')}">
<f:link.action action="vocabulary" arguments="{vocabulary: vocabulary.node.contextPath}" title="{f:translate(id: 'vocabulary.show')}">
{vocabulary.node.properties.title} <f:if condition="{vocabulary.defaultNode}">({vocabulary.defaultNode.properties.title})</f:if>
</f:link.action>
</h3>
Expand All @@ -39,12 +39,12 @@ <h3>

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageVocabularyActions">

<f:link.action action="editVocabulary" class="neos-button" title="{f:translate(id: 'module.index.editVocabulary')}" arguments="{vocabulary: vocabulary.node.contextPath}" >
<f:link.action action="editVocabulary" class="neos-button" title="{f:translate(id: 'generic.edit')}" arguments="{vocabulary: vocabulary.node.contextPath}" >
<i class="fas fa-pencil-alt"></i>
</f:link.action>

<f:if condition="{vocabulary.autoCreated = false}" >
<button class="neos-button neos-button-danger" title="{f:translate(id: 'module.index.deleteVocabulary')}" data-toggle="modal" href="#deleteVocabulary_{vocabulary.node.identifier}" data-neos-toggle="tooltip">
<button class="neos-button neos-button-danger" title="{f:translate(id: 'generic.delete')}" data-toggle="modal" href="#deleteVocabulary_{vocabulary.node.identifier}" data-neos-toggle="tooltip">
<i class="fas fa-trash-alt icon-white"></i>
</button>

Expand Down Expand Up @@ -89,7 +89,7 @@ <h3>
</f:then>
<f:else>
<p>
{f:translate(id: 'module.index.noVocabularies')}
{f:translate(id: 'noVocabularies')}
</p>
</f:else>
</f:if>
Expand All @@ -99,7 +99,7 @@ <h3>
<div class="neos-row-fluid">

<f:link.action action="newVocabulary" class="neos-button neos-button-primary" title="" arguments="{taxonomyRoot: taxonomyRoot}">
<i class="fas fa-plus icon-white"></i> {f:translate(id: 'module.index.createNewVocabulary')}
<i class="fas fa-plus icon-white"></i> {f:translate(id: 'vocabulary.create')}
</f:link.action>

</div>
Expand Down
9 changes: 5 additions & 4 deletions Resources/Private/Templates/Module/NewTaxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
<f:section name="content">
<f:form action="createTaxonomy">
<fieldset>
<legend>{f:translate(id: 'module.createNewTaxonomyBelow')} "{parent.properties.title}"</legend>
<legend>{f:translate(id: 'taxon.createBelow')} "{parent.properties.title}"</legend>
<f:form.hidden name="parent" value="{parent.contextPath}" />

<div class="neos-control-group">
<label class="neos-control-label" for="title">{f:translate(id: 'module.title')}</label>
<label class="neos-control-label" for="title">{f:translate(id: 'properties.title', source: 'NodeTypes/Taxonomy')}</label>
<f:form.textfield class="neos-span6" name="title" id="title"/>
</div>
<div class="neos-control-group">
<label class="neos-control-label" for="description">{f:translate(id: 'module.description')}</label>
<label class="neos-control-label" for="description">{f:translate(id: 'properties.description', source: 'NodeTypes/Taxonomy')}</label>
<f:form.textarea class="neos-span6" name="description" id="description"/>
</div>

<f:form.submit value="{f:translate(id: 'module.createTaxon')}" class="neos-button neos-button-primary" />
<f:link.action class="neos-button" action="vocabulary" arguments="{vocabulary: vocabulary}">{f:translate(id: 'generic.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'taxon.create')}" class="neos-button neos-button-primary" />
</fieldset>
</f:form>
</f:section>
9 changes: 5 additions & 4 deletions Resources/Private/Templates/Module/NewVocabulary.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
<f:section name="content">
<f:form action="createVocabulary">
<fieldset>
<legend>{f:translate(id: 'module.createNewVocabulary')}</legend>
<legend>{f:translate(id: 'vocabulary.create')}</legend>
<f:form.hidden name="taxonomyRoot" value="{taxonomyRoot.contextPath}" />

<div class="neos-control-group">
<label class="neos-control-label" for="title">{f:translate(id: 'module.title')}</label>
<label class="neos-control-label" for="title">{f:translate(id: 'properties.title', source: 'NodeTypes/Vocabulary')}</label>
<f:form.textfield class="neos-span6" name="title" id="title"/>
</div>
<div class="neos-control-group">
<label class="neos-control-label" for="description">{f:translate(id: 'module.description')}</label>
<label class="neos-control-label" for="description">{f:translate(id: 'properties.description', source: 'NodeTypes/Vocabulary')}</label>
<f:form.textarea class="neos-span6" name="description" id="description"/>
</div>

<f:form.submit value="{f:translate(id: 'module.createVocabulary')}" class="neos-button neos-button-primary" />
<f:link.action class="neos-button" action="index" arguments="{root: taxonomyRoot}">{f:translate(id: 'generic.cancel')}</f:link.action>
<f:form.submit value="{f:translate(id: 'vocabulary.create')}" class="neos-button neos-button-primary" />
</fieldset>
</f:form>
</f:section>
10 changes: 5 additions & 5 deletions Resources/Private/Templates/Module/Vocabulary.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<f:section name="content">
<div class="neos-row-fluid">
<legend>
{f:translate(id: 'module.vocabulary')} {vocabulary.properties.title}
{f:translate(id: 'vocabulary')} {vocabulary.properties.title}
<f:if condition="{defaultVocabulary}">({defaultVocabulary.properties.title})</f:if>
<div class="neos-pull-right">
<f:render partial="LanguageSelection" arguments="{targetAction: 'vocabulary', targetProperty: 'vocabulary', contentDimensionOptions: contentDimensionOptions, contextNode: vocabulary}" />
Expand All @@ -22,7 +22,7 @@
<thead>
<tr>
<th>
{f:translate(id: 'module.title')}
{f:translate(id: 'properties.title', source:'NodeTypes/Taxonomy')}
</th>
<th>
<f:if condition="{defaultVocabulary}">Default</f:if>
Expand All @@ -39,7 +39,7 @@
</f:then>
<f:else>
<p>
{f:translate(id: 'module.vocabulary.noTaxons')}
{f:translate(id: 'vocabulary.empty')}
</p>
</f:else>
</f:if>
Expand All @@ -48,10 +48,10 @@

<div class="neos-row-fluid">
<f:link.action action="index" class="neos-button" title="" arguments="{root: taxonomyRoot}" >
<i class="fas fa-backward icon-white"></i> {f:translate(id: 'module.vocabulary.backToIndex')}
{f:translate(id: 'generic.back')}
</f:link.action>
<f:link.action action="newTaxonomy" class="neos-button neos-button-primary" title="" arguments="{parent: vocabulary.contextPath}" >
<i class="fas fa-plus icon-white"></i> {f:translate(id: 'module.vocabulary.createNewTaxon')}
{f:translate(id: 'taxon.create')}
</f:link.action>
</div>

Expand Down
Loading

0 comments on commit 581a795

Please sign in to comment.