Comments (13)
Hi @ttnbtfy
Unfortunately, it is not supported yet. Also because of the translating into multiple language in the same time feature, we did not add it. I am adding it to feature list. Thank you.
from json-translator.
Hey @ParvinEyvazov I am here because also I want that feature and I can help to achive it.
For example, in my case, I am using a JSON file called: resume.en.json
. I need two different languages: es
& de
. So my CLI script is: jsontt resume.en.json --translator google --from en --to de es
.
What it is name of the file? The main problem is the file name.
If you want to keep the same name:
For example: file.json
=> file.en.json
.
If you want to change the name:
For example: file.json
=> newFile.en.json
What do you think?
from json-translator.
Hey @ttnbtfy. Also if you want to change the name, you can create a script for do this task, I have created mine, here it is:
import { writeFileSync, readFileSync, existsSync, unlinkSync } from "fs";
(function rename() {
const files = ["de.json", "es.json"];
try {
files.map((file) => {
if (!existsSync(file)) {
console.log(`File ${file} does not exist`);
return;
}
writeFileSync(`resume.${file}`, readFileSync(file));
unlinkSync(file);
});
} catch (err) {
console.info("err", err);
}
})();
from json-translator.
Hi @javix64
Actually, I got an idea from your comment. Maybe what we can do is take a name from the user in the CLI (will be optional) and use it as a prefix
for example in your case:
jsontt resume.en.json --translator google --from en --to de es --name banana
will create a new files wit
banana.de.json
banana.es.json
what do you think guys? Would this also solve your problem @ttnbtfy ?
from json-translator.
Yes. In this moment it is the best solution. May I do the changes and after PR? and collaborate in somehow 😃
from json-translator.
I will definitely try it, I can't test the code right now.
Once again thank you very much for those suggestions :)
from json-translator.
Still waiting until there is a new version release so it can be used with CLI command
from json-translator.
Hi guys, new version of jsontt now support output name feature. (Thanks to @javix64 )
you can use --name
jsontt <your/path/to/file.json> --translator google --from en --to ar fr zh-CN --name myFiles
from json-translator.
Thank @javix64 for your suggest, can i use this with CLI usage?
I don't really understand how to work with Packages
from json-translator.
Sure @javix64, give it a shot!
from json-translator.
hey @ttnbtfy I think now you can update to the latest version because I have added the implementation. 😄
and also someone can close this issue!
from json-translator.
@javix64 @ttnbtfy Unfortunately not yet.
Noticed an issue while testing. I will fix it soon and will inform you guys when the new release will be published.
from json-translator.
perfect :)
from json-translator.
Related Issues (20)
- Tatar is not available HOT 3
- Set API Key HOT 2
- Only update new or empty fields. HOT 1
- App not working when built from sources HOT 2
- Option for "--translator" does not work HOT 1
- feature request : instead of -- replace with original language string HOT 3
- Rate Limiting HOT 2
- Hello, I need suggestions for this project HOT 1
- Has anyone actually be able to make this work? HOT 2
- TypeScript support
- .JSONL files translating
- Problem with json HOT 1
- feature request: GUI for i18n keys manager
- error while translating "Best Sellers" using google. Assigned "--" instead of exit from cli. HOT 5
- Execute script without --name HOT 7
- Error when translating into Mongolian (mn).
- Calls
- Is there a way to set the translation module when using the package like with the CLI HOT 1
- Feature Request: Skip Empty Strings in Translation to Avoid Unnecessary Errors 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-translator.