Code Monkey home page Code Monkey logo

Comments (2)

bodrovis avatar bodrovis commented on July 26, 2024

That's a fair question! Actually, we do have bulk update for the Keys endpoint: https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put It works in the following way https://github.com/lokalise/node-lokalise-api/blob/master/test/keys/keys.spec.ts#L203

For example, we could say:

      const keys = await lokaliseApi.keys().bulk_update(
        [
          {
            key_id: 1234,
            translations: [
              {
                language_iso: 'en',
                "translation": "English translation"
              },
              {
                language_iso: 'fr',
                "translation": "French translation"
              },
            ]
          },
          {
            key_id: 5678,
            translations: [
              {
                language_iso: 'en',
                "translation": "English translation for the 2nd key"
              },
              {
                language_iso: 'fr',
                "translation": "French translation for the 2nd key"
              },
            ]
          },
        ],
        { project_id: '123.abc'}
      );

So, you'll need to know your key IDs to update and then just pass translations array with the language ISO codes and the corresponding translation values. I believe it should work.

As for the branches, https://lokalise.github.io/node-lokalise-api/api/getting-started#branching here's a brief explanation. All in all, you just provide the branch name right after the project ID separated with :

'123.abc:my_branch'

So, for example to list all keys from a develop branch:

const keys = await lokaliseApi.keys().list({ project_id: '123.abc:develop' });

You can use exactly the same approach for all other methods: just add branch name after the project ID.

And once again this post https://lokalise.com/blog/lokalise-apiv2-in-practice/ might present some helpful examples as well.

from node-lokalise-api.

bodrovis avatar bodrovis commented on July 26, 2024

I'm going to close this for now but if you have any other questions don't hesitate to reach out to us!

from node-lokalise-api.

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.