Comments (12)
I've released a new version that supports ICU as well as i18next and sprintf-style interpolations. You can select the interpolation matcher using the -m
flag (e.g. -m i18next
in your case). I'd be happy to hear if this works for you :)
from json-autotranslate.
Turns out that if I change {{
to {
then it works.
from json-autotranslate.
However, I get the same issue if I'm using i18next nesting $t(key)
or $t({{keyInTheVar}})
I'm going to guess this will also fail ${$displayName}
from json-autotranslate.
Hey @djensen47, thanks for the issue!
Could you provide a sample JSON file and the command you used to run json-autotranslate, so I can try to reproduce it on my side? My guess is that the ICU-format parser doesn't like i18next's syntax. I could add a flag to switch between ICU-style and i18next-style interpolation.
from json-autotranslate.
My translation file is huge so I just included the keys with problems and two that should work just fine.
Note: I don't use the $t(key)
syntax but I do use the $t({{keyInTheVar}})
syntax. But you should definitely handle both.
{
"errorMessages": {
"formErrors": "Please fix the errors in the form and try again.",
"invalid-login": "Invalid email address or password",
"number": "${$displayName} must be a number"
},
"message": {
"confirm-delete-instruction": "Are you sure you want to delete the instruction, \"{{name}}\"?"
},
"label": {
"pricePerUnit": "Price per $t({{unitKey}})"
}
}
Thanks for fixing this!
from json-autotranslate.
For some reason npm install isn't working after the update. Not sure if it's "just me" yet or not.
from json-autotranslate.
Hmm, that's weird. I'll check it on my side as well. Can you provide the npm error you get when you try to run json-autotranslate?
from json-autotranslate.
$ npm i -S json-autotranslate
npm ERR! path /src/node_modules/json-autotranslate/lib/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/src/node_modules/json-autotranslate/lib/index.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
from json-autotranslate.
I'm running node 8.14.0 but it also happens on 6.
I confirmed that the problem is happening on two different machines.
from json-autotranslate.
After I use yarn to install, there's a similar issue. Under node_modules/json-autotranslate there are no source files.
It's like the last push to npm and yarn didn't succeed?
from json-autotranslate.
You were right. The build somehow failed on GitHub Actions. I've fixed that and everything should work as expected again.
from json-autotranslate.
Works great now. Thanks!
from json-autotranslate.
Related Issues (20)
- Ability to specify custom matchers
- Add OpenAI GPT support
- i18next matcher fails when parsing an Array HOT 5
- Readme Issues HOT 3
- Issue with Inaccurate Caching Behavior in json-autotranslate Across Multiple Directories HOT 2
- Can't create new language HOT 1
- Use glossary with DeepL HOT 2
- Cache mixes up different directories
- NPM package dependencies with 4 vulnerabilities
- How to pass Google Translate API key in --config HOT 3
- Rate Limit Exceeded HOT 1
- ICU Plurals Support fix HOT 2
- Stop automatically updating translations HOT 6
- Use custom terminology from Amazon Translate HOT 1
- Please add license file HOT 1
- How to handle input keys with "." in names HOT 2
- Better ICU handling
- ngx-translate structure not translating
- What are inconsistencies? HOT 6
- Wrong output structure HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-autotranslate.