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

Support for internationalization (i18n) #3015

Open
2 of 6 tasks
denyo opened this issue Jan 29, 2024 · 1 comment · May be fixed by #3406
Open
2 of 6 tasks

Support for internationalization (i18n) #3015

denyo opened this issue Jan 29, 2024 · 1 comment · May be fixed by #3406
Assignees
Labels
a11y code community community request component Adds or changes of the components
Milestone

Comments

@denyo
Copy link
Contributor

denyo commented Jan 29, 2024

Scope

With the results of #2615 we want to unify intl and aria props in order to allow customization of aria-label attributes.

Therefore we do the following

  • intl prop gets deprecated
  • we add/extend aria props since currently all values affect screen readers only
  • draft for p-pagination
  /**
   * @deprecated since v3.10.0 use `aria` instead
   * Override the default wordings that are used for aria-labels on the next/prev and page buttons. */
  @Prop() public intl?: PaginationInternationalization = {
    root: 'Pagination',
    prev: 'Previous page',
    next: 'Next page',
    page: 'Page',
  };

  @Prop() public aria?: SelectedAriaAttributes<'aria-label'> & {
    prev: SelectedAriaAttributes<'aria-label'>;
    next: SelectedAriaAttributes<'aria-label'>;
    page: SelectedAriaAttributes<'aria-label'>;
  } = {
    'aria-label': 'Pagination',
    prev: { 'aria-label': 'Previous page' },
    next: { 'aria-label': 'Next page' },
    page: { 'aria-label': 'Page {{value}}' }, // important for interpolation
  };

Notes

  • It's useful to first extend component meta by screen reader wordings, which can then be used as insurance when new screen reader i18n approach is getting implemented
  • Spike: Support for internationalization (i18n) #2615
  • [SPIKE]: Support for internationalization (i18n) (Issue/2615) #3004
  • components with intl prop
    • p-carousel (Override the default wordings that are used for aria-labels on the next/prev buttons and pagination.)
    • p-pagination (Override the default wordings that are used for aria-labels on the next/prev and page buttons.)
  • components with aria prop
    • p-button
    • p-button-pure
    • p-button-tile
    • p-carousel
    • p-crest
    • p-flyout
    • p-flyout-navigation
    • p-icon
    • p-link
    • p-link-pure
    • p-link-tile
    • p-marque
    • p-modal
    • p-pagination
    • p-popover
    • p-scroller
    • p-spinner
    • p-tag-dismissible
    • p-wordmark
  • also check components like p-button that have a nested p-spinner with a hard coded aria={{ 'aria-label': 'Loading state' }} which currently is not extracted
  • Check loading-message.tsx for wordings
  • check linked PR for extracted wordings that are used together with hideLabel prop or sr-only class
  • string "options selected" should also be translatable for e.g. Multi Select
    Image

Acceptance criteria

  • Component Meta reflects all screen reader related wordings
  • aria prop is extended where needed to support multiple DOM related aria definitions
  • intl prop is deprecated (including validation and documentation) for all components and mapped to the new extended aria approach (to not have a breaking change)
  • aria configuration (limited to wordings) can be provided at PorscheDesignSystemModule and PorscheDesignSystemProvider but should still be overwriteable on component level (like it's the case for e.g. theme)
  • All screen reader related wordings can be defined by aria prop on component level or PorscheDesignSystemModule and PorscheDesignSystemProvider

Subtasks

  • Task
@denyo denyo added component Adds or changes of the components to be refined issue has to be refined a11y labels Jan 29, 2024
@stephanschroeter stephanschroeter added code community community request and removed to be refined issue has to be refined labels Jan 30, 2024
@marcelbertram marcelbertram added this to the Accessibility milestone May 28, 2024
@michaelworm michaelworm self-assigned this May 31, 2024
@michaelworm
Copy link
Contributor

The following is already done:

  • Component Meta reflects all screen reader related wordings => I took over all changes from [SPIKE]: Support for internationalization (i18n) (Issue/2615) #3004
  • intl prop is deprecated (including validation and documentation) for all components and mapped to the new extended aria approach (to not have a breaking change) => For p-carousel & p-pagination
  • string "options selected" should also be translatable for e.g. Multi Select => Done with two other occurences in this component

@henrijoss henrijoss linked a pull request Jul 18, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y code community community request component Adds or changes of the components
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

5 participants