astro-i18next icon indicating copy to clipboard operation
astro-i18next copied to clipboard

📜 Plans for v1.0.0 release

Open yassinedoghri opened this issue 2 years ago • 16 comments

astro-i18next is currently in beta. Before releasing v1.0.0, some things need to be worked out, mainly to improve DX.

Developers should be able to translate their Astro website / app as fast as possible --> reduce manual tasks to setup / use the integration.

Roadmap:

  • [x] add i18next plugins to config 👉 removed in beta.13, astro-i18next takes care of the basic stuff (loading translation strings, locale detection, etc.) 👉 added back in beta.14 (https://github.com/yassinedoghri/astro-i18next/commit/5ddb1c779367148fb0e690cd6503cba32d2bee59)
  • [x] npx astro-i18next generate: generate localized pages using command (based on config file) (https://github.com/yassinedoghri/astro-i18next/issues/13)
  • [x] Translate routes, possible thanks to @Alexandre-Fernandez ! 👉 Having routes.json files alongside pages would be best for i18n collaboration (#29)
  • [ ] #110 ❌ MAYBE NO NEED: Probably by creating a Vite plugin and adding it to the astro:config:setup hook. 👉 use astro's injectRoute function in the astro:config:setup to inject localized routes during build time. The generate CLI tool would most probably be discarded. pages folder wouldn't need to include localized pages anymore!
  • [ ] Test support for SSR ✅ Works with node adapter ❌ Doesn't work with Netlify yet: https://github.com/yassinedoghri/astro-i18next/issues/26 - Reproduction 👉 Missing support for Deno
  • [ ] Test client side i18n support ✅ Works with react 👉 try out with other frontend frameworks
  • [ ] #108
  • [ ] npx astro-i18next init: automatic astro-i18next setup / config
  • [ ] Move the documentation from README.md to the website
  • [ ] Release v1.0.0 🚀

EDIT 2022-11-06: beta.13 is now out and I'm getting closer to a clean and simple API for everyone. Any feedback is welcome!

yassinedoghri avatar Aug 22 '22 12:08 yassinedoghri

if there anything you need from us just let me know @yassinedoghri 👊

aFuzzyBear avatar Aug 22 '22 12:08 aFuzzyBear

Hot Module Reloading localized pages instead of running the npx astro-i18next generate command manually. Probably by creating a Vite plugin and adding it to the astro:config:setup hook.

This sounds super awesome!

L1lith avatar Aug 29 '22 18:08 L1lith

Great! The Hot Module Reloading is a Must-have. Can't wait :)

jaysalvat avatar Sep 23 '22 17:09 jaysalvat

would be nice to have SSR with deno too, right now can't build : Cannot bundle Node.js built-in "fs" imported from "node_modules/i18next-fs-backend/esm/fs.cjs". Consider disabling ssr.noExternal or remove the built-in dependency.

bobcafedev avatar Sep 30 '22 12:09 bobcafedev

would be nice to have SSR with deno too, right now can't build : Cannot bundle Node.js built-in "fs" imported from "node_modules/i18next-fs-backend/esm/fs.cjs". Consider disabling ssr.noExternal or remove the built-in dependency.

Hey @bobcafedev, i18next-fs-backend is not a dependency. It's a plugin you can install to load your translation files. Seeing its documentation, it can be used with deno. So in your astro-i18next config, I'm guessing you have to set the deno land url to use it:

/** @type {import('astro-i18next').AstroI18nextConfig} */
export default {
  defaultLanguage: "en",
  supportedLanguages: ["en", "fr"],
  i18next: {
    debug: true,
    initImmediate: false,
    backend: {
      loadPath: "./src/locales/{{lng}}.json",
    },
  },
  i18nextPlugins: { fsBackend: "https://deno.land/x/i18next_fs_backend/index.js" },
};

That being said, I've never used deno myself, and there maybe some more tweaking to be done in order to load i18next using its deno.land url. (https://deno.land/x/i18next/index.js)

yassinedoghri avatar Oct 01 '22 07:10 yassinedoghri

add i18next plugins to config 👉 removed in beta.13, astro-i18next takes care of the basic stuff (loading translation strings, locale detection, etc.)

Is there any documentation for supporting plugins again? Using i18next-decode-postprocessor has been crucial for avoiding loading translated strings with special characters as html, e.g. via dangerouslySetInnerHTML.

mvllow avatar Nov 13 '22 23:11 mvllow

Is there any documentation for supporting plugins again? Using i18next-decode-postprocessor has been crucial for avoiding loading translated strings with special characters as html, e.g. via dangerouslySetInnerHTML.

Not in beta.13. I'll add support for plugins in the next release. Sorry for the trouble.

Edit: it's back on beta.14

yassinedoghri avatar Nov 15 '22 16:11 yassinedoghri

@yassinedoghri is there any help you'd like around the extract functionality? That's honestly the last bit I'd love to have before jumping in 100% and wouldn't mind helping out with it.

lorenzolewis avatar Jan 17 '23 17:01 lorenzolewis

@yassinedoghri is there any help you'd like around the extract functionality? That's honestly the last bit I'd love to have before jumping in 100% and wouldn't mind helping out with it.

@lorenzolewis I wouldn't mind the help, thank you! 🙂 Just found an easy way to extract keys using i18next-scanner + merge them to resource files. Then, I'm guessing that there would only need to be a custom config for astro-i18next. Feel free to open a PR if you get it to work 👍

Edit: I've created an issue where we can discuss the implementation. #108

yassinedoghri avatar Jan 18 '23 11:01 yassinedoghri

@yassinedoghri is there a separate issue for tracking "astro's injectRoute function in the astro:config:setup to inject localized routes" ?

onionhammer avatar Jan 18 '23 16:01 onionhammer

@onionhammer just created it! #110

yassinedoghri avatar Jan 19 '23 08:01 yassinedoghri

@yassinedoghri Any plans for supporting Cloudflare SSR adapter?

Edit: I'll be glad to help with it

salloom-domani avatar Apr 24 '23 09:04 salloom-domani

@Luxauram you will need to incorporate the language into your links as well, the localizeUrl utility is for that

onionhammer avatar Jul 08 '23 13:07 onionhammer

@Luxauram you will need to incorporate the language into your links as well, the localizeUrl utility is for that

Dude sorry, you look intelligent... I have a problem with i18next and 404. I actually can't localizePath with the 404. So when I'm in the second lang pages and I type some wrong urls I get redirect to the 404 WITH THE DEFAULT Lang, not the actual I'm into.... How is this manageable? Can you help me?

Luxauram avatar Jul 10 '23 14:07 Luxauram

Hey @yassinedoghri :wave: any updates?

fnowacki avatar Feb 13 '24 18:02 fnowacki