loctools / plurr Goto Github PK
View Code? Open in Web Editor NEWCross-platform format specification + libraries for handling plurals/genders/conditionals for Go, Java, JS, Obj-C, Perl, PHP, Python, and Rust
License: MIT License
Cross-platform format specification + libraries for handling plurals/genders/conditionals for Go, Java, JS, Obj-C, Perl, PHP, Python, and Rust
License: MIT License
Instead of silently falling back to English locale, in strict
mode Plurr should throw an error. In addition to implementing this across the board, at least two kinds of tests need to be added for selecting a bogus locale in strict and non-strict mode.
See also PR #13
I browsed the repo, and besides nicer syntax, I think most of what I've seen can be done with GNU gettext. A comparison table could help people familiar with gettext (such as me) deciding weather to integrate with Plurr.
The format()
call mutates the object passed as params
, which is unexpected for the caller.
IMHO, when not an exception, format()
should just return a formatted string value for the passed parameters, and have no side-effects such as mutating the passed arguments.
{GENDER:He|She|They} will see it when {GENDER:logs|logs|log} in.
should be
{GENDER:He|She|They} will see it when {GENDER:he|she|they} {GENDER:logs|logs|log} in.
right?
The Plurr.format()
method, which is basically the API this library is offering, lacks docs.
There are just a couple examples in the README which makes one guess the first argument is the text to be formatted, the second one being the parameters for the text. However it also accepts an object of several options.
None of this is documented, and one has to dive into the source code/demo to guess these.
The lack of a README.md file in the js/ directory (or more specifically, not having it side-by-side with package.json), makes npm to display no relevant information for the library.
I don't believe it's possible to re-publish a package that already exists in the registry, so I'm not sure there's a way to add a readme file without publishing a new version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.