-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(igx-grid): Add conditions localization strings, #2517
- Loading branch information
1 parent
3c2c429
commit ab530ef
Showing
3 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
projects/igniteui-angular/src/lib/core/i18n/translate.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Pipe, PipeTransform, Inject } from '@angular/core'; | ||
|
||
export class ResourceStringsComponent {} | ||
|
||
@Pipe({ | ||
name: 'translate', | ||
pure: true | ||
}) | ||
export class IgxTranslatePipe implements PipeTransform { | ||
private language; | ||
|
||
constructor(@Inject(ResourceStringsComponent) private resourceStrings: any) { | ||
this.language = navigator.language.substring(0, 2); | ||
} | ||
|
||
public transform(value: string): string { | ||
const rs = this.resourceStrings.find((x) => x.en === value); | ||
if (this.language === 'jp') { | ||
return rs.jp; | ||
} else if (this.language === 'ko') { | ||
return rs.ko; | ||
} else { | ||
return value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
projects/igniteui-angular/src/lib/grids/grid-resource-strings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
export const IgxGridResourceStrings = [ | ||
{ | ||
en: 'Filter', | ||
jp: 'Filter', | ||
ko: 'Filter' | ||
}, { | ||
en: 'Close', | ||
jp: 'Close', | ||
ko: 'Close' | ||
}, { | ||
en: 'Reset', | ||
jp: 'Reset', | ||
ko: 'Reset' | ||
}, { | ||
en: 'And', | ||
jp: 'And', | ||
ko: 'And' | ||
}, { | ||
en: 'Or', | ||
jp: 'Or', | ||
ko: 'Or' | ||
}, { | ||
en: 'Add filter value', | ||
jp: 'Add filter value', | ||
ko: 'Add filter value' | ||
}, { | ||
en: 'Contains', | ||
jp: 'Contains', | ||
ko: 'Contains' | ||
}, { | ||
en: 'Does Not Contain', | ||
jp: 'Does Not Contain', | ||
ko: 'Does Not Contain' | ||
}, { | ||
en: 'Starts With', | ||
jp: 'Starts With', | ||
ko: 'Starts With' | ||
}, { | ||
en: 'Ends With', | ||
jp: 'Ends With', | ||
ko: 'Ends With' | ||
}, { | ||
en: 'Equals', | ||
jp: 'Equals', | ||
ko: 'Equals' | ||
}, { | ||
en: 'Does Not Equal', | ||
jp: 'Does Not Equal', | ||
ko: 'Does Not Equal' | ||
}, { | ||
en: 'Empty', | ||
jp: 'Empty', | ||
ko: 'Empty' | ||
}, { | ||
en: 'Not Empty', | ||
jp: 'Not Empty', | ||
ko: 'Not Empty' | ||
}, { | ||
en: 'Null', | ||
jp: 'Null', | ||
ko: 'Null' | ||
}, { | ||
en: 'Not Null', | ||
jp: 'Not Null', | ||
ko: 'Not Null' | ||
}, { | ||
en: 'Greater Than', | ||
jp: 'Greater Than', | ||
ko: 'Greater Than' | ||
}, { | ||
en: 'Less Than', | ||
jp: 'Less Than', | ||
ko: 'Less Than' | ||
}, { | ||
en: 'Greater Than Or Equal To', | ||
jp: 'Greater Than Or Equal To', | ||
ko: 'Greater Than Or Equal To' | ||
}, { | ||
en: 'Less Than Or Equal To', | ||
jp: 'Less Than Or Equal To', | ||
ko: 'Less Than Or Equal To' | ||
}, { | ||
en: 'Before', | ||
jp: 'Before', | ||
ko: 'Before' | ||
}, { | ||
en: 'After', | ||
jp: 'Afte', | ||
ko: 'Afte' | ||
}, { | ||
en: 'Today', | ||
jp: 'Today', | ||
ko: 'Today' | ||
}, { | ||
en: 'Yesterday', | ||
jp: 'Yesterday', | ||
ko: 'Yesterday' | ||
}, { | ||
en: 'This Month', | ||
jp: 'This Month', | ||
ko: 'This Month' | ||
}, { | ||
en: 'Last Month', | ||
jp: 'Last Month', | ||
ko: 'Last Month' | ||
}, { | ||
en: 'Next Month', | ||
jp: 'Next Month', | ||
ko: 'Next Month' | ||
}, { | ||
en: 'This Year', | ||
jp: 'This Year', | ||
ko: 'This Year' | ||
}, { | ||
en: 'Last Year', | ||
jp: 'Last Year', | ||
ko: 'Last Year' | ||
}, { | ||
en: 'Next Year', | ||
jp: 'Next Year', | ||
ko: 'Next Year' | ||
}, { | ||
en: 'All', | ||
jp: 'All', | ||
ko: 'All' | ||
}, { | ||
en: 'True', | ||
jp: 'True', | ||
ko: 'True' | ||
}, { | ||
en: 'False', | ||
jp: 'False', | ||
ko: 'False' | ||
} | ||
]; |