Jinjiang / vue-a11y-utils

Utilities for accessibility (a11y) in Vue.js
https://jinjiang.github.io/vue-a11y-utils
MIT License
121 stars 8 forks source link

i18n integration #5

Closed nothingismagick closed 1 year ago

nothingismagick commented 5 years ago

Describe the solution you'd like I want to offer i18n, can you add best practice to the README

Describe alternatives you've considered Figuring it out myself... I "guess" but don't know if using the directive will allow me to hook into $t('aria.thing.detail') and would like guidance before I begin an integration into @quasar/testing

Jinjiang commented 5 years ago

Maybe vue-i18n is available enough. Will have a try. And yes you are right i18n is an important point which is worth to be introduced here. Thanks.

thedamon commented 5 years ago

If you are referring to the v-aria custom directive, there's no reason using vue-i18n when returning strings in the data wouldn't work:

data() {
    return {
      aria: {
        label: this.$t('label.save'),
        controls: "id-of-a-textbox"
      }
    };
  }

I didn't see any places where this library makes up strings for you, so any time you are passing in a string of your own you can provide it via $t() in a template or this.$t() in the script block