-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add I18N feature #359
Comments
Do you intend that // main.ts
import { createSefirot } from '@globalbrain/seifort'
import { ja } from '@globalbrain/seifort/lib/lang'
const sefirot = createSefirot({
langs: { ja },
})
app.use(sefirot) Or, an alternative would be renaming the exported function for it to be more locale-specific. // main.ts
import { createI18n, ja } from '@globalbrain/seifort/lib/lang'
const i18n = createI18n({
langs: { ja },
})
app.use(i18n) |
Ah yeah, sorry. Your first one is correct 😅 Updated the description. But instead of |
I was thinking about this the other day, our challenge at the moment might be how do we pass translations into validation rules 🤔 They are not composable so... we might have to get creative here. |
close #359 --------- Co-authored-by: Divyansh Singh <[email protected]>
It would be super cool if we can have default Japanese messages for things like validation error messages.
So, how about this design.
Installation and usage
First we use Pinia to store locale for Sefirot. We can also use
provide/inject
but since we are already using Pinia for Snackbars, I think it would be easier.To be able to tree shake, let user install lang as a plugin.
In user's app, set Sefirot locale when setting app locale. Directly to Sefirot Lang Store.
Customization
User could create their own locale file to pass in as an plugin options. Maybe we should make the locale file flat, and make it easier to merge 🤔
The text was updated successfully, but these errors were encountered: