opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
22 stars 0 forks source link

Create ParaglideJS Inlang plugin #140

Closed felixhaeberle closed 1 month ago

felixhaeberle commented 1 month ago

@lorissigrist Do you see the value in bundling the inlang message format plugin & the m function matcher in a dedicated paraglidejs plugin to have a more convenient handling of modules?

see also https://discord.com/channels/897438559458430986/1084866749842870333/1247389185862533220 where user has issue identifying how to get Sherlock to work. This happens on a weekly basis, and probably much more silently.

Originally posted by @felixhaeberle in https://github.com/opral/inlang.com/issues/85#issuecomment-2147127098

NilsJacobsen commented 1 month ago

I think we used to have the problem that a paraglide plugin was needed as a module and then you would have had two paraglide modules, which cased confusion.

The next reason was that we thought that it should be possible to use paraglide with more then one storage. Since we use different keys, that is not really a thing anymore, right?

Sry, this is not super accurate. Just trying to dig in the depths of my brain :D

LorisSigrist commented 1 month ago

I'm not sure if that's a good idea, since we would be tie-ing the storage format to the API used in code.

Given that the init channels usually add both the m-function matcher & the inlang-message-format: Do we know how users end up with these half-setups?

NilsJacobsen commented 1 month ago

Paraglide doesn't need a storage plugin with persistency. So this is only about the matcher for paraglide.

felixhaeberle commented 1 month ago

I'm not sure if that's a good idea, since we would be tie-ing the storage format to the API used in code.

This was discussed yesterday with @samuelstroschein – I also had this misconception.

With importer/exporter saveMessage/loadMessage will become importMessage/exportMessage – with the main change that not last one wins anymore but multiple importer/exporter plugins are allowed then, making the import/export of the ParaglideJS plugin the default one + one of many.

Currently, it would mean the limitation you described.

Given that the init channels usually add both the m-function matcher & the inlang-message-format: Do we know how users end up with these half-setups?

🤷🏼 – manual setup? don't know, but happens often.

LorisSigrist commented 1 month ago

I see. In that case doesn't it make more sense to wait for persistence to land before doing something like this?

samuelstroschein commented 1 month ago

Yes, let's wait for persistence.