diff --git a/libs/components/src/i18n/i18n.component.ts b/libs/components/src/i18n/i18n.component.ts index 61b1fdb2a05..edf12c5fa1c 100644 --- a/libs/components/src/i18n/i18n.component.ts +++ b/libs/components/src/i18n/i18n.component.ts @@ -39,7 +39,7 @@ interface I18nStringPart { * */ @Component({ - selector: "[bit-i18n],bit-i18n", + selector: "[bit-i18n]", imports: [SharedModule], template: ` diff --git a/libs/components/src/i18n/i18n.mdx b/libs/components/src/i18n/i18n.mdx index 507886c0a8f..977788b385f 100644 --- a/libs/components/src/i18n/i18n.mdx +++ b/libs/components/src/i18n/i18n.mdx @@ -6,7 +6,7 @@ import * as stories from "./i18n.stories"; # I18n with Template Wrapping -The `` component is an alternative to the `i18n` pipe that supports template wrapping. It +The `[bit-i18n]` component is an alternative to the `i18n` pipe that supports template wrapping. It supports wrapping developer defined tags around parts the translated text. It allows translators to translate the original text more accurately and so that it still follows the grammar rules of the target language. @@ -31,7 +31,7 @@ content will be rendered as is. "This is an example with <0>link tags and <1>bold tags. The entire sentence can be <2>translated as a whole and re-arranged according to each language's grammar rules." --> - +
{{ text }} @@ -40,27 +40,7 @@ content will be rendered as is. {{ text }} - -``` - -## Attribute Selector Example - -You can also use the `bit-i18n` as an attribute to avoid creating an extra element in the DOM. - - - -
- -### Source - -```html - -

- {{ text }} - {{ text }} -

+
``` ## Missing Template Example @@ -79,13 +59,13 @@ be rendered as is. "This is an example with <0>link tags and <1>bold tags. The entire sentence can be <2>translated as a whole and re-arranged according to each language's grammar rules." --> - +
{{ text }} {{ text }} - +
``` ## Missing Template Example @@ -102,8 +82,8 @@ You can also pass arguments to the `i18nService.t()` method via the `[args]` inp - + ``` diff --git a/libs/components/src/i18n/i18n.stories.ts b/libs/components/src/i18n/i18n.stories.ts index c0e5f061012..72a69eab81a 100644 --- a/libs/components/src/i18n/i18n.stories.ts +++ b/libs/components/src/i18n/i18n.stories.ts @@ -41,25 +41,13 @@ export const Basic: Story = { render: (args) => ({ props: args, template: ` - +
{{ text }} {{ text }} {{ text }} - - `, - }), -}; - -export const AttributeSelector: Story = { - render: (args) => ({ - props: args, - template: ` -

- {{ text }} - {{ text }} -

+
`, }), };