Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add built-in translations #5471

Merged
merged 104 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
ac26754
feat: add built-in translations
anveshmekala Oct 13, 2022
52a9d65
feat(color-picker): add built-in translations (#5431)
jcfranco Oct 17, 2022
71726ce
feat(scrim): add built-in translations (#5435)
jcfranco Oct 17, 2022
2b2b9cc
feat(popover): add built-in translations (#5436)
jcfranco Oct 17, 2022
47d0c19
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 17, 2022
db02d58
feat(flow-item, panel): add built-in translations (#5433)
jcfranco Oct 17, 2022
26f3ffd
feat(value-list): add built-in translations (#5438)
jcfranco Oct 17, 2022
e368bf8
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 17, 2022
e2b4e82
add missing type
anveshmekala Oct 17, 2022
eb9a474
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 17, 2022
a2ed4d4
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 18, 2022
c4e619b
feat(notice): add built-in translations (#5463)
anveshmekala Oct 18, 2022
1a6afcd
feat(inline-editable): add built-in translations (#5457)
anveshmekala Oct 18, 2022
f8e0449
feat(filter): add built-in translations (#5456)
anveshmekala Oct 18, 2022
f538b4e
feat(combobox): add built-in translations (#5455)
anveshmekala Oct 18, 2022
e259a55
feat(card): add built-in translations (#5450)
anveshmekala Oct 18, 2022
85070de
feat(block,block-section): add built-in translations (#5446)
anveshmekala Oct 18, 2022
4baa273
feat(alert): add support for built-in translations (#5444)
anveshmekala Oct 18, 2022
21bdc0d
feat(chip): add built-in translations (#5465)
anveshmekala Oct 18, 2022
b5b2471
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 18, 2022
22d21db
feat(time-picker,input-time-picker): add built-in translations suppor…
anveshmekala Oct 19, 2022
8c47836
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 19, 2022
ad3558a
feat(date-picker,input-date-picker): add support for built-in transla…
anveshmekala Oct 19, 2022
0a9779a
feat(input-number, input, input-text): add built-in translations (#5458)
anveshmekala Oct 19, 2022
8c686ec
feat(rating): add built-in translations (#5437)
jcfranco Oct 19, 2022
ffe5f83
feat(pick-list-item): add built-in translations (#5434)
jcfranco Oct 19, 2022
d47cb2d
feat(pagination): add built-in translations (#5432)
jcfranco Oct 19, 2022
935c607
feat(modal): add built-in translations (#5462)
anveshmekala Oct 19, 2022
c24f313
replace nb with no in e2e
anveshmekala Oct 19, 2022
9a46ab1
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 19, 2022
fcc25d8
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 20, 2022
10f8af9
chore: nitpicky clean up changes for the t9n PR (#5524)
benelan Oct 22, 2022
7bc4c50
feat(button): add built-in translations (#5447)
anveshmekala Oct 26, 2022
964e741
feat(action,action-bar, action-group,action-pad): add built in transl…
anveshmekala Oct 26, 2022
f7ea667
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Oct 26, 2022
7c9343a
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Nov 1, 2022
611c757
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Nov 19, 2022
1a970c9
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Nov 19, 2022
2542534
removed unused imports
anveshmekala Nov 21, 2022
5dff285
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Nov 21, 2022
8cbf985
update package-lock
anveshmekala Nov 21, 2022
730840a
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Nov 30, 2022
4aa183c
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 5, 2022
bf04ed4
fix test errors
anveshmekala Dec 5, 2022
af59697
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 5, 2022
3f2c14f
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 5, 2022
35bfc6f
add screenshot tests
anveshmekala Dec 7, 2022
a1198cb
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 7, 2022
b80953b
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 8, 2022
86db26d
update internationalization doc
anveshmekala Dec 8, 2022
d0e2dc3
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 8, 2022
6a4525c
cleanup
anveshmekala Dec 8, 2022
2c0ee1b
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 8, 2022
df869d3
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 8, 2022
5e5dcff
overwrite git auto merge
anveshmekala Dec 8, 2022
157ac45
revert package-lock changes
anveshmekala Dec 8, 2022
e54c181
remove usage of intlindicator in action render methods
anveshmekala Dec 8, 2022
4be2cd4
add type for supported locales
anveshmekala Dec 9, 2022
6eec274
feedback changes
anveshmekala Dec 9, 2022
a5ef4fb
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 9, 2022
90a6a69
fix test errors
anveshmekala Dec 9, 2022
177d0b6
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 9, 2022
c85b4ab
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 9, 2022
578ce13
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 9, 2022
2db00c6
fix date-picker test error
anveshmekala Dec 9, 2022
bbe1214
remove is-active attr on loader in block
anveshmekala Dec 9, 2022
ceb9860
add support for zh locale
anveshmekala Dec 9, 2022
dd2fc7e
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 10, 2022
3a69a60
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 12, 2022
64501d4
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 12, 2022
2eb7b77
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 12, 2022
62f10b5
remove intl defaults from stories
anveshmekala Dec 12, 2022
f90ec3d
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 12, 2022
67e80a3
remove intl default value from stories
anveshmekala Dec 12, 2022
0749eb7
fix mistyped locale codes
anveshmekala Dec 13, 2022
c1df504
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
d2aa449
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
d3aa2d3
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
8ecdf67
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
c8aeea6
delay setup messages in action-pad
anveshmekala Dec 13, 2022
324e60b
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
c98c1b1
refactor action-pad stories
anveshmekala Dec 13, 2022
de0fcd5
refactor
anveshmekala Dec 13, 2022
31278ee
add comment for renaming intl props of ExpandToggle
anveshmekala Dec 13, 2022
42d6cf8
fix tests
anveshmekala Dec 13, 2022
20053de
add delay for screenshots
anveshmekala Dec 13, 2022
32c8796
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
6028c28
remove stepstory
anveshmekala Dec 13, 2022
30d02ee
bump delay
anveshmekala Dec 13, 2022
cdf8f4c
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
b41d0bd
bump delay more
anveshmekala Dec 13, 2022
9ce6d37
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
76c1fc3
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
9b3bc05
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
ad1dfeb
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 13, 2022
83fca1f
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 14, 2022
f52ca25
add page.wait in shared list tests
anveshmekala Dec 14, 2022
5566f06
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 14, 2022
f24478a
doc update
anveshmekala Dec 14, 2022
1d678d3
add more waitForChanges( ) in shared list tests
anveshmekala Dec 14, 2022
3e809d6
refactor
anveshmekala Dec 14, 2022
2890a27
cleanup
anveshmekala Dec 14, 2022
a7d968e
Merge branch 'master' into anveshmekala/4961-add-built-in-pseudo-tran…
anveshmekala Dec 14, 2022
f36acf2
increase delay
anveshmekala Dec 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions conventions/Internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For these properties, you should use the internal `getElementDir` helper to appl

## Translation (t9n)

Previously, components provided Intl props (`intl<Prop>`) to allow users to pass string translations. While this is still supported, for backwards compatibility, our components have translations built-in.
Previously, components provided Intl properties (`intl<Prop>`) to allow users to pass string translations. While this is still supported for backwards compatibility, our components also have translations built-in.

The following section covers how to add built-in translation support to components.

Expand All @@ -34,19 +34,25 @@ This pattern enables components to support built-in translations. In order to su
2. `messages_en.json` – locale-specific bundle (kept in sync with main one via scripts)
2. Implement the `T9nComponent` interface
1. The `onMessagesChange` method must be empty as it is wired up by the support utils.
2. The `onMessagesChange` method must also be configured with watchers for the messages properties as well as Intl props.
2. The `onMessagesChange` method must also be configured with watchers for the messages properties as well as `intl` props.
3. Use the `setUpMessages` util in the component's `componentWillLoad` lifecycle methods. This must be awaited on to have an initial set of strings available before rendering.
4. Use the `connectMessages`/`disconnectMessages` utils in the component's `connectedCallback`/`disconnectedCallback` lifecycle methods. This will set up and tear down supporting methods on the component.
5. Add an appropriate E2E test by using the `t9n` common test helper.
6. Components such as `input-date-picker` are neither localized nor `t9n` need to forward `intl` props into supporting components.
1. Add the `messageOverrides` property.
2. Mark `intl` properties as optional, and add a deprecation notice pointing to `messageOverrides` as the new solution.
3. Parse the `messageOverrides` along with `intl` properties into supporting components in render method.
7. Internal components which support public components requires `t9n` properties only to forward the messages.

#### Notes

- This pattern depends on `LocalizedComponent` being implemented.
- `connectLocalized` (from `LocalizedComponent`) must be called before `connectMessages`.
- Although Intl props are supported, message overrides have the higher precedence.
- If a message string has a matching Intl prop, its translation bundle message keys must match the same prop name without the `intl` prefix (e.g., `intlClose` -> `close`)
- Although `intl` properties are supported, message overrides have the higher precedence.
- If a message string has a matching `intl` prop, its translation bundle message keys must match the same prop name without the `intl` prefix (e.g., `intlClose` -> `close`)
- You can also look at the interface and util documentation for additional info.
- The internal `messages` prop should be used as the source of truth for translations in rendering.
- The internal `messages` property should be used as the source of truth for translations in rendering.
- List of supported locales can be found on our [Localization support page](https://developers.arcgis.com/calcite-design-system/localization/#locale-support).

## Translated strings

Expand All @@ -57,7 +63,7 @@ In the future it will likely become necessary to provide string translations for
- https://medium.com/stencil-tricks/implementing-internationalisation-i18n-with-stencil-5e6559554117 and https://codesandbox.io/s/43pmx55vo9
- https://github.com/ionic-team/ionic-stencil-conference-app/issues/69

Until we implement a `lang` facility and set up translations for all components, we have been allowing a small number of strings to be passed in as props. Props that represent translated strings should have the syntax: `text-label-x`, where `x` is the name for the string. For example, when providing a string from "Close", use the prop name `text-label-close`. In the component, these props should default to their English equivalent (this is useful for non-localized apps):
Until we implement a `lang` facility and set up translations for all components, we have been allowing a small number of strings to be passed in as properties. Properties that represent translated strings should have the syntax: `text-label-x`, where `x` is the name for the string. For example, when providing a string from "Close", use the property name `text-label-close`. In the component, these properties should default to their English equivalent (this is useful for non-localized apps):

```
@Prop() textLabelClose: string = 'Close';
Expand Down
4 changes: 3 additions & 1 deletion src/components/action-bar/action-bar.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { newE2EPage } from "@stencil/core/testing";
import { accessible, defaults, focusable, hidden, reflects, renders, slots } from "../../tests/commonTests";
import { accessible, defaults, focusable, hidden, reflects, renders, slots, t9n } from "../../tests/commonTests";
import { CSS, SLOTS } from "./resources";
import { overflowActionsDebounceInMs } from "./utils";
import { html } from "../../../support/formatting";
Expand Down Expand Up @@ -382,4 +382,6 @@ describe("calcite-action-bar", () => {
expect(await page.findAll(slottedActionsSelector)).toHaveLength(2);
});
});

it("supports translation", () => t9n("calcite-action-bar"));
});
47 changes: 30 additions & 17 deletions src/components/action-bar/action-bar.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import readme from "./readme.md";
import { ATTRIBUTES } from "../../../.storybook/resources";
import { html } from "../../../support/formatting";
import { TEXT } from "./resources";
import { storyFilters } from "../../../.storybook/helpers";

export default {
Expand Down Expand Up @@ -41,22 +40,6 @@ const createAttributes: (options?: { exceptions: string[] }) => Attributes = ({
return this;
}
},
{
name: "intl-expand",
commit(): Attribute {
this.value = text("intlExpand", TEXT.expand);
delete this.build;
return this;
}
},
{
name: "intl-collapse",
commit(): Attribute {
this.value = text("intlCollapse", TEXT.collapse);
delete this.build;
return this;
}
},
{
name: "position",
commit(): Attribute {
Expand Down Expand Up @@ -178,3 +161,33 @@ export const withTooltip_NoTest = (): string =>
withTooltip_NoTest.parameters = {
chromatic: { disableSnapshot: true }
};

export const hebrewLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="he">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;

export const norwegianLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="nb">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;

export const FrenchLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="fr">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;

export const hongKongLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="zh-HK">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;

export const ukranianLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="uk">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;

export const bosnianLocale_TestOnly = (): string => `<calcite-action-bar expanded lang="bs">
<calcite-action text="Information" icon="information"></calcite-action>
<calcite-action text="Feedback" slot="bottom-actions" icon="mega-phone"></calcite-action>
</calcite-action-bar>`;
85 changes: 62 additions & 23 deletions src/components/action-bar/action-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import {
Watch,
h,
VNode,
Method
Method,
State
} from "@stencil/core";
import { Position, Scale, Layout } from "../interfaces";
import { ExpandToggle, toggleChildActionText } from "../functional/ExpandToggle";
import { CSS, SLOTS, TEXT } from "./resources";
import { CSS, SLOTS } from "./resources";
import { getSlotted, focusElement } from "../../utils/dom";
import {
geActionDimensions,
Expand All @@ -28,6 +29,15 @@ import {
disconnectConditionalSlotComponent,
ConditionalSlotComponent
} from "../../utils/conditionalSlot";
import { connectLocalized, disconnectLocalized, LocalizedComponent } from "../../utils/locale";
import {
connectMessages,
disconnectMessages,
setUpMessages,
T9nComponent,
updateMessages
} from "../../utils/t9n";
import { Messages } from "./assets/action-bar/t9n";
import {
setUpLoadableComponent,
setComponentLoaded,
Expand All @@ -43,9 +53,12 @@ import {
@Component({
tag: "calcite-action-bar",
styleUrl: "action-bar.scss",
shadow: true
shadow: true,
assetsDirs: ["assets"]
})
export class ActionBar implements ConditionalSlotComponent, LoadableComponent {
export class ActionBar
implements ConditionalSlotComponent, LoadableComponent, LocalizedComponent, T9nComponent
{
// --------------------------------------------------------------------------
//
// Properties
Expand Down Expand Up @@ -75,11 +88,15 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {

/**
* Specifies the label of the expand icon when the component is collapsed.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlExpand: string;

/**
* Specifies the label of the collapse icon when the component is expanded.
*
* @deprecated - translations are now built-in, if you need to override a string, please use `messageOverrides`
*/
@Prop() intlCollapse: string;

Expand Down Expand Up @@ -110,6 +127,25 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {
*/
@Prop({ reflect: true }) scale: Scale;

/**
* Made into a prop for testing purposes only
*
* @internal
*/
@Prop({ mutable: true }) messages: Messages;

/**
* Use this property to override individual strings used by the component.
*/
@Prop({ mutable: true }) messageOverrides: Partial<Messages>;

@Watch("intlCollapse")
@Watch("intlExpand")
@Watch("messageOverrides")
onMessagesChange(): void {
/* wired up by t9n util */
}

// --------------------------------------------------------------------------
//
// Events
Expand Down Expand Up @@ -139,16 +175,21 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {

expandToggleEl: HTMLCalciteActionElement;

@State() effectiveLocale: string;

@Watch("effectiveLocale")
effectiveLocaleChange(): void {
updateMessages(this, this.effectiveLocale);
}

@State() defaultMessages: Messages;

// --------------------------------------------------------------------------
//
// Lifecycle
//
// --------------------------------------------------------------------------

componentWillLoad(): void {
setUpLoadableComponent(this);
}

componentDidLoad(): void {
setComponentLoaded(this);
this.conditionallyOverflowActions();
Expand All @@ -157,6 +198,8 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {
connectedCallback(): void {
const { el, expanded } = this;

connectLocalized(this);
connectMessages(this);
toggleChildActionText({ parent: el, expanded });

this.mutationObserver?.observe(el, { childList: true, subtree: true });
Expand All @@ -169,10 +212,17 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {
connectConditionalSlotComponent(this);
}

async componentWillLoad(): Promise<void> {
setUpLoadableComponent(this);
await setUpMessages(this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcfranco now that we're delaying componentDidLoad more with fetching async messages, I wonder if we need to prioritize updating our setFocus() methods to wait for the component to be rendered the first time before proceeding with focusing?

#5369 is a priority for MapViewer and I'd like to try and fix it and make them not have to increase any timeouts they have currently for focusing.

}

disconnectedCallback(): void {
this.mutationObserver?.disconnect();
this.resizeObserver?.disconnect();
disconnectConditionalSlotComponent(this);
disconnectLocalized(this);
disconnectMessages(this);
}

// --------------------------------------------------------------------------
Expand Down Expand Up @@ -290,28 +340,17 @@ export class ActionBar implements ConditionalSlotComponent, LoadableComponent {
// --------------------------------------------------------------------------

renderBottomActionGroup(): VNode {
const {
expanded,
expandDisabled,
intlExpand,
intlCollapse,
el,
position,
toggleExpand,
scale,
layout
} = this;
const { expanded, expandDisabled, el, position, toggleExpand, scale, layout, messages } = this;

const tooltip = getSlotted(el, SLOTS.expandTooltip) as HTMLCalciteTooltipElement;
const expandLabel = intlExpand || TEXT.expand;
const collapseLabel = intlCollapse || TEXT.collapse;

const expandToggleNode = !expandDisabled ? (
<ExpandToggle
el={el}
expanded={expanded}
intlCollapse={collapseLabel}
intlExpand={expandLabel}
// rename intl properties for 1.0
intlCollapse={messages.collapse}
intlExpand={messages.expand}
position={position}
ref={this.setExpandToggleRef}
scale={scale}
Expand Down
5 changes: 0 additions & 5 deletions src/components/action-bar/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ export const SLOTS = {
bottomActions: "bottom-actions",
expandTooltip: "expand-tooltip"
};

export const TEXT = {
expand: "Expand",
collapse: "Collapse"
};
4 changes: 3 additions & 1 deletion src/components/action-group/action-group.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { accessible, hidden, renders, slots } from "../../tests/commonTests";
import { accessible, hidden, renders, slots, t9n } from "../../tests/commonTests";
import { newE2EPage } from "@stencil/core/testing";
import { SLOTS } from "./resources";

Expand Down Expand Up @@ -28,4 +28,6 @@ describe("calcite-action-group", () => {

expect(await menu.getProperty("scale")).toBe("l");
});

it("support translation", () => t9n("calcite-action-group"));
});
36 changes: 36 additions & 0 deletions src/components/action-group/action-group.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,39 @@ export const gridCenteringOfActionsInAGroup = (): string => html`
</calcite-action-group>
</div>
`;

export const arabicLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="ar">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;

export const germanLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="de">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;

export const norwegianLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="no">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;

export const ChineseLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="zh-CN">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;

export const GreekLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="el">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;

export const TurkishLocale_TestOnly = (): string => html`<div style="width:400px">
<calcite-action-group expanded lang="tr">
<calcite-dropdown slot="menu-actions"> </calcite-dropdown>
</calcite-action-group>
</div>`;
Loading