Skip to content

Commit

Permalink
Merge pull request #550 from ghiscoding/bugfix/unfreeze-columns-trans…
Browse files Browse the repository at this point in the history
…lation

fix(translation): add new UNFREEZE_COLUMNS to fix translation
  • Loading branch information
AnnetteZhang authored Nov 17, 2021
2 parents 9c70be5 + 0010861 commit fdc0fc4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/webpack-demo-vanilla-bundle/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"SYNCHRONOUS_RESIZE": "Synchronous resize",
"TOGGLE_FILTER_ROW": "Toggle Filter Row",
"TOGGLE_PRE_HEADER_ROW": "Toggle Pre-Header Row",
"UNFREEZE_COLUMNS": "Unfreeze Columns",
"X_OF_Y_SELECTED": "# of % selected",
"X_OF_Y_MASS_SELECTED": "{{x}} of {{y}} selected",
"BILLING": {
Expand Down Expand Up @@ -94,4 +95,4 @@
"TASK_X": "Task {{x}}",
"TITLE": "Title",
"TRUE": "True"
}
}
3 changes: 2 additions & 1 deletion examples/webpack-demo-vanilla-bundle/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"SYNCHRONOUS_RESIZE": "Redimension synchrone",
"TOGGLE_FILTER_ROW": "Basculer la ligne des filtres",
"TOGGLE_PRE_HEADER_ROW": "Basculer la ligne de pré-en-tête",
"UNFREEZE_COLUMNS": "Dégeler les colonnes",
"X_OF_Y_SELECTED": "# de % sélectionnés",
"X_OF_Y_MASS_SELECTED": "{{x}} de {{y}} sélectionnés",
"BILLING": {
Expand Down Expand Up @@ -95,4 +96,4 @@
"TITLE": "Titre",
"TITLE.NAME": "Nom du Titre",
"TRUE": "Vrai"
}
}
1 change: 1 addition & 0 deletions packages/common/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class Constants {
TEXT_STARTS_WITH: 'Starts With',
TEXT_TOGGLE_FILTER_ROW: 'Toggle Filter Row',
TEXT_TOGGLE_PRE_HEADER_ROW: 'Toggle Pre-Header Row',
TEXT_UNFREEZE_COLUMNS: 'Unfreeze Columns',
TEXT_X_OF_Y_SELECTED: '# of % selected',
TEXT_X_OF_Y_MASS_SELECTED: '{{x}} of {{y}} selected',
};
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/extensions/gridMenuExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,11 @@ export class GridMenuExtension implements Extension {
if (this.sharedService.gridOptions && this._gridMenuOptions && !this._gridMenuOptions.hideClearFrozenColumnsCommand) {
const commandName = 'clear-pinning';
if (!originalCustomItems.some(item => item !== 'divider' && item.hasOwnProperty('command') && item.command === commandName)) {
const translationKey = commandLabels?.clearFrozenColumnsCommandKey ?? 'CLEAR_PINNING';
gridMenuCustomItems.push(
{
iconCssClass: this._gridMenuOptions.iconClearFrozenColumnsCommand || 'fa fa-times',
title: this.extensionUtility.translateWhenEnabledAndServiceExist(`${translationPrefix}${commandLabels?.clearFrozenColumnsCommandKey}`, 'TEXT_CLEAR_PINNING', commandLabels?.clearFrozenColumnsCommand),
title: this.extensionUtility.translateWhenEnabledAndServiceExist(`${translationPrefix}${translationKey}`, `TEXT_${translationKey}`, commandLabels?.clearFrozenColumnsCommand),
disabled: false,
command: commandName,
positionOrder: 52
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/interfaces/locale.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ export interface Locale {
/** Text "Toggle Pre-Header Row" shown in Grid Menu (when enabled) */
TEXT_TOGGLE_PRE_HEADER_ROW?: string;

/** Text "Unfreeze Columns" shown in Grid Menu, this is an alternative to the text (CLEAR_PINNING: Unfreeze Columns/Rows) */
TEXT_UNFREEZE_COLUMNS?: string;

/** Text "x of y selected" displayed in the Multiple Select Editor/Filter */
TEXT_X_OF_Y_SELECTED: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const SalesforceGlobalGridOptions = {
},
gridMenu: {
commandLabels: {
clearFrozenColumnsCommand: 'Unfreeze Columns',
clearFrozenColumnsCommandKey: 'UNFREEZE_COLUMNS',
},
hideTogglePreHeaderCommand: true,
hideRefreshDatasetCommand: true,
Expand Down

0 comments on commit fdc0fc4

Please sign in to comment.