Skip to content

Commit

Permalink
feat(composition): Add $t and $ta methods to useFluent()
Browse files Browse the repository at this point in the history
These are just aliases to format and formatAttrs
  • Loading branch information
Demivan committed Feb 23, 2021
1 parent 21ecbd7 commit 2697abe
Show file tree
Hide file tree
Showing 4 changed files with 1,304 additions and 1,456 deletions.
10 changes: 5 additions & 5 deletions examples/vue-3-vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"@fluent/bundle": "^0.16.0",
"@fluent/dedent": "^0.3.0",
"core-js": "^3.8.1",
"vue": "^3.0.2",
"fluent-vue": "file:../../packages/fluent-vue"
"fluent-vue": "file:../../packages/fluent-vue",
"vue": "^3.0.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0-alpha.0",
"@vue/cli-service": "~5.0.0-alpha.0",
"@vue/compiler-sfc": "^3.0.2",
"@vue/cli-plugin-babel": "~5.0.0-alpha.4",
"@vue/cli-service": "~5.0.0-alpha.4",
"@vue/compiler-sfc": "^3.0.5",
"fluent-vue-loader": "file:../../packages/fluent-vue-loader"
},
"browserslist": [
Expand Down
10 changes: 6 additions & 4 deletions examples/vue-3-vue-cli/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@
<div>
<i18n path="greeting" tag="div">
<template #name>
<b>{{ $t('user-name') }}</b>
<b>{{ username }}</b>
</template>
</i18n>
</div>
</div>
</template>

<script>
export default {
}
<script setup lang="ts">
import { useFluent } from 'fluent-vue'
const fluent = useFluent()
const username = fluent.$t('user-name')
</script>

<i18n locale="en">
Expand Down
Loading

0 comments on commit 2697abe

Please sign in to comment.