Skip to content

Commit

Permalink
fix(locales): add missing text & remove global config texts fix Locales
Browse files Browse the repository at this point in the history
- we shouldn't provide text in global config, we should instead provide a Key so that it doesn't conflict with Locales (TEXT_...) because if a text is provided it won't automatically go to Locales when it really should (the Footer wasn't using the Locales properly for that reason)
  • Loading branch information
ghiscoding committed Nov 24, 2021
1 parent 0c1b9e4 commit 655a872
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion examples/webpack-demo-vanilla-bundle/assets/i18n/en.json
Expand Up @@ -47,6 +47,7 @@
"OK": "OK",
"PAGE": "Page",
"PAGE_X_OF_Y": "page {{x}} of {{y}}",
"RECORDS_SELECTED": "records selected",
"REFRESH_DATASET": "Refresh Dataset",
"REMOVE_FILTER": "Remove Filter",
"REMOVE_SORT": "Remove Sort",
Expand Down Expand Up @@ -98,4 +99,4 @@
"TITLE": "Title",
"TRUE": "True",
"X_DAY_PLURAL": "{{x}} day{{plural}}"
}
}
3 changes: 2 additions & 1 deletion examples/webpack-demo-vanilla-bundle/assets/i18n/fr.json
Expand Up @@ -47,6 +47,7 @@
"OK": "Terminé",
"PAGE": "Page",
"PAGE_X_OF_Y": "page {{x}} de {{y}}",
"RECORDS_SELECTED": "enregistrements sélectionnés",
"REFRESH_DATASET": "Rafraîchir les données",
"REMOVE_FILTER": "Supprimer le filtre",
"REMOVE_SORT": "Supprimer le tri",
Expand Down Expand Up @@ -99,4 +100,4 @@
"TITLE.NAME": "Nom du Titre",
"TRUE": "Vrai",
"X_DAY_PLURAL": "{{x}} journée{{plural}}"
}
}
1 change: 1 addition & 0 deletions packages/common/src/constants.ts
Expand Up @@ -51,6 +51,7 @@ export class Constants {
TEXT_NOT_CONTAINS: 'Not contains',
TEXT_NOT_EQUAL_TO: 'Not equal to',
TEXT_PAGE: 'Page',
TEXT_RECORDS_SELECTED: 'records selected',
TEXT_REFRESH_DATASET: 'Refresh Dataset',
TEXT_REMOVE_FILTER: 'Remove Filter',
TEXT_REMOVE_SORT: 'Remove Sort',
Expand Down
8 changes: 2 additions & 6 deletions packages/common/src/global-grid-options.ts
@@ -1,5 +1,5 @@
import { DelimiterType, EventNamingStyle, FileType, GridAutosizeColsMode, OperatorType } from './enums/index';
import { Column, GridOption, TreeDataOption } from './interfaces/index';
import { Column, EmptyWarning, GridOption, TreeDataOption } from './interfaces/index';
import { Filters } from './filters';

/** Global Grid Options Defaults */
Expand Down Expand Up @@ -83,11 +83,8 @@ export const GlobalGridOptions: GridOption = {
rightContainerClass: 'col-xs-6 col-sm-7',
metricSeparator: '|',
metricTexts: {
items: 'items',
itemsKey: 'ITEMS',
of: 'of',
ofKey: 'OF',
itemsSelected: 'items selected',
itemsSelectedKey: 'ITEMS_SELECTED'
}
},
Expand Down Expand Up @@ -119,15 +116,14 @@ export const GlobalGridOptions: GridOption = {
enableEmptyDataWarningMessage: true,
emptyDataWarning: {
className: 'slick-empty-data-warning',
message: 'No data to display.',
messageKey: 'EMPTY_DATA_WARNING_MESSAGE',
hideFrozenLeftWarning: false,
hideFrozenRightWarning: false,
leftViewportMarginLeft: '40%',
rightViewportMarginLeft: '40%',
frozenLeftViewportMarginLeft: '0px',
frozenRightViewportMarginLeft: '40%',
},
} as unknown as EmptyWarning,
enableAutoResize: true,
enableAutoSizeColumns: true,
enableCellNavigation: false,
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/interfaces/locale.interface.ts
Expand Up @@ -146,6 +146,9 @@ export interface Locale {
/** Text "Page" displayed in the Pagination (when enabled) */
TEXT_PAGE?: string;

/** Text "records selected" optionally shown in the Footer (when enabled) */
TEXT_RECORDS_SELECTED?: string;

/** Text "Refresh Dataset" displayed in the Grid Menu (when enabled) */
TEXT_REFRESH_DATASET?: string;

Expand Down
Binary file not shown.
Expand Up @@ -62,7 +62,7 @@ export const SalesforceGlobalGridOptions = {
hideTotalItemCount: false,
hideLastUpdateTimestamp: true,
metricTexts: {
itemsSelected: 'records selected',
itemsSelectedKey: 'RECORDS_SELECTED',
}
},
headerRowHeight: 35,
Expand Down

0 comments on commit 655a872

Please sign in to comment.