Skip to content

Commit 101ef8f

Browse files
committed
feat(i18nDirective): parse html in token string values for i18n directive
closes doshprompt#2
1 parent e6ef619 commit 101ef8f

10 files changed

+31
-33
lines changed

Gruntfile.js

-15
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ module.exports = function (grunt) {
2828
]
2929
},
3030

31-
copy: {
32-
readme: {
33-
src: 'README.md',
34-
dest: paths.distDir + '/'
35-
},
36-
license: {
37-
src: 'LICENSE',
38-
dest: paths.distDir + '/'
39-
},
40-
bower: {
41-
src: 'bower.json',
42-
dest: paths.distDir + '/'
43-
}
44-
},
45-
4631
concat: {
4732
all: {
4833
options: {

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ Two other options are available:
9999
- [Download the latest release](https://github.com/doshprompt/angular-localization/archive/master.zip).
100100
- Clone the repo: `git clone https://github.com/doshprompt/angular-localize.git`.
101101

102-
You can then include `angular-localization` after its dependencies, [angular](https://github.com/angular/bower-angular) and [angular-cookies](https://github.com/angular/bower-angular-cookies):
102+
You can then include `angular-localization` after its dependencies,
103+
[angular](https://github.com/angular/bower-angular) and
104+
[angular-cookies](https://github.com/angular/bower-angular-cookies):
103105

104106
```html
105107
<script src="bower_components/angular/angular.js"></script>

bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-localization",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"homepage": "https://github.com/doshprompt/angular-localization",
55
"description": "angularjs localization done right",
66
"main": "angular-localization.js",
@@ -29,9 +29,9 @@
2929
"angular-cookies": "*"
3030
},
3131
"devDependencies": {
32-
"angular-mocks": "~1.2.16",
32+
"angular-mocks": "*",
3333
"bootstrap": "~3.1.1",
34-
"angular-route": "~1.2.16",
34+
"angular-route": "*",
3535
"bca-flag-sprite": "~1.0.0"
3636
}
3737
}

dist/angular-localization.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* angular-localization :: v1.0.2 :: 2014-07-24
2+
* angular-localization :: v1.1.0 :: 2014-10-06
33
* web: https://github.com/doshprompt/angular-localization
44
*
55
* Copyright (c) 2014 | Rahul Doshi
@@ -287,11 +287,11 @@ angular.module('ngLocalize', ['ngCookies', 'ngLocalize.Config', 'ngLocalize.Even
287287
};
288288
}
289289
])
290-
.directive('i18n', ['locale', 'localeEvents', 'localeConf',
291-
function (locale, localeEvents, localeConf) {
290+
.directive('i18n', ['$sce', 'locale', 'localeEvents', 'localeConf',
291+
function ($sce, locale, localeEvents, localeConf) {
292292
function setText(elm, tag) {
293-
if (tag !== elm.text()) {
294-
elm.text(tag);
293+
if (tag !== elm.html()) {
294+
elm.html($sce.getTrustedHtml(tag));
295295
}
296296
}
297297

@@ -388,5 +388,5 @@ angular.module('ngLocalize.InstalledLanguages', [])
388388
'en': 'en-US'
389389
});
390390
angular.module('ngLocalize.Version', [])
391-
.constant('localeVer', 'v1.0.2');
391+
.constant('localeVer', 'v1.1.0');
392392
})(window.angular, window, document);

dist/angular-localization.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-localization.min.js.gzip

9 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)