Skip to content

Commit

Permalink
Merge pull request #10402 from IgniteUI/sstoychev/action-strip-titles…
Browse files Browse the repository at this point in the history
…-master

feat(action-strip): titles and localization for buttons in action strip - master
  • Loading branch information
ChronosSF authored Nov 4, 2021
2 parents 14921f6 + a0e9d5b commit 5eb3e44
Show file tree
Hide file tree
Showing 27 changed files with 252 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsBG_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Още'
};

/**
* Bulgarian resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsBG = ActionStripResourceStringsBG_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsCS_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Více'
};

/**
* Czech resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsCS = ActionStripResourceStringsCS_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsDA_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mere'
};

/**
* Danish resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsDA = ActionStripResourceStringsDA_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsDE_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mehr'
};

/**
* German resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsDE = ActionStripResourceStringsDE_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsES_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Más'
};

/**
* Spanish resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsES = ActionStripResourceStringsES_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsFR_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Plus'
};

/**
* French resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsFR = ActionStripResourceStringsFR_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsHU_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Továbbiak'
};

/**
* Hungarian resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsHU = ActionStripResourceStringsHU_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsIT_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Altro'
};

/**
* Italian resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsIT = ActionStripResourceStringsIT_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsJA_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'その他'
};

/**
* Japanese resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsJA = ActionStripResourceStringsJA_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsKO_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: '더 보기'
};

/**
* Korean resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsKO = ActionStripResourceStringsKO_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsNB_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mer'
};

/**
* Norwegian resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsNB = ActionStripResourceStringsNB_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsNL_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Meer'
};

/**
* Dutch resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsNL = ActionStripResourceStringsNL_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsPL_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Więcej'
};

/**
* Polish resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsPL = ActionStripResourceStringsPL_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsPT_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mais'
};

/**
* Portuguese resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsPT = ActionStripResourceStringsPT_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsRO_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mai mult'
};

/**
* Romanian resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsRO = ActionStripResourceStringsRO_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsSV_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Mer'
};

/**
* Swedish resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsSV = ActionStripResourceStringsSV_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsTR_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: 'Diğer'
};

/**
* Turkish resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsTR = ActionStripResourceStringsTR_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsZHHANS_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: '其他'
};

/**
* Simplified Chinese (zh-Hans) resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsZHHANS = ActionStripResourceStringsZHHANS_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IActionStripResourceStrings } from 'igniteui-angular';

// exported below as re-cast to create declaration type with expanded properties
const ActionStripResourceStringsZHHANT_: ExpandRequire<IActionStripResourceStrings> = {
igx_action_strip_button_more_title: '其他'
};

/**
* Traditional Chinese (zh-Hant) resource strings for IgxActionStrip
*/
export const ActionStripResourceStringsZHHANT = ActionStripResourceStringsZHHANT_ as ExpandRequire<IActionStripResourceStrings>;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[igxToggleAction]="dropdown"
[overlaySettings]="menuOverlaySettings"
(click)="$event.stopPropagation()"
[title]="resourceStrings.igx_action_strip_button_more_title"
[igxDropDownItemNavigation]="dropdown"
>
<igx-icon>more_vert</igx-icon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
AfterViewInit
} from '@angular/core';
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions } from '../core/density';
import { IActionStripResourceStrings } from '../core/i18n/action-strip-resources';
import { CurrentResourceStrings } from '../core/i18n/resources';
import { IgxDropDownComponent } from '../drop-down/public_api';
import { CloseScrollStrategy, OverlaySettings } from '../services/public_api';
import { IgxGridActionsBaseDirective } from './grid-actions/grid-actions-base.directive';
Expand Down Expand Up @@ -114,6 +116,24 @@ export class IgxActionStripComponent extends DisplayDensityBase implements After
@Input('class')
public hostClass: string;

/**
* Gets/Sets the resource strings.
*
* @remarks
* By default it uses EN resources.
*/
@Input()
public set resourceStrings(value: IActionStripResourceStrings) {
this._resourceStrings = Object.assign({}, this._resourceStrings, value);
}

public get resourceStrings(): IActionStripResourceStrings {
if (!this._resourceStrings) {
this._resourceStrings = CurrentResourceStrings.ActionStripResourceStrings;
}
return this._resourceStrings;
}

/**
* Reference to the menu
*
Expand All @@ -132,6 +152,7 @@ export class IgxActionStripComponent extends DisplayDensityBase implements After
public menuOverlaySettings: OverlaySettings = { scrollStrategy: new CloseScrollStrategy() };

private _hidden = false;
private _resourceStrings;

constructor(
private _viewContainer: ViewContainerRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<ng-container *ngIf="!asMenuItem">
<button igxButton="icon" igxRipple (click)="handleClick($event)" (mousedown)="preventEvent($event)">
<button [title]="labelText" igxButton="icon" igxRipple (click)="handleClick($event)" (mousedown)="preventEvent($event)">
<igx-icon *ngIf="iconSet" [family]="iconSet" [name]="iconName">{{iconName}}</igx-icon>
<igx-icon *ngIf="!iconSet" >{{iconName}}</igx-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
* @internal
*/
private registerIcons() {
this.iconService.addSvgIconFromText(addRow.name, addRow.value, 'imx-icons');
this.iconService.addSvgIconFromText(addChild.name, addChild.value, 'imx-icons');
this.iconService.addSvgIconFromText(addRow.name, addRow.value, 'imx-icons', true,);
this.iconService.addSvgIconFromText(addChild.name, addChild.value, 'imx-icons', true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ export class IgxGridPinningActionsComponent extends IgxGridActionsBaseDirective
const context = this.strip.context;
const grid = context.grid;
if (grid) {
this.iconService.addSvgIconFromText(pinLeft.name, pinLeft.value, 'imx-icons');
this.iconService.addSvgIconFromText(unpinLeft.name, unpinLeft.value, 'imx-icons');
this.iconService.addSvgIconFromText(jumpDown.name, jumpDown.value, 'imx-icons');
this.iconService.addSvgIconFromText(jumpUp.name, jumpDown.value, 'imx-icons');
this.iconService.addSvgIconFromText(pinLeft.name, pinLeft.value, 'imx-icons', true);
this.iconService.addSvgIconFromText(unpinLeft.name, unpinLeft.value, 'imx-icons', true);
this.iconService.addSvgIconFromText(jumpDown.name, jumpDown.value, 'imx-icons', true);
this.iconService.addSvgIconFromText(jumpUp.name, jumpDown.value, 'imx-icons', true);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface IActionStripResourceStrings {
igx_action_strip_button_more_title?: string;
}

export const ActionStripResourceStringsEN: IActionStripResourceStrings = {
igx_action_strip_button_more_title: 'More'
};
9 changes: 6 additions & 3 deletions projects/igniteui-angular/src/lib/core/i18n/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { IListResourceStrings, ListResourceStringsEN } from './list-resources';
import { CalendarResourceStringsEN, ICalendarResourceStrings } from './calendar-resources';
import { IInputResourceStrings, InputResourceStringsEN } from './input-resources';
import { ITreeResourceStrings, TreeResourceStringsEN } from './tree-resources';
import { IActionStripResourceStrings, ActionStripResourceStringsEN } from './action-strip-resources';

export interface IResourceStrings extends IGridResourceStrings, ITimePickerResourceStrings, ICalendarResourceStrings,
ICarouselResourceStrings, IChipResourceStrings, IInputResourceStrings, IDatePickerResourceStrings, IDateRangePickerResourceStrings,
IListResourceStrings, IPaginatorResourceStrings, ITreeResourceStrings { }
IListResourceStrings, IPaginatorResourceStrings, ITreeResourceStrings, IActionStripResourceStrings { }

/**
* @hidden
Expand All @@ -38,7 +39,8 @@ export const CurrentResourceStrings = {
CarouselResStrings: cloneValue(CarouselResourceStringsEN),
ListResStrings: cloneValue(ListResourceStringsEN),
InputResStrings: cloneValue(InputResourceStringsEN),
TreeResStrings: cloneValue(TreeResourceStringsEN)
TreeResStrings: cloneValue(TreeResourceStringsEN),
ActionStripResourceStrings: cloneValue(ActionStripResourceStringsEN)
};

const updateResourceStrings = (currentStrings: IResourceStrings, newStrings: IResourceStrings) => {
Expand Down Expand Up @@ -74,5 +76,6 @@ export const getCurrentResourceStrings = (): IResourceStrings => ({
...CurrentResourceStrings.ListResStrings,
...CurrentResourceStrings.PaginatorResStrings,
...CurrentResourceStrings.TimePickerResStrings,
...CurrentResourceStrings.TreeResStrings
...CurrentResourceStrings.TreeResStrings,
...CurrentResourceStrings.ActionStripResourceStrings
});
1 change: 1 addition & 0 deletions projects/igniteui-angular/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@ export { IListResourceStrings } from './lib/core/i18n/list-resources';
export { ITreeResourceStrings } from './lib/core/i18n/tree-resources';
export { IInputResourceStrings } from './lib/core/i18n/input-resources';
export { IChipResourceStrings } from './lib/core/i18n/chip-resources';
export { IActionStripResourceStrings } from './lib/core/i18n/action-strip-resources';
export { PickerInteractionMode } from './lib/date-common/types';
export { SplitterType } from './lib/splitter/splitter.component';

0 comments on commit 5eb3e44

Please sign in to comment.