Skip to content

Commit

Permalink
Merge pull request #5 from beechit/master
Browse files Browse the repository at this point in the history
[BUGFIX] Required argument "translationLabel" is not set.
  • Loading branch information
kaystrobach committed May 20, 2015
2 parents 5b483ad + 048b857 commit 8afb35d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,12 @@ public function clearTranslationCacheAction() {
/**
* add a stub with the selected id to the related xliff file
*
* @param TranslationLabel $translationLabel
* @param string $label
* @param string $labelId
* @param \KayStrobach\DevelopmentTools\Domain\Model\TranslationLabel $translationLabel
*/
public function addToXliffAction(TranslationLabel $translationLabel, $label = NULL, $labelId = NULL) {
public function addToXliffAction(\KayStrobach\DevelopmentTools\Domain\Model\TranslationLabel $translationLabel = NULL) {
$filename = 'resource://' . $translationLabel->getPackageKey() . '/Private/Translations/en/' . $translationLabel->getSourceName() . '.xlf';

if($label !== NULL) {
$translationLabel->setLabel($label);
}
if($labelId !== NULL) {
$translationLabel->setLabelId($labelId);
}
if($labelId !== NULL || $label !== NULL) {
$this->translationLabelRepository->update($translationLabel);
}
$this->translationLabelRepository->addOrUpdate($translationLabel);

if(file_exists($filename)) {
$doc = new \DOMDocument('1.0');
Expand Down
7 changes: 5 additions & 2 deletions Resources/Private/Templates/Translation/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ <h3>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Add a new label</h4>
<f:form.hidden value="{translationLabel.arguments}" property="arguments"/>
<f:form.hidden value="{translationLabel.packageKey}" property="packageKey"/>
<f:form.hidden value="{translationLabel.sourceName}" property="sourceName"/>
</div>
<div class="modal-body text-left">
<p>
Expand All @@ -113,11 +116,11 @@ <h4 class="modal-title">Add a new label</h4>

<div class="form-group">
<label for="{translationLabel.cacheHash}-labelid">Id of this label</label>
<f:form.textfield value="{translationLabel.labelId}" name="labelId" class="form-control" id="{translationLabel.cacheHash}-labelid" placeholder="id of the label"/>
<f:form.textfield value="{translationLabel.labelId}" property="labelId" class="form-control" id="{translationLabel.cacheHash}-labelid" placeholder="id of the label"/>
</div>
<div class="form-group">
<label for="{translationLabel.cacheHash}-label">Source of this label</label>
<f:form.textfield value="{translationLabel.label}" name="label" class="form-control" id="{translationLabel.cacheHash}-label" placeholder="source of the label"/>
<f:form.textfield value="{translationLabel.label}" property="label" class="form-control" id="{translationLabel.cacheHash}-label" placeholder="source of the label"/>
</div>
</div>
<div class="modal-footer">
Expand Down

0 comments on commit 8afb35d

Please sign in to comment.