Skip to content

Commit

Permalink
revert to add back new-nls support
Browse files Browse the repository at this point in the history
  • Loading branch information
sdetweil committed Oct 25, 2021
1 parent d9a3ac2 commit 61c6ef6
Show file tree
Hide file tree
Showing 261 changed files with 6,751 additions and 2,419 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ main_index.html
motion
package-lock.json
app/locales/??c.json
.editorconfig
.gitignore
.prettierrc
.editorconfig
76 changes: 48 additions & 28 deletions app/js/app.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,55 @@
// Bootstrap Angular
(function (angular) {
'use strict';
"use strict";

var language = (typeof config.general.language != 'undefined') ? config.general.language.substring(0, 2).toLowerCase() : 'en';

angular.module('SmartMirror', ['ngAnimate', 'tmh.dynamicLocale', 'pascalprecht.translate'])
var language =
typeof config.general.language != "undefined"
? config.general.language.substring(0, 2).toLowerCase()
: "en";
angular
.module("SmartMirror", [
"ngAnimate",
"tmh.dynamicLocale",
"pascalprecht.translate",
require("angular-sanitize"),
])
.config(function (tmhDynamicLocaleProvider) {
console.log(config)
tmhDynamicLocaleProvider.localeLocationPattern('bower_components/angular-i18n/angular-locale_' + language + '.js');
console.log(config);
tmhDynamicLocaleProvider.localeLocationPattern(
"bower_components/angular-i18n/angular-locale_" +
language +
".js"
);
})

.config(['$translateProvider', function ($translateProvider) {
$translateProvider
.uniformLanguageTag('bcp47')
.useStaticFilesLoader({
prefix: 'app/locales/',
suffix: '.json'
});
$translateProvider.useSanitizeValueStrategy(null);
// Avoiding the duplicity of the locale for the default language, xx-YY -> xx
// We are considering only the language
// Please refer https://github.com/evancohen/smart-mirror/pull/179 for further discussion
var language = (typeof config.general.language != 'undefined') ? config.general.language.substring(0, 2) : 'en';
$translateProvider.preferredLanguage(language);
}])

.config(["$sceDelegateProvider", function ($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'self',
"https://www.youtube.com/embed/**"
]);
}]);
.config([
"$translateProvider",
function ($translateProvider) {
$translateProvider
.uniformLanguageTag("bcp47")
.useStaticFilesLoader({
prefix: "app/locales/",
suffix: "c.json",
});
$translateProvider.useSanitizeValueStrategy(null);
// Avoiding the duplicity of the locale for the default language, xx-YY -> xx
// We are considering only the language
// Please refer https://github.com/evancohen/smart-mirror/pull/179 for further discussion
var language =
typeof config.general.language != "undefined"
? config.general.language.substring(0, 2)
: "en";
$translateProvider.preferredLanguage(language);
},
])

} (window.angular));
.config([
"$sceDelegateProvider",
function ($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
"self",
"https://www.youtube.com/embed/**",
]);
},
]);
})(window.angular);
Loading

0 comments on commit 61c6ef6

Please sign in to comment.