Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

RTL text rendering in components #594

Closed
@jurokapsiar

Description

@jurokapsiar

Feature Request

Problem description

Based on discussion from #5
In general, we need to get to a state where the text nodes are inside of elements that have dir='auto' attribute. This allows the browser to detect the text direction.

Proposed solution

If the text is composed of multiple parts (typically a translation with parameters), each of the parts needs to be separated in element. This is however out of scope for Stardust and should be handled in the i18n layer of the application.

Requirements:

  • use Text component to render any text inside of standard Stardust components
  • Text component renders <span dir='auto>{content} if the type of content is a string
    if user provides HTML/React nodes as an input for the component content, the user is responsible for adding dir='auto' by himself. This needs to be documented
  • revisit applying of truncateStyle in buttonStyles.ts - it needs to be applied even if the content contains or other elements

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions