Skip to content

Commit

Permalink
Merge pull request #66 from bretkikehara/master
Browse files Browse the repository at this point in the history
chore(pkg): Release version 1.4.0
  • Loading branch information
doshprompt committed Sep 17, 2015
2 parents 6fcf5a5 + e6ccf53 commit 31815da
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-localization",
"version": "1.3.1",
"version": "1.4.0",
"homepage": "https://github.com/doshprompt/angular-localization",
"description": "angularjs localization done right",
"main": [
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-localization.css
@@ -1,5 +1,5 @@
/*!
* angular-localization :: v1.2.2 :: 2015-07-15
* angular-localization :: v1.4.0 :: 2015-09-14
* web: http://doshprompt.github.io/angular-localization
*
* Copyright (c) 2015 | Rahul Doshi
Expand Down
17 changes: 13 additions & 4 deletions dist/angular-localization.js
@@ -1,5 +1,5 @@
/*!
* angular-localization :: v1.2.2 :: 2015-07-15
* angular-localization :: v1.4.0 :: 2015-09-14
* web: http://doshprompt.github.io/angular-localization
*
* Copyright (c) 2015 | Rahul Doshi
Expand All @@ -9,7 +9,7 @@
'use strict';

angular.module('ngLocalize.Version', [])
.constant('localeVer', '1.2.2');
.constant('localeVer', '1.4.0');
angular.module('ngLocalize', ['ngSanitize', 'ngLocalize.Config', 'ngLocalize.Events', 'ngLocalize.InstalledLanguages']);

angular.module('ngLocalize.InstalledLanguages', [])
Expand All @@ -23,6 +23,7 @@ angular.module('ngLocalize')
.service('locale', function ($injector, $http, $q, $log, $rootScope, $window, localeConf, localeEvents, localeSupported, localeFallbacks) {
var TOKEN_REGEX = new RegExp('^[\\w\\.-]+\\.[\\w\\s\\.-]+\\w(:.*)?$'),

$html = angular.element(document.body).parent(),
currentLocale,
deferrences,
bundles,
Expand Down Expand Up @@ -248,6 +249,12 @@ angular.module('ngLocalize')
return result;
}

function updateHtmlTagLangAttr(lang) {
lang = lang.split('-')[0];

$html.attr('lang', lang);
}

function setLocale(value) {
var lang;

Expand All @@ -270,6 +277,8 @@ angular.module('ngLocalize')
deferrences = {};
currentLocale = lang;

updateHtmlTagLangAttr(lang);

$rootScope.$broadcast(localeEvents.localeChanges, currentLocale);
$rootScope.$broadcast(localeEvents.resourceUpdates);

Expand All @@ -283,7 +292,7 @@ angular.module('ngLocalize')
return currentLocale;
}

setLocale(cookieStore ? cookieStore.get(localeConf.cookieName) : $window.navigator.userLanguage || $window.navigator.language);
setLocale(cookieStore && cookieStore.get(localeConf.cookieName) ? cookieStore.get(localeConf.cookieName) : $window.navigator.userLanguage || $window.navigator.language);

return {
ready: ready,
Expand Down Expand Up @@ -382,7 +391,7 @@ angular.module('ngLocalize')
exp = values[key];
value = locale.getString(exp);
if (lastValues[key] !== value) {
attrs.$set(key, lastValues[key] = value);
attrs.$set(attrs.$normalize(key), lastValues[key] = value);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-localization.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-localization.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/angular-localization.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-localization.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "angular-localization",
"version": "1.3.1",
"version": "1.4.0",
"description": "angularjs localization done right.",
"main": [
"dist/angular-localization.js",
Expand Down

0 comments on commit 31815da

Please sign in to comment.