Code Monkey home page Code Monkey logo

Comments (7)

adrai avatar adrai commented on June 16, 2024

Hi @chopkins123
Does it work without --path-mask?
What's your project-id?

from locize-cli.

chopkins123 avatar chopkins123 commented on June 16, 2024

Without the --path-mask I still get the same output on the first run. However if I run the same command a 2nd time I get the below output:

nothing to update for en/global
nothing to update for en-GB/global
syncing...
FINISHED

Looking in the /locales folder I can see 2 new folders en and en-GB have been created, both with the same empty global.json file inside.

I'm testing this against the demo project that locize creates, so en is set as the reference language, but I've created an en-GB language as well. This is the full command I'm using:

locize sync -k MY_KEY -i MY_PROJECT -l "en-GB" -n "global" -p "C:\Git\ScratchPad\locize-sync-test\locales" -R false

from locize-cli.

adrai avatar adrai commented on June 16, 2024

Can you send me the project-id?
If you want you can send an e-mail to [email protected]

from locize-cli.

adrai avatar adrai commented on June 16, 2024

a few inputs:

you defined the namespace "global" that namespace is empty (or not published)

there's also nothing publish for the language "en-GB"

try this: locize sync -k MY_KEY -i MY_PROJECT -p "C:\Git\ScratchPad\locize-sync-test\locales" -R false (skip lng and namespace param)

or this: locize sync -k MY_KEY -i MY_PROJECT -p "C:\Git\ScratchPad\locize-sync-test\locales" -R false -n "global" -s false

or add some content to the en-GB/global namespace and publish it

I hope this helps

from locize-cli.

chopkins123 avatar chopkins123 commented on June 16, 2024

Created a new project with id 579cde95-2ad0-4e76-b6ae-0aa1a3df4427 and just the en-GB language with a single key helloworld.

Tried running the below commands and in both scenarios a new file is created at \locales\en-GB\global.json with the single helloworld key present.

  • locize sync -k MY_KEY -i MY_PROJECT -p "C:\Git\ScratchPad\locize-sync-test\locales" -R false
  • locize sync -k MY_KEY -i MY_PROJECT -p "C:\Git\ScratchPad\locize-sync-test\locales" -R false -n "global" -s false

If I run the command locize sync -k MY_KEY -i MY_PROJECT -p "C:\Git\ScratchPad\locize-sync\locales" -R false -n "global" -s false -m "{{namespace}}/{{language}}.translation" with my local translation file in the folder locales\global\en-GB.translation.json, the local file gets overwritten with the helloworld key

from locize-cli.

chopkins123 avatar chopkins123 commented on June 16, 2024

Found the issue:
Cloned the repo, can see in the parseLocalLanguage function uses path.sep. For the path-mask I'd used {{namespace}}/{{language}}.translation but as I'm on windows it should have been {{namespace}}\{{language}}.translation

All working now, keys were synced as expected, thanks for taking a look

from locize-cli.

adrai avatar adrai commented on June 16, 2024

no problem, welcome ;-)

from locize-cli.

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.