-
Notifications
You must be signed in to change notification settings - Fork 130
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
Breaking change in 2.1.11 #125
Comments
Ping @rubenswieringa |
@paulpdaniels are you having trouble in all browsers or just some? And does your project use jquery? The below tests for angular-gettext pass in Also, I tried the describe("Stuff", function () {
var catalog = null;
var $rootScope = null;
var $compile = null;
beforeEach(module("gettext"));
beforeEach(module(function ($sceProvider) {
$sceProvider.enabled(false);
}));
beforeEach(inject(function ($injector, gettextCatalog ) {
$rootScope = $injector.get("$rootScope");
$compile = $injector.get("$compile");
catalog = gettextCatalog;
catalog.setStrings("nl", {
"Quote’": "Aanhalingsteken’"
});
}));
it("translate-filter works", function () {
catalog.setCurrentLanguage("nl");
var el = $compile("<h1>{{\"Quote’\"|translate}}</h1>")($rootScope);
$rootScope.$digest();
assert.equal(el.text(), "Aanhalingsteken’");
});
it("ng-bind-html works", function () {
catalog.setCurrentLanguage("nl");
var el = $compile("<h1 ng-bind-html=\"'Quote’'|translate\"></h1>")($rootScope);
$rootScope.$digest();
assert.equal(el[0].innerHTML, "Aanhalingsteken’");
});
}); @rubenv could you give the above a go in
If my changes do in fact pose a problem to
|
...additionally we can see if we could modify the |
@rubenswieringa Sorry just getting back into testing this more in depth. It seems IE is the problem child as usual. I am digging a little further in but if you try it with some other characters like & and ¢ that seems to reproduce the problem more reliably than ’ |
A little more detail I have worked out:
|
We use json scaffolds in our code configuration and the inclusion of the character code replacement during compilation is causing breaks in our strings because after compilation the string keys are no longer matching.
Consider:
After translation we have a .po file that has:
However after compilation we end up with:
Not sure if this will happen in all cases but when used as:
The translation fails because the strings won't match up.
This likely should have been more than a patch version bump, but at the very least we need some way to configure this behavior so we can switch it off. For now we are simply pegging our version to 2.1.10 until this is resolved.
The text was updated successfully, but these errors were encountered: