-
Notifications
You must be signed in to change notification settings - Fork 119
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
Design for Import/Export APIs to replace storage plugins #1585
Comments
@martin-lysk this seems to be a great issue for you. after all, you raised this issue and now it is hurting our growth because users don't understand why feature limitations exist for different storage formats |
As discussed in Berlin, this would be a API which finally solves limitations by external plugins and is therefore a good thing. What (breaking) code change does this mean? |
I try to get the whole picture - collecting the inputs from the tickets referenced it seems like you have a concept on how this should be integrated already. Before I make a proposal that might not meet your thoughts - Shall we have a kickoff about that issue @samuelstroschein?
So instead of loading and saving messages (persistance) plugins would import / export messages from sources like like sting.dict files or even api like poeditor/localize etc. The messages imported would than be managed by the inlang sdk and stored in the .inlang folder? Storage Format: How would inlang store messages in the inlang folder?
How do we store the data:What format
How do we split data1. Store everything in one big json. All - messages with there locales/variants Pro
Con
2. Store Messages split by languages / split by namespaces
Con
My thoughts: The use case for translators should be managed by import/export plugins instead. 3. Store each message with its locales and variants in a separate file Pro
Cons
|
hey @martin-lysk
When would you start with this/the to be proposed directory change so that I know when to write my proposal ? |
I guess the planned iterations in #1459 (comment) will keep me busy this week - I could have a look next week tuesday. |
@martin-lysk okay i intend to publish more "inlang directory" proposal monday/tuesday which I would give you to implement. afterwards, the import/export stuff can be handled |
@samuelstroschein @martin-lysk @janfjohannes What's the status here? Who is leading the importer/exporter & should be assigned? |
@felixhaeberle see samuels comment: #1585 (comment) |
@felixhaeberle my directory implementaiton will come first. progress can be tracked in the https://github.com/inlang/monorepo/tree/1678-project-directory branch |
Another take on the splitting proposals of martin: While working with @NiklasBuchfink on the editor/sdk watcher we saw that not having granularity of messages is a nightmare. We watch files with thousands of messages. But we can only lint per message so as you can imagine that leads to a lot of reactive work. If we would have a solution like proposal 3 we can watch for messages and then only update and lint one message. That would be a huge advantage. I see the problem like Samuel said, that we could have problem with a lot of files then. If we can build a granular watcher that works with one file but watches on every message could solve the problem to, by shifting complexity to the watcher. -> Being able to watch for only one message should be a requirement for the SDK improvements. |
We need granular reactivity per pattern that changes. Updating a single pattern should only have the linting for that particular pattern as a side effect. A reactivity matrix is needed where we can observe changes in individual patterns and apply CRUD operations. A mappable watcher that acts like a proxy over the files would be the dream. Basically, we need the same approach for file watching as SolidJS has for its reactivity system. Avoid diffing by creating a pub/sub pattern for each small entity that is reactive. |
@NiklasBuchfink i created #1817. Let's keep this issue for importer/exporter only. |
@samuelstroschein whats your take on the scope here? shall we just add importers exporters to inlang sdk and keep the storage topic completely out of the scope of this issue? If so we would still need a plugin that provides load and save method right? Open questions:What will become the execution points for importers / exporters - when shall we trigger an import or an export? Only If storage is part of the ticket (if not we can answer those later):
Thoughts on import/export triggers:Compared to the current setup that only accepts one load and one save - importers and exporters will coexists. Projects may have an ios exporter and an android exporter and a json exporter all configured in one project. Use cases for Export Plugins
Use cases for Import Plugins
|
@martin-lysk do you think a sync call where we draft spec in google docs is quicker than github back and forth? If so, let's schedule a call |
Issue #1844 will be completed before this one. |
This proposal is a reaction to #1844 (comment) Proposal - introduction of aliases via amapIntroduce an alias map plugins can use to establish a relationship between message id and exported/imported key name. Pros*
cons
const message = {
id: "human_airplane_globe",
+ alias: {
+ plugin.inlang.i18next: "login.button",
+ plugin.inlang.xml: "login-button"
+ }
} |
This issue has been raised by @martin-lysk. We agreed that importers/exporters is the right way to go but decided at the Berlin Offsite in Oct 23 to work around the issue as long as possible. First users are confused now why they storage plugins are limiting them.
Problem
Inlang's set up to be "provide your storage plugin" leads to numerous issues:
Proposal
Storing messages should be controlled by the SDK to ensure that inlang is not limited by external plugins.
loadMessages
should be succeeded byimportMessages
saveMessages
should be succeeded byexportMessages
Pros
saveMessages()
andloadMessages()
ieb3s
should be exported aslogin-button
, orieb2s
exists in the namespace fileen/login.json
. requires .inlang folder to avoid multiple files and enable caching #1418Cons
project.inlang
folder to avoid massive scatter across a repoRequirements
The text was updated successfully, but these errors were encountered: