Comments (6)
Ping @rubenswieringa
from angular-gettext-tools.
Sorry it took me a while to reply; just got back from holidays. My PR (#116/#124) didn't take ng-bind-html
into account and that seems to be the problem (the translate
filter itself seems to be working alright though). Looking into possible solutions now.
from angular-gettext-tools.
@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 karma:unit
(I'm having trouble getting karma:unit_nojquery
to work and not a lot of time to look into it any further just right now).
Also, I tried the ng-bind-html
out in a personal project (Google Chrome 47) and didn't have any trouble there either.
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 karma:unit_nojquery
or give me some pointers as to why I'm getting Cannot POST /run
(see below)?
Running "karma:unit_nojquery:run" (karma) task
Cannot POST /run
Warning: Task "karma:unit_nojquery:run" failed. Used --force, continuing.
If my changes do in fact pose a problem to ng-bind-html
then we have 2 (not mutually exclusive) options:
- Make a configurable option for angular-gettext-tools like @paulpdaniels suggested
- Make a migration-script for people’s .po-files
from angular-gettext-tools.
...additionally we can see if we could modify the translate
filter to convert html-entities to regular unicode characters
from angular-gettext-tools.
@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 ’
from angular-gettext-tools.
A little more detail I have worked out:
Original Text | Key Text | Output: Chrome 48 | Output: IE 9 - 11 |
---|---|---|---|
'’' | '’' | 'translated' | '’' |
'’' | '’' | '’' | '’' |
'’' | '’' | '’' | 'translated' |
'’' | '’' | 'translated' | 'translated' |
from angular-gettext-tools.
Related Issues (20)
- Handlebars and CDATA within html script element does not parse since 2.2.0 HOT 1
- Got error while parsing JS file using https://www.npmjs.com/package/angular-gettext-cli HOT 1
- Angular bind-once issue
- Babel support? HOT 1
- Feature: compile one message per line
- Webpack issue HOT 1
- The use of the $ (dollar) symbol throws an error HOT 2
- Add Pug support HOT 2
- Upgrade peer dependency typescript-eslint-parser to recent version - outdated depending typescript version prevents shrinkwrapping HOT 4
- .pot overriding controller text HOT 2
- Broken for ES5 since 2.3.6 HOT 4
- Extraction from $templateCache
- Annotated strings HOT 1
- JSX/TSX syntax is forced in TS code
- No location of parse error reported HOT 1
- Cannot extract "constructor" HOT 3
- Looking for a maintainer
- Typescript 3 support HOT 2
- Do not introduce breaking changes in minor versions HOT 1
- Somehow template literals become empty after extraction
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 angular-gettext-tools.