Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 12, 2023
1 parent 722e89b commit 12abf6b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions generators/angular/support/translate-angular.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export const createTranslationReplacer = (getWebappTranslation, enableTranslatio
content = htmlJhiTranslateReplacer(content);
content = htmlJhiTranslateStringifyReplacer(content);
}
if (/\.ts$/.test(filePath)) {
content = htmlJhiTranslateReplacer(content);
content = htmlJhiTranslateStringifyReplacer(content);
}
if (!enableTranslation) {
if (/(:?route|module)\.ts$/.test(filePath)) {
content = replacePageTitles(getWebappTranslation, content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ for (const relationship of relationships.filter(rel => !rel.otherEntityIsEmbedde
const otherEntityField = relationship.otherEntityField;
if (ownerSide) {
_%>
<dt><span <%= jhiPrefix %>Translate="<%= i18nKeyPrefix %>.<%= relationshipName %>">__jhiTransformTranslate__('<%- i18nKeyPrefix %>.' + relationshipName)</span></dt>
<dt><span <%= jhiPrefix %>Translate="<%= i18nKeyPrefix %>.<%= relationshipName %>">__jhiTransformTranslate__('<%- i18nKeyPrefix %>.<%- relationshipName %>')</span></dt>
<dd>
<%_ if (relationship.otherEntityUser) { _%>
<%_ if (relationship.collection) { _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
_%>
<th scope="col" <%= jhiPrefix %>SortBy="<%= relationship.relationshipName + (fieldName) %>">
<div class="d-flex">
<span <%= jhiPrefix %>Translate="<%= `${i18nKeyPrefix}.${relationship.relationshipName}` %>">__jhiTransformTranslate__('<%- i18nKeyPrefix %>.' + relationship.relationshipName)</span>
<span <%= jhiPrefix %>Translate="<%= `${i18nKeyPrefix}.${relationship.relationshipName}` %>">__jhiTransformTranslate__('<%- i18nKeyPrefix %>.<%- relationship.relationshipName %>')</span>
<fa-icon class="p-1" icon="sort"></fa-icon>
</div>
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ _%>
<%_ if (relationship.relationshipManyToOne || (relationship.relationshipOneToOne && ownerSide)) { _%>
<div class="mb-3">
<label class="form-label" <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= relationshipName %>">__jhiTransformTranslate__(translationKey)</label>
<label class="form-label" <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= relationshipName %>">__jhiTransformTranslate__('<%- translationKey %>')</label>
<select class="form-control" id="field_<%= relationshipName %>" data-cy="<%= propertyName %>" name="<%= relationshipName %>" formControlName="<%= propertyName %>" [compareWith]="compare<%= otherEntity.entityAngularName %>">
<%_ if (!relationshipRequired) { _%>
<option [ngValue]="null"></option>
Expand All @@ -164,7 +164,7 @@ _%>
<%_ } else if (relationship.relationshipManyToMany && ownerSide) { _%>
<div class="mb-3">
<label <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= relationshipFieldNamePlural %>">__jhiTransformTranslate__(translationKey)</label>
<label <%= jhiPrefix %>Translate="<%= translationKey %>" for="field_<%= relationshipFieldNamePlural %>">__jhiTransformTranslate__('<%- translationKey %>')</label>
<select class="form-control" id="field_<%= relationshipFieldNamePlural %>" data-cy="<%= relationshipFieldName %>" multiple name="<%= propertyName %>" formControlName="<%= propertyName %>" [compareWith]="compare<%= otherEntity.entityAngularName %>">
<option [ngValue]="<%= otherEntityName %>Option" *ngFor="let <%= otherEntityName %>Option of <%= otherEntity.entityInstancePlural %>SharedCollection">{{ <%= otherEntityName %>Option.<%= otherEntityField %> }}</option>
</select>
Expand Down

0 comments on commit 12abf6b

Please sign in to comment.