formatjs / handlebars-intl

Handlebars helpers for internationalization.
http://formatjs.io/handlebars/
Other
265 stars 28 forks source link

Remove _mix. Add currency to intlBlock. Passes Intl to the factory method. #10

Closed apipkin closed 10 years ago

apipkin commented 10 years ago

Adds intlBlock back, but doesn't expose it as a helper. This will help with future additions similar to currency. Also applies context data to the new context when it is no longer valid.

ericf commented 10 years ago

Can you explain why we want to add this back, and how it helps with future additions similar to currency?

apipkin commented 10 years ago

@ericf I felt that having a method such as intlBlock would be good to separate the block logic from the rest of the intl logic. This means as intl block calls ({{#intl...}}) are made with the addition of hash options, we can provide a way to add them to the intlBlock context. This is of course unless we want to allow any hash option to follow this behavior. In which case the logic would become simpler and not complicate the logic within the intl method.

intlBlock is currently pretty small, and could easily be moved to another method or left inside of intl, I felt making it a method that did one thing and was not exposed to the outside ({{#intlBlock...}}) was the more proper way to go.

caridy commented 10 years ago

+1