From 8c5fc6da2f4ce715c54ad3638abcd57b89c986a3 Mon Sep 17 00:00:00 2001 From: Stefan Stoyanov Date: Thu, 10 Jan 2019 17:33:55 +0200 Subject: [PATCH 1/2] fix(*): Make default locale to be 'en', #3569 # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 1 + .../igniteui-angular/src/lib/calendar/calendar.component.ts | 6 +++--- .../src/lib/date-picker/date-picker.component.ts | 4 ++-- projects/igniteui-angular/src/lib/grids/README.md | 2 +- .../igniteui-angular/src/lib/grids/grid-base.component.ts | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 483b26f85fb..3b1ae28b935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes for each version of this project will be documented in this - `IgxTimePickerComponent`: in addition to the current dialog interaction mode, now the user can select or edit a time value, using an editable masked input with a dropdown. ## 7.1.1 + - `locale` property added. Default value is `en`. All child components will use it as locale. ### Bug Fixes * onSortingDone is not fired when sorting indicator of a header in the group by area is clicked ([#3257](https://github.com/IgniteUI/igniteui-angular/issues/3257)) * igx-grid isn't displayed properly in IE11 when it is inside an igx-tabs-group ([#3047](https://github.com/IgniteUI/igniteui-angular/issues/3047)) diff --git a/projects/igniteui-angular/src/lib/calendar/calendar.component.ts b/projects/igniteui-angular/src/lib/calendar/calendar.component.ts index fab1af6b0dc..5bb9d3abe59 100644 --- a/projects/igniteui-angular/src/lib/calendar/calendar.component.ts +++ b/projects/igniteui-angular/src/lib/calendar/calendar.component.ts @@ -142,7 +142,7 @@ export class IgxCalendarComponent implements OnInit, ControlValueAccessor { /** * Gets the `locale` of the calendar. - * By default the browser's language is used. + * Default value is `"en"`. * ```typescript * let locale = this.calendar.locale; * ``` @@ -156,7 +156,7 @@ export class IgxCalendarComponent implements OnInit, ControlValueAccessor { /** * Sets the `locale` of the calendar. * Expects a valid BCP 47 language tag. - * By default the browser's language is used. + * Default value is `"en"`. * ```html * * ``` @@ -610,7 +610,7 @@ export class IgxCalendarComponent implements OnInit, ControlValueAccessor { /** *@hidden */ - private _locale = window.navigator.language; + private _locale = 'en'; /** *@hidden */ diff --git a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts index da2da2d7ca1..d7fe3b71e6a 100644 --- a/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts +++ b/projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts @@ -146,12 +146,12 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi public labelVisibility = true; /** - *An @Input property that sets locales. By default the browser's language is used. + *An @Input property that sets locales. Default locale is en. *```html * *``` */ - @Input() public locale: string = window.navigator.language; + @Input() public locale: 'en'; /** *An @Input property that sets on which day the week starts. diff --git a/projects/igniteui-angular/src/lib/grids/README.md b/projects/igniteui-angular/src/lib/grids/README.md index 93f3e07a04a..f57425913c8 100644 --- a/projects/igniteui-angular/src/lib/grids/README.md +++ b/projects/igniteui-angular/src/lib/grids/README.md @@ -186,7 +186,7 @@ Below is the list of all inputs that the developers may set to configure the gri |`transactions`| `TransactionService` | Transaction provider allowing access to all transactions and states of the modified rows. | |`summaryPosition`| GridSummaryPosition | The summary row position for the child levels. The default is top. | |`summaryCalculationMode`| GridSummaryCalculationMode | The summary calculation mode. The default is rootAndChildLevels, which means summaries are calculated for root and child levels. | -|`locale`| string | Determines the locale of the grid. By default returns browser's language. | +|`locale`| string | Determines the locale of the grid. Default value is `en`. | ### Outputs diff --git a/projects/igniteui-angular/src/lib/grids/grid-base.component.ts b/projects/igniteui-angular/src/lib/grids/grid-base.component.ts index 9c2ba27092a..9a00914542d 100644 --- a/projects/igniteui-angular/src/lib/grids/grid-base.component.ts +++ b/projects/igniteui-angular/src/lib/grids/grid-base.component.ts @@ -302,7 +302,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements if (this._locale) { return this._locale; } else { - return window.navigator.language; + return 'en'; } } From ab520996fd690d8f832e4e94b2c3e70befece2d7 Mon Sep 17 00:00:00 2001 From: Stefan Stoyanov Date: Thu, 10 Jan 2019 17:39:49 +0200 Subject: [PATCH 2/2] chore(*): Update changelog, #3569 --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b1ae28b935..e0071785bb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ All notable changes for each version of this project will be documented in this - `IgxTimePickerComponent`: in addition to the current dialog interaction mode, now the user can select or edit a time value, using an editable masked input with a dropdown. ## 7.1.1 - - `locale` property added. Default value is `en`. All child components will use it as locale. ### Bug Fixes * onSortingDone is not fired when sorting indicator of a header in the group by area is clicked ([#3257](https://github.com/IgniteUI/igniteui-angular/issues/3257)) * igx-grid isn't displayed properly in IE11 when it is inside an igx-tabs-group ([#3047](https://github.com/IgniteUI/igniteui-angular/issues/3047)) @@ -27,7 +26,7 @@ All notable changes for each version of this project will be documented in this - Added a new `igxToolbarCustomContent` directive which can be used to mark an `ng-template` which provides a custom content for the IgxGrid's toolbar ([#2983](https://github.com/IgniteUI/igniteui-angular/issues/2983)) - Summary results are now calculated and displayed by default for each row group when 'Group By' feature is enabled. - `clearSummaryCache()` and `recalculateSummaries()` methods are deprecated. The grid will clear the cache and recalculate the summaries automatically when needed. - - `locale` property added. If not set, it returns browser's language. All child components will use it as locale. + - `locale` property added. Default value is `en`. All child components will use it as locale. - **Breaking change** `IgxSummaryOperand.operate()` method is called with empty data in order to calculate the necessary height for the summary row. For custom summary operands, the method should always return an array of `IgxSummaryResult` with proper length. - `IgxIconModule`: - **Breaking change** `igxIconService` is now provided in root (providedIn: 'root') and `IgxIconModule.forRoot()` method is deprecated.