Merge branch 'develop'

This commit is contained in:
Kevin Giszewski
2014-02-05 17:35:02 -05:00
2 changed files with 15 additions and 2 deletions
+9 -2
View File
@@ -10,6 +10,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
//ini the model
$scope.model.value = $scope.model.value || defaultFieldsetConfigModel;
$scope.locales = {}
//ini the render model
initConfigRenderModel();
@@ -19,6 +20,10 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
$scope.availableDataTypes = data;
});
archetypePropertyEditorResource.getDefaultLocale().then(function(defaultLocale){
$scope.locales.defaultLocale = defaultLocale;
});
//load the localization info
userService.getCurrentUser()
.then(function (user) {
@@ -30,15 +35,17 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio
.then(function(locale){
archetypePropertyEditorResource.getDefaultLocale(locale)
.then(function(defaultLocale) {
$scope.locales = {}
$scope.locales.locale = locale;
$scope.locales.defaultLocale = defaultLocale;
});
});
});
$scope.getLocales = function(){
if($scope.locales){
if(!$scope.locales.locale)
$scope.locales.locale = $scope.locales.defaultLocale;
return $scope.locales;
}
}
+6
View File
@@ -4,6 +4,12 @@ angular.module('umbraco.filters').filter("archetypeLocale", function(){
if(!locales)
return key;
if(!locales.defaultLocale)
return key;
if(!locales.locale)
return key;
return locales.locale[key] || locales.defaultLocale[key] || key;
}
})