Skip to content
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

Question only: Downloaded language does not survive after Firefox restart #55

Open
ghost opened this issue Nov 6, 2022 · 3 comments
Open
Labels
enhancement New feature or request question Further information is requested

Comments

@ghost
Copy link

ghost commented Nov 6, 2022

Hi,

TranslateLocally 0.7.2 / Firefox 106.0.4

Works nicely up to now. Desktop app is not installed.

One thing I don't understand:

On first new source language, TranslateLocally offers to Download language & Translate page. Later on same source language, the offer is to only Translate page -- OK, no problem.

When I restart Firefox, the offer is again to Download language & Translate page

My questions:
1- Where is the downloaded language downloaded to? In the user's profile? But where?
2- Why does the downloaded language need to be re-downloaded unless it is in RAM?

I don't get it. Thanks.

@jelmervdl
Copy link
Owner

Hi @Cade66, they are cached in the local browser cache and they should not be actively invalidated unless there is an error.

I'm not sure if they're visible in about:cache, but that's where I would expect them.

I've heard reports of people using Firefox in permanent private mode where caching may not work.

@ghost
Copy link
Author

ghost commented Nov 7, 2022

Hi @jelmervdl,

[Downloaded languages] are cached in the local browser cache and they should not be actively invalidated unless there is an error.

In the cache, of course. Users who've disabled disk cache have these downloaded language packs in memory hence wiped at Firefox exit.
The ideal would be that these language packs be downloaded and remain available and I believe this is the advantage of combining the extension with the desktop application.

Someone wrote on a Ghacks article dedicated to TranslateLocally,

you can download language pair manually at https://translatelocally.com/models.json, extract file until you see folder and put at C:\Users*user*\AppData\Roaming\translateLocally

1- Just had a look at downloaded language packs here and I see that the language packs are not downloaded from translatelocally.com but from data.statmt.org/bergamot, i.e. https://data.statmt.org/bergamot/models/fren/fren.student.tiny11.tar.gz

2- Can we imagine a work-around which would allow the user to manually download these language packs to their dedicated localization in the user's C:\Users\*user*\AppData\Roaming\translateLocally (if this is correct) and then have the extension accept TranslateLocally in the Translation Provider option? The idea is to have the advantages of the TranslateLocally desktop application without actually installing it ...

3- Thanks to all, Bergamot, TranslateLocally, for your work. I'm more than interested by the concept and the development. So I'm digging into it to try to establish an equalization between the code and my own wishes. The main point is the translation quality of course and from what I've briefly tested the result is quite nice.

@jelmervdl
Copy link
Owner

  1. Correct, data.statmt.org hosts our models at the moment, but in theory they can be hosted anywhere. They're also referred to from here: https://github.com/browsermt/students. The models.json file is the source of truth for the models and contains the checksums to validate them.

  2. I don't think the web extension can access the filesystem. Temporary it can, through <input type="file">, but not across browser sessions. When you select TranslateLocally as the Translation provider, it will delegate all translations to that program (which does have access to the filesystem) so that's how it can work around that browser limitation.

Would storage like localStorage be maintained in these setups of Firefox?

One other way could be to have extra extensions per language, that ship the model and that can communicate with the main extension. But that would be quite the maintenance burden.

@jelmervdl jelmervdl added enhancement New feature or request help wanted Extra attention is needed question Further information is requested and removed help wanted Extra attention is needed labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant