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

Can't create new language #115

Open
fletchgqc opened this issue May 15, 2024 · 1 comment
Open

Can't create new language #115

fletchgqc opened this issue May 15, 2024 · 1 comment

Comments

@fletchgqc
Copy link

When I try to add a new language, I get the error "Unexpected end of JSON input".

I have an English source and a German translation in en.json and de.json files. Running the following command works fine. When I modify a string in English, it updates it in German.

npx json-autotranslate -i src/localization/locales --directory-structure ngx-translate -s deepl-free -c abc:fx

Now I want a slovakian translation. I created an empty sk.json file and ran the command again, resulting in the Unexpected end of JSON input error. When I add {} to the sk.json file, it gets a bit further but results in An error has occurred: Expected identifier but "{" found..

Am I doing something wrong? How do I add a new language?

@fletchgqc
Copy link
Author

I found the problem.

  1. Firstly, it had to do with the matchers, not the new language file. I had to change my matchers to i18next.
  2. Then, once I created the file containing {}, it worked. Ideally, it should work with an empty file, or at least this behaviour should be documented.

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