Skip to content

Commit

Permalink
Do not change default translation domain in hooks
Browse files Browse the repository at this point in the history
It is not local to the current file and will break translations for the rest of the page.
  • Loading branch information
bcbrr committed Jun 4, 2015
1 parent f36f910 commit 793d50e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
21 changes: 10 additions & 11 deletions templates/frontOffice/default/ajax-comments.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{default_translation_domain domain='comment.fo.default'}
{$locale={lang attr="locale"}}
{$customer_id={customer attr="id"}}

Expand Down Expand Up @@ -27,7 +26,7 @@
{$image="http://www.gravatar.com/avatar/{$EMAIL|trim|strtolower|md5}?d=mm&s=64"}
{/loop}
{elseloop rel="customer"}
{$username={intl l="Anonymous"} }
{$username={intl d="comment.fo.default" l="Anonymous"} }
{$image={image file='assets/img/avatar.png'}}
{/elseloop}
{else}
Expand All @@ -39,7 +38,7 @@
<img src="{$image}" alt="" class="pull-left" />
<div class="media-body">
<p>
{intl l="By <strong>%username</strong>" username={$username}}
{intl d="comment.fo.default" l="By <strong>%username</strong>" username={$username}}
{if $RATING}<span class="text-primary">{comment_stars value=$RATING}</span>{/if}
</p>
<h3 class="comment-title media-heading">{$TITLE}</h3>
Expand All @@ -49,20 +48,20 @@ <h3 class="comment-title media-heading">{$TITLE}</h3>
<ul class="comment-extra list-inline">
<li class="comment-date">{format_date date="{$CREATED}" output="date"}</li>
{if $VERIFIED}
<li class="comment-verified comment--is-verified">{intl l="Verified"}</li>
<li class="comment-verified comment--is-verified">{intl d="comment.fo.default" l="Verified"}</li>
{else}
<li class="comment-verified">{intl l="Verified"}</li>
<li class="comment-verified">{intl d="comment.fo.default" l="Verified"}</li>
{/if}
{if $customer_id && $customer_id == $CUSTOMER_ID}
<li><a href="{url path="/comment/delete/{$ID}"}" class="delete-trigger" data-id="{$ID}" data-message="{intl l="Are you sure ?"}">{intl l="Delete"}</a></li>
<li><a href="{url path="/comment/delete/{$ID}"}" class="delete-trigger" data-id="{$ID}" data-message="{intl d="comment.fo.default" l="Are you sure ?"}">{intl d="comment.fo.default" l="Delete"}</a></li>
{else}
<li class="comment-abuse">
{form name="comment.abuse.form"}
<form id="form-add-comment" action="{url path="/comment/abuse"}" method="post" novalidate>
{form_hidden_fields form=$form}
{form_field form=$form field="id"}
<input type="hidden" name="{$name}" value="{$ID}" />
<a href="#" class="abuse-trigger">{intl l="Mark as inappropriate"}</a>
<a href="#" class="abuse-trigger">{intl d="comment.fo.default" l="Mark as inappropriate"}</a>
{/form_field}
</form>
{/form}
Expand All @@ -76,16 +75,16 @@ <h3 class="comment-title media-heading">{$TITLE}</h3>

{if {count type="comment" ref="{$ref}" ref_id="{$ref_id}" status="1" } > $start + $count }
<div class="comments-more">
<a href="#" class="comments-more-link">{intl l="Load more comments..."}</a>
<a href="#" class="comments-more-link">{intl d="comment.fo.default" l="Load more comments..."}</a>
</div>
{/if}
{/ifloop}
{elseloop rel="comments"}
<div class="alert alert-info">
{if $start == 0 }
{intl l="There are no comments yet"}
{intl d="comment.fo.default" l="There are no comments yet"}
{else}
{intl l="No more comments"}
{intl d="comment.fo.default" l="No more comments"}
{/if}
</div>
{/elseloop}
{/elseloop}
7 changes: 3 additions & 4 deletions templates/frontOffice/default/comment.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{default_translation_domain domain='comment.fo.default'}
{function name=comment_stars empty=1}
{$star='<span class="glyphicon glyphicon-star"></span>'}
{$star_empty='<span class="glyphicon glyphicon-star-empty"></span>'}
Expand All @@ -17,7 +16,7 @@
<div id="comment-top">

<div class="well well-sm">
{intl l="Add your comment"}
{intl d="comment.fo.default" l="Add your comment"}
</div>

<div id="comment-top-message" class="alert hidden"></div>
Expand Down Expand Up @@ -102,7 +101,7 @@
{/if}

<div class="form-group">
<button type="submit" class="btn btn-primary">{intl l="Send"}</button>
<button type="submit" class="btn btn-primary">{intl d="comment.fo.default" l="Send"}</button>
</div>
</form>
{/form}
Expand All @@ -113,7 +112,7 @@

<div id="comment-body" class="comment-body">
<div class="well well-sm">
{intl l="Comments"}
{intl d="comment.fo.default" l="Comments"}
{if $definition->hasRating()}
{$rating={meta meta="COMMENT_RATING" key="{$definition->getRef()}" id="{$definition->getRefId()}"}}
{if $rating}
Expand Down

0 comments on commit 793d50e

Please sign in to comment.