-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.0.0-alpha #23
Comments
We may want to look into some variation of #43 if we want to have an idea of |
I think I like the globally-namespaced nature we have now. The real draw to this is how lightweight it is - the less code / hassle, the better. |
It shouldn't be all that much code to allow what @aaylward is saying, what about something like this: extend = (a, b) ->
for key, val of b when b.hasOwnProperty(key)
a[key] = b
a
clone = (obj) ->
extend {}, obj
methods = {
doSomething: (a, b, c) ->
}
partiallyApply = (fn, vals..., context) ->
(args...) ->
fn.call(context, vals..., args...)
Humanize = (vals...) ->
if vals?.length
methods = clone(methods)
for key, method of methods
methods[key] = partiallyApply(method, vals..., methods)
methods
extend(Humanize, Humanize()) That way there is no overhead if you don't use the chaining, and we only add a few lines of code. |
Both are good first passes. I've seen other implementations, like Moment's (inspired by jQuery I think) and underscore's, that I think are cool too. Thoughts on either of those? |
Something else we may want to consider for this release is supporting more loaders. I think Q has a cool approach: https://github.com/kriskowal/q/blob/master/q.js#L29-L63 |
It would be really great to support localization and translations using external files for costans allowing the community to add their own translations. |
@Pasvaz +1 million. I'd love to do that, but I don't have much experience with internationalization. Any ideas to help us get started? |
The simplest approach is to keep the language specific strings into separate files indexed by key-value and include/load them according to the language settings, the tricky part is to handle pluralization correctly. For instance, For what regards the localization (dates, numbers, formats) there are plenty of projects that have already localized them, for instance Moment.js support the date format and the day names for many languages, also, the ICU project should support any language afaik. But except pluralization that requires some logic, all those steps are quite trivial. |
I am currently working on a project on which I would benefit from the localization/translation support feature you previously mentioned. I could sure contribute with a pull request if you guys are interested. I just wanted to make sure the project was still under development first, as this discussion is about a year old. |
@seblavoie I'm happy to take a look at a PR. I18n work can be a bit tricky in this context, especially when dealing with functions like |
If fact I did not really have a well defined plan on how I would do it yet. That being said, I also think that going with moment.js would do a great job regarding time operations. About the l18n, I think the |
is this an abandonware? Would like to know taking the time to submit bugs and address owners about thoughts and stuff. it very much seems like one. |
@aaylward - Is anyone maintaining this project anymore? I use this frequently for most projects would be happy to start contributing to v2. |
Let's use this issue to create a roadmap for humanize v2.
Some things we may want to do:
intword
has been removed from the v2.0.0alpha branch in favor ofcompactInteger
.truncatenumber
is renamedboundedNumber
in 98a5be8intComma
as well. I don't think it adds value overformatNumber
.The text was updated successfully, but these errors were encountered: