For windows at least it's better to manufacture our own file extension so the application can be launched for that extension.
I love the idea of being able to double-click a blob you've downloaded, and translateLocally just importing & selecting it.
To implement this, I think we'll need to do the following:
Come up with an extension.
.translationmodel
.languagemodel
.tlmodel
.tllanguage
something unique, not too long, possibly understandable
Per platform…
Add proper metadata to tell OS that TranslateLocally can open these files
Implement message handlers that trigger when the OS wants to open a file (macOS, don't know about win & linux at the moment)
Then, we'll need to decide what to do when someone does open a model file:
As a macOS user, I would expect that double-clicking a model file will import it into my local library of models, and probably switch the interface to use that newly imported model. TranslateLocally should come to the foreground when this happens, and probably also give some confirmation that it completed. (This is how apps like iTunes and various apps with plugins behave.)
Another possible behaviour might be to just load the model once, but at next start-up not know about it anymore. As if the model is a ephemeral file. (This is more how something like Apple Preview would behave if you open a PDF).
I think the first makes more sense for downloaded models.
For distributing, best solution would probably be to host the files with the extension. Short-term work-around would be to allow people to download models from the website (we need to make that an option anyway) and use the a[download] attribute to force it to have the right extension.
From #38:
I love the idea of being able to double-click a blob you've downloaded, and translateLocally just importing & selecting it.
To implement this, I think we'll need to do the following:
Then, we'll need to decide what to do when someone does open a model file:
I think the first makes more sense for downloaded models.
For distributing, best solution would probably be to host the files with the extension. Short-term work-around would be to allow people to download models from the website (we need to make that an option anyway) and use the a[download] attribute to force it to have the right extension.