-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
feat: support js and ts extension resource formats #1938
Conversation
@kazupon would love if it will be merged soon and released! Thank you for that feature! |
Good things come to those who wait π |
How about a composable to help locale functions be typed? Something like: type LocaleFunction = (context: NuxtApp, locale: Locale) => MaybePromise<Record<string, any> | any>
export const defineI18nLocale = (p: LocaleFunction) => p Also, maybe |
Thank you for your review!!
Sorry, What do that compostables mean? The functionality we will support is defined in the |
I may not be using the term appropriately, but just a helper/wrapper function used in JavaScript files in export default {
modules: ['@nuxtjs/i18n'],
i18n: {}
} But this wouldn't be an easily typed config (also without JSDoc). So with the composable, this is what I mean: export default defineI18nLocale((context, locale) => {
return {}
}) compared to export default function (context, locale) => {
// what types are context and locale??
} Because If this is still confusing, that's fine - I can still make a separate PR for it myself immediately after this has been merged. |
@ineshbose could you please review? I'm counting days and hours when it will be released π |
@pumano I'm reviewing the changes continuously - but it'll be kazupon himself to decide when it's ready π |
@kazupon could you please release new version? I'm really need this feature. |
It should be released on edge (just checked, doesn't seem to be there π€), but a tagged release may take a while. |
@ineshbose it looks like release edge step was skipped |
I've just tried to release with github action |
Hi @kazupon , Is there any timeline when js/ts will be available for localization files? Or is it already there and I'm missing something? because I'm still not able to use files like en.js, es.js etc although en.json is working fine. Regards |
You can conigure nuxt i18n is currently v8 RC, so it will be made available by default if no critical issues are reported. |
* docs: typos * feat: support js and ts extension resource formats * add server handler skelton * feat: support js and ts extension resource formats * add server handler skelton * basic implementation * refactor * support ssg * update snapshot * bump * fix: change to $config using * fix: strip type annotation on typescript codes * refactoring * docs: updates * fix: updates * fix: more updates * add defineI18nLocale * remove unnecesary deps * add `precompile` options * fix: update snapshots * chore: bump deps * docs: updates * refactor: remove codes --------- Co-authored-by: pierresaid <said.pierre.emler@gmail.com> Co-authored-by: Inesh Bose <56732164+ineshbose@users.noreply.github.com>
π Linked issue
close #1576
close #1448
β Type of change
π Description
π Checklist