airbnb / polyglot.js

Give your JavaScript the ability to speak many languages.
http://airbnb.github.io/polyglot.js
BSD 2-Clause "Simplified" License
3.71k stars 208 forks source link

Please document transformPhrase() #83

Closed jmm closed 7 years ago

jmm commented 7 years ago

transformPhrase isn't mentioned in the README or the website http://airbnb.github.io/polyglot.js / http://airbnb.io/polyglot.js/ . I only knew it exists because I saw it mentioned in the changelog. The link on the site that reads "View the documentation on Github" is a link to itself. By looking through the repo I pieced together that I can find some documentation that mentions it at http://airbnb.io/polyglot.js/polyglot.html, and then found that's linked as "View the annotated source."

Can you please document transformPhrase in the main README / site.

Also, those docs in the annotated source say something about a count property or parameter. Is that right, or is that supposed to be smart_count?

ljharb commented 7 years ago

I'll add documentation to the readme. count is correct in this case because the annotated source matches https://github.com/airbnb/polyglot.js/blob/master/index.js#L91-L93 - that's just the argument name in the function. smart_count is the option the user would pass, but that's something separate.

The docs pages (besides the readme) are a bit complex and messy right now - a PR to clean them up or replace the process with something better would be appreciated.