localize unlock invariant property help text

This commit is contained in:
Mads Rasmussen
2022-05-16 12:32:40 +02:00
parent 6c4159751c
commit c0f674d333
3 changed files with 10 additions and 3 deletions

View File

@@ -1950,6 +1950,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
</key>
<key alias="fallbackLanguage">Fall back language</key>
<key alias="none">none</key>
<key alias="invariantPropertyUnlockHelp">%0% is shared across all languages.</key>
</area>
<area alias="macro">
<key alias="addParameter">Add parameter</key>

View File

@@ -7,7 +7,7 @@
**/
//share property editor directive function
function umbPropEditor(umbPropEditorHelper) {
function umbPropEditor(umbPropEditorHelper, localizationService) {
return {
scope: {
model: "=",
@@ -24,6 +24,7 @@ function umbPropEditor(umbPropEditorHelper) {
link: function (scope, element, attrs, ctrl) {
scope.readonly = false;
scope.labels = {};
//we need to copy the form controller val to our isolated scope so that
//it get's carried down to the child scopes of this!
@@ -37,6 +38,11 @@ function umbPropEditor(umbPropEditorHelper) {
scope.model.alias = Math.random().toString(36).slice(2);
}
localizationService.localize('languages_invariantPropertyUnlockHelp', [scope.model.label])
.then(function(value) {
scope.labels.invariantPropertyUnlockHelp = value;
});
var unbindWatcher = scope.$watch("model.view",
function() {
scope.propertyEditorView = umbPropEditorHelper.getViewPath(scope.model.view, scope.isPreValue);

View File

@@ -2,8 +2,8 @@
<div ng-if="preview && allowUnlock" class="umb-property-editor__lock-overlay-container">
<div class="umb-property-editor__lock-overlay">
{{ model.label }} is shared across all languages.
<umb-button button-style="warning" type="button" action="unlock()" label="Edit" size="xxs"></umb-button>
{{ labels.invariantPropertyUnlockHelp }}
<umb-button button-style="warning" type="button" action="unlock()" label-key="general_edit" size="xxs"></umb-button>
</div>
</div>