Comments (1)
The current behaviour is specifically made to mimic the globally injected properties (excluding $i18n
for now) in the component template, see https://vue-i18n.intlify.dev/guide/advanced/composition.html#implicit-with-injected-properties-and-functions, this also describes the reasoning for prefixing with $
.
I do see the value of having auto imported/initialized translation functions using the local scope in your use case, if we want to add this functionality it would still need to be prefixed with something else so we don't end up polluting the script with these variables.
First things that come to mind would either be:
- Prefixing with
$l
which communicates local scope- e.g.
{ t: $lt, d: $ld, ... }
- e.g.
- Prefixing with
$$
which communicates a deeper scope- e.g.
{ t: $$t, d: $$d, ... }
- e.g.
I'm open to suggestions and curious if more projects would be interested in this feature.
from i18n-module.
Related Issues (20)
- router.back()
- Using defineI18nLocaleDetector, event.context.i18n?.locale could be async function instead of string
- TypeScript Issue with nuxtApp.$i18n in defineNuxtPlugin HOT 2
- pages:extend pages i18n remove layout from extend pages HOT 2
- page alias no have prefix
- Can not use custom path with i18n in nuxt.config.ts HOT 2
- docs: Add note/link about i18n-t,… on components api page HOT 1
- Mobile adaptation problem of nuxt/i18n in nuxt3 HOT 1
- I18n configured the pages option and set customRoutes to true. The file path is also present, but the terminal reported an error stating that the route does not exist HOT 2
- Regression: Retrieve object nodes HOT 1
- how can I support returning objects or arrays from the language file? HOT 1
- Content with github source driver HOT 1
- useLocalePath() and then <NuxtLinkLocale> wrongly encoding paths for some uris HOT 1
- Can't match types i18n nuxt.config.ts
- useCookieLocale() does not work in server context (SSR)
- useRoute('login') does not work, it expects useRoute('login__LOCALE') HOT 11
- When override locales from Layer, I get an error: When using the langDir option the locales must be a list of objects. How to override Layer configuration from project layer? HOT 3
- Multi-Domain Website configuration with partial shared domains
- Cannot set headers after they are sent to the client - i18n cookie + redirect from auth middleware HOT 1
- Locale is back to default upon navigating HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18n-module.