Repository navigation
[FEATURE] Splat operator - #1128
Closed
BenjaminHorn wants to merge 2 commits into
Closed
BenjaminHorn wants to merge 2 commits into
BenjaminHorn wants to merge 2 commits into
Conversation
BenjaminHorn
force-pushed
the
splat
branch
2 times, most recently
from
November 2, 2015 15:13
e61f186 to
86e85a0
Compare
Collaborator
There was a problem hiding this comment.
nit: This should be on a separate line, probably above i so i and l are declared next to one another.
Collaborator
|
This generally looks very good. A few feedback points that I think we should address before getting in but the bulk of the work looks like it's done and great. Thanks! |
Closed
|
This PR should be considered a WIP, please ignore until somebody says otherwise. :) (Also, I'll squash at the end, excepting Benjamin's commit so as to preserve his contribution.) |
Collaborator
|
Closing in favor of #1149, since that is complete and reflects the final discussions in #1050. Thanks to @BenjaminHorn and @nathanhammond for doing this initial work! |
jamesarosen
pushed a commit
to jamesarosen/ember-i18n
that referenced
this pull request
Dec 20, 2016
Previously, the `{{t}}` helper, like the `i18n.t` utility, accepted a
translation key and a context hash. This worked when the Handlebars template
had the individual keys and values (or value bindings) for the context,
but didn't when there was a pre-built object that represented the context.
Now it accepts a second ordered (non-hash) argument that represents the
context as an object. Hash context properties override those from
the context object.
```hbs
{{t 'some.key' someObject prop=value}}
```
is approximately the same as
```js
i18n.t('some.key', Object.assign({}, someObject, { prop: value }))
```
This is a workaround for the fact that Handlebars does not yet have a syntax
for splatting an object into hash arguments.
See handlebars-lang/handlebars.js#1050
See handlebars-lang/handlebars.js#1128
See handlebars-lang/handlebars.js#1149
Closes #423
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses: #1050