Skip to content

Commit fb359ee

Browse files
mschwrdtnrDanielHabenicht
authored andcommitted
fix(columnTranslate): make using filter possible in english version (#299)
workaround for ngx translate
1 parent cd6ae93 commit fb359ee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Phonebook.Frontend/src/app/shared/config/columnTranslate.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ import { ColumnId } from 'src/app/shared/models/enumerables/ColumnId';
88
export class ColumnTranslate {
99
constructor(private i18n: I18n) {}
1010
public getTranslation(columnId: ColumnId): string {
11+
/*
12+
* workaround for ngx translate
13+
* necassary because the generated translations are wrong
14+
* They insert a new line after some strings and thus a space in the translated version of the string
15+
* E.G. What it should look like:
16+
* <source>Address</source><target state="final">Address</target>
17+
* looks like:
18+
* <source>
19+
* Buildings
20+
* </source><target state="final">
21+
* Buildings
22+
* </target>
23+
*
24+
* IssueLink: https://github.com/ngx-translate/i18n-polyfill/issues/63
25+
*/
26+
return this.getInternalTranslation(columnId).trim();
27+
}
28+
private getInternalTranslation(columnId: ColumnId): string {
1129
switch (columnId) {
1230
case ColumnId.picture:
1331
return this.i18n({

0 commit comments

Comments
 (0)