This PR sets the page title when editing and maintaining languages (#9312)

* Added support for setting the page title when maintaining languages

* Edit language is now part of the vm.labels grouping
This commit is contained in:
Rachel Breeze
2020-11-16 01:32:38 +00:00
committed by GitHub
parent 1bf49b6ba3
commit a9f09308cf
2 changed files with 9 additions and 6 deletions

View File

@@ -13,7 +13,6 @@
vm.labels = {};
vm.initIsDefault = false;
vm.showDefaultLanguageInfo = false;
vm.save = save;
vm.back = back;
vm.goToPage = goToPage;
@@ -21,7 +20,7 @@
vm.toggleDefault = toggleDefault;
var currCulture = null;
function init() {
// localize labels
@@ -35,7 +34,8 @@
"languages_noFallbackLanguageOption",
"languages_fallbackLanguageDescription",
"languages_fallbackLanguage",
"defaultdialogs_confirmSure"
"defaultdialogs_confirmSure",
"defaultdialogs_editlanguage"
];
localizationService.localizeMany(labelKeys).then(function (values) {
@@ -47,6 +47,7 @@
vm.labels.addLanguage = values[5];
vm.labels.noFallbackLanguageOption = values[6];
vm.labels.areYouSure = values[9];
vm.labels.editLanguage = values[10];
$scope.properties = {
fallbackLanguage: {
@@ -58,6 +59,7 @@
if ($routeParams.create) {
vm.page.name = vm.labels.addLanguage;
$scope.$emit("$changeTitle", vm.labels.addLanguage);
}
});
@@ -87,11 +89,11 @@
if (!$routeParams.create) {
promises.push(languageResource.getById($routeParams.id).then(function (lang) {
promises.push(languageResource.getById($routeParams.id).then(function(lang) {
vm.language = lang;
vm.page.name = vm.language.name;
$scope.$emit("$changeTitle", vm.labels.editLanguage + ": " + vm.page.name);
/* we need to store the initial default state so we can disable the toggle if it is the default.
we need to prevent from not having a default language. */
vm.initIsDefault = Utilities.copy(vm.language.isDefault);

View File

@@ -1,7 +1,7 @@
(function () {
"use strict";
function LanguagesOverviewController($location, $timeout, navigationService, localizationService, languageResource, eventsService, overlayService) {
function LanguagesOverviewController($location, $timeout, navigationService, localizationService, languageResource, eventsService, overlayService,$scope) {
var vm = this;
@@ -42,6 +42,7 @@
vm.labels.fallsbackTo = values[3];
// set page name
vm.page.name = vm.labels.languages;
$scope.$emit("$changeTitle", vm.labels.languages);
});
languageResource.getAll().then(function (languages) {