1
1
/**
2
- * angular-localization :: v1.0.0 :: 2014-06-04
2
+ * angular-localization :: v1.0.1 :: 2014-07-03
3
3
* web: https://github.com/doshprompt/angular-localization
4
4
*
5
5
* Copyright (c) 2014 | Rahul Doshi
@@ -293,15 +293,20 @@ angular.module('ngLocalize', ['ngCookies', 'ngLocalize.Config', 'ngLocalize.Even
293
293
function ( locale , localeEvents , localeConf ) {
294
294
'use strict' ;
295
295
296
- function update ( elm , string , optArgs ) {
297
- var tag = '' ;
296
+ function setText ( elm , tag ) {
297
+ if ( tag !== elm . text ( ) ) {
298
+ elm . text ( tag ) ;
299
+ }
300
+ }
298
301
299
- locale . ready ( locale . getPath ( string ) ) . then ( function ( ) {
300
- tag = locale . getString ( string , optArgs ) ;
301
- if ( tag !== elm . text ( ) ) {
302
- elm . text ( tag ) ;
303
- }
304
- } ) ;
302
+ function update ( elm , string , optArgs ) {
303
+ if ( locale . isToken ( string ) ) {
304
+ locale . ready ( locale . getPath ( string ) ) . then ( function ( ) {
305
+ setText ( elm , locale . getString ( string , optArgs ) ) ;
306
+ } ) ;
307
+ } else {
308
+ setText ( elm , string ) ;
309
+ }
305
310
}
306
311
307
312
return function ( scope , elm , attrs ) {
@@ -389,4 +394,4 @@ angular.module('ngLocalize.InstalledLanguages', [])
389
394
'en' : 'en-US'
390
395
} ) ;
391
396
angular . module ( 'ngLocalize.Version' , [ ] )
392
- . constant ( 'localeVer' , 'v1.0.0 ' ) ;
397
+ . constant ( 'localeVer' , 'v1.0.1 ' ) ;
0 commit comments