Comments (6)
I'll merge a PR implementing this :)
Maybe add the ability to specify a json formatter?
from i18next-gettext-converter.
I'll merge a PR implementing this :)
Thanks :)
Maybe add the ability to specify a json formatter?
That sound also like a good idea. Maybe both? You can either set a number or a string containing a formatter wich then gets mapped to a number?
from i18next-gettext-converter.
I think one of the two is better? I can go with either!
Can't think of a name for a combined option, it would be something like jsonFormatter
or jsonTabWidth
I think?
from i18next-gettext-converter.
Well the naming sure is a problem indeed.
I guess then when both options are being implemented two separate options should be created, but then there would be the issue of which takes precedence and so on. So yeah, I guess one would be better?
But when only one is implemented I would propose to take the more general one with jsonTabWidth
as it is more flexible and the user can do everything the jsonFormatter
option would allow and more.
What do you think?
from i18next-gettext-converter.
Well, jsonFormatter
is the more general option.
You could specify something like --jsonFormatter ./jsonFormatter.js
which could look something like:
import beautify from "json-beautify";
export default (obj) => beatufy(obj, null, 2, 100));
This is using something like https://www.npmjs.com/package/json-beautify
In this case you can also set the maximum line width.
from i18next-gettext-converter.
Ah ok, I had a different approach in mind. I thought that the formatter option would just be a string, which then would get mapped into a number. But your approach is much better. Yes with this I would agree with you, that this would be the more general option. I like it.
from i18next-gettext-converter.
Related Issues (20)
- JSON export should be in V4 format HOT 11
- CLI doesn't get the arguments HOT 3
- CLI fails to execute HOT 1
- Plurals generation from .po for language with no plurals HOT 2
- No error thrown when error in .po file
- Node 16 not supported HOT 2
- Option --foldLength does not work HOT 1
- New fuzzy check (v7.1.0) crashes if message has no comments HOT 1
- generate pot file from cli HOT 5
- Passing options to `GettextParser.po` compiler in `i18nextToGettext` HOT 5
- Wrong conversion of the strings while converting .po file to .json file HOT 1
- Cannot read property 'nplurals' of undefined when using dev language HOT 1
- conversion from po to json the string with , is seperated into two strings HOT 1
- FUNDING.yml
- Using --keyasareference with duplicate text breaks when converting back to i18next HOT 8
- Nesting not supported ? HOT 5
- TypeError: Cannot read property 'option' of undefined HOT 3
- Exported files missing Language field HOT 4
- Converter can't handle keys with underscores 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 i18next-gettext-converter.