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

Cache mixes up different directories #117

Open
fletchgqc opened this issue May 16, 2024 · 0 comments
Open

Cache mixes up different directories #117

fletchgqc opened this issue May 16, 2024 · 0 comments

Comments

@fletchgqc
Copy link

I have a similar problem to the OP here #88.

To reproduce, you need two folders which share a cache, e.g. in one project
locales/en.json
locales/de.json
errors/en.json
errors/de.json

for each directory, i.e. locales and errors, run:
npx json-autotranslate -i "$directory" --directory-structure ngx-translate -m i18next -d -s deepl-free -c "key"

Edit one of the machine translations and rerun. Your edit should be kept, but instead it will be overwritten by the machine translations. To fix the problem, use --cache to set a different cache for each $directory.

Analysis: I see that the files are being correctly created in the cache, prepended with a path. So they shouldn't interefere with one another. But apparently when diffing with the cache, the code makes a mistake and diffs with the wrong cache or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant