Git Product home page Git Product logo

Comments (13)

ParvinEyvazov avatar ParvinEyvazov commented on September 24, 2024 1

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.

javix64 avatar javix64 commented on September 24, 2024 1

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.

javix64 avatar javix64 commented on September 24, 2024 1

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.

ParvinEyvazov avatar ParvinEyvazov commented on September 24, 2024 1

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.

javix64 avatar javix64 commented on September 24, 2024 1

Yes. In this moment it is the best solution. May I do the changes and after PR? and collaborate in somehow 😃

from json-translator.

ttnbtfy avatar ttnbtfy commented on September 24, 2024 1

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.

ttnbtfy avatar ttnbtfy commented on September 24, 2024 1

Still waiting until there is a new version release so it can be used with CLI command

from json-translator.

ParvinEyvazov avatar ParvinEyvazov commented on September 24, 2024 1

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.

ttnbtfy avatar ttnbtfy commented on September 24, 2024

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.

ParvinEyvazov avatar ParvinEyvazov commented on September 24, 2024

Sure @javix64, give it a shot!

from json-translator.

javix64 avatar javix64 commented on September 24, 2024

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.

ParvinEyvazov avatar ParvinEyvazov commented on September 24, 2024

@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.

javix64 avatar javix64 commented on September 24, 2024

perfect :)

from json-translator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.