Comments (3)
The reason for this is that numbers are considered to be index in array (that is a normal behaviour you get when using flatten/unflatten)
{
"key": ['a', 'b']
}
will become
{
"key.0": 'a',
"key.1": 'b'
}
to avoid this behavior just add one key not being a numeral like:
{ "foo": { "100": "bar", "avoidIt": " " } }
results in and will get converted back correctly
{
"key.100": 'bar',
"key.avoidIt": ' '
}
10000 is not supported as we check for the array length...and some point we say there must be an error -> no one fills a translation array with over 10000 items.
from locize-cli.
I see, so flat and unflat are not proper inverses of each other :( Thanks, I will work around it.
from locize-cli.
not a 100% but that is a tradeoff: https://www.npmjs.com/package/flat
we at least extended it to make it an object if there is one non numeral value. In most cases that works fine eg having something like:
{
errors: {
default: 'something went wrong',
400: 'page not found',
....
}
}
from locize-cli.
Related Issues (20)
- build cli for alpine HOT 7
- Sync returns a different result for "auto-publish" mode and without it HOT 8
- Locize cli doesn't read `.env` file HOT 2
- Locize sync alters my `.json` files HOT 2
- Ambiguous --compare-modification-time flag behavior HOT 7
- version contains strange undeletable namespaces HOT 1
- Mapping between CLI params and config options HOT 1
- Locize sync results in FetchError HOT 5
- TypeError: Cannot read properties of null (reading 'value') HOT 1
- install.ps1 automatic figuring out of download url version has broken HOT 2
- bug(install): binary install not working HOT 15
- Not downloading all translations HOT 2
- The sync command crashes with Error: Callback was already called HOT 1
- The download command fails with an error when using the android format HOT 4
- vulnerabilities on npm install HOT 2
- `locize format` removes comments from `fluent files` HOT 1
- Fluent's `Message References` is not being saved in Locize. HOT 1
- High severity vulnerabilities on npm install HOT 1
- Locize-cli timeouts on sync HOT 4
- Support overwriting HOT 4
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 locize-cli.