Comments (15)
I have no objection to omitting the tag. I don't even mind if that's the default. The t
helper does support bound interpolations, though, so it'll need Metamorph tags.
from ember-i18n.
Great! I'll have a look at getting it to work with metamorph tags
from ember-i18n.
I think the correct behavior should be
{{t "foo"}}
=><script id="metamorph-1-start"></script>Foo<script id="metamorph-1-end"></script>
{{t "foo" tagName="span"}}
=><span>Foo</span>
{{t "foo" bound="false"}}
=>Foo
/cc @rapheld
from ember-i18n.
@rupurt did you ever give this a try? I'm going to (finally) try to get this done in the next few days.
from ember-i18n.
I think this will be fairly straightforward to do if we use Ember.Handlebars.registerBoundHelper
, but that's only available on Ember 1.0 and this library supports Ember 0.9.x. I'm having trouble getting bindings working without tags in Ember 0.9.
from ember-i18n.
Sorry I've been unresponsive on this issue. I've not had time to creating a patch.
Do you really want to support ember < 1.0?
from ember-i18n.
If this is on v1.x of Ember-I18n, it must support Ember 0.9. If we do it only on the v2.0 branch, it can rely on Ember 1.0.
from ember-i18n.
Ok. I think I might try something on the v2.0 branch
-- AK
from ember-i18n.
Awesome :)
from ember-i18n.
Hi, guys, any update on this one?
from ember-i18n.
@sihuang the v1 series needs to stay compatible with Ember 0.9.x, which means it's all-but-impossible to do this there. It should be quite straightforward on the v2 branch, though, since that only supports Ember 1.0, which has registerBoundHelper
. I haven't had a chance to work on the v2 branch much, but I can pick this up after I'm back from traveling next week if nobody else has had a chance before then.
from ember-i18n.
That's great you will be looking into this yourself. I have no problem updating to Ember 1.0. Thanks again.
from ember-i18n.
Now that Ember 1.0 is out, I tried to do this. Unfortunately, registerBoundHelper
doesn't accept a tagName
. It always emits a Metamorph tag.
I tried a couple of things, but ended up just really frustrated. I understand the need for Metamorph, but I really hate how much it screws with CSS selectors.
The best we can do easily is
emits
<script id="metamorph-123-start"></script>
<h3>Foo Bar</h3>
<script id="metamorph-123-end"></script>
Unfortunately, that's a pretty big breaking change, CSS-wise.
I also tried writing a version of the helper using registerHelper
(not registerBoundHelper
) and using Ember._MetamorphView
or Ember.View
, depending on whether a tagName
is passed. I got this partially working, but the bindings get very challenging.
I'd love some help on this, especially if the core team have any thoughts. /cc @wycats @tomdale @ebryn @wagenet
from ember-i18n.
@jamesarosen can you not use :nth-of-type?
from ember-i18n.
Sure. What I'm saying is that it's a breaking change. I would prefer to introduce as few as possible, even though it's a major version release.
from ember-i18n.
Related Issues (20)
- Adding a `scope` option HOT 3
- Compatibility with fastboot?
- helper creates Ember.Object.extend().create() HOT 3
- emberGetownerPolyfill issue in i18n service HOT 4
- Refactor test helpers
- Passing in multiple translation keys (perhaps to Safely concat them together?) HOT 11
- Setting locale as described fails HOT 2
- switching language locally, not globally HOT 2
- require in get-locales clashes with other locally defined requires HOT 10
- Quest: intent to deprecate HOT 18
- Issue using ember-i18n in qunit 4.2.1 and ember-cli version 2.18.2 HOT 12
- Pluralized do not behave always the same way HOT 7
- Call a translation key dynamically HOT 2
- Getting a language value from locale in a template HOT 4
- Dynamic update of <html lang="en"> with FastBoot support HOT 2
- Interpolating quotes HOT 2
- ;import Service from "ember-i18n/service"; HOT 2
- Babel error HOT 1
- undefined is not an object (evaluating 'this.get('i18n').t') HOT 1
- _locale Computed property is not called more than once HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-i18n.