Closed sibber11 closed 1 week ago
@sibber11
Sorry I never got a notification for this.
If you're compiling your language files in javascript (which you should be), you should have a zora.js
file.
Create a composable, I call mine useTrans
, and place it in the Composable
directory.
import { trans } from 'zora';
import { Zora } from '../zora.js';
export default function useTrans(key, replace) {
return trans(key, replace, Zora);
}
Then you can import the composable and use it as needed.
import { useTrans } from '@/Composable/useTrans.js';
const message = useTrans('auth.failed');
// {{ message }} = 'These credentials do not match our records.'
Hope that helps.
it's working in the template. but getting error when trying to use in
script setup