Skip to content

Commit

Permalink
Translated various labels (fixing #2)
Browse files Browse the repository at this point in the history
This applies to the property/grid editor. The prevalue editor is still hardcoded in English - which is probably fine given that only developers see this
  • Loading branch information
abjerner committed Nov 21, 2016
1 parent 2e385ee commit 1ba76a1
Show file tree
Hide file tree
Showing 10 changed files with 313 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$scope.layouts = [
{ name: 'Tiles', alias: 'tiles' },
{ name: 'Liste', alias: 'list' }
{ name: 'List', alias: 'list' }
];

$scope.layout = $scope.layouts[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('umbraco').directive('skybrudImagepicker', ['dialogService', 'skybrudImagePickerService', 'skybrudLinkPickerService', 'userService', 'entityResource', 'mediaHelper', function (dialogService, p, links, userService, entityResource, mediaHelper) {
angular.module('umbraco').directive('skybrudImagepicker', ['dialogService', 'skybrudImagePickerService', 'skybrudLinkPickerService', 'userService', 'entityResource', 'mediaHelper', 'localizationService', function (dialogService, p, links, userService, entityResource, mediaHelper, localizationService) {
return {
scope: {
value: '=',
Expand Down Expand Up @@ -91,6 +91,38 @@

}

function initLabels() {

scope.labels = {
confirmRemoveTile: 'Are you sure you wish to remove this tile?',
confirmRemoveRow: 'Are you sure you wish to remove this row?',
selectImage: 'Select image',
selectImages: 'Select images',
maxRows: 'You can\'t add more than the ' + scope.cfg.limit + ' allowed rows.'
};

localizationService.localize('imagepicker_confirmRemoveTile').then(function (value) {
scope.labels.confirmRemoveTile = value;
});

localizationService.localize('imagepicker_confirmRemoveRow').then(function (value) {
scope.labels.confirmRemoveRow = value;
});

localizationService.localize('imagepicker_dialogSelectImage').then(function (value) {
scope.labels.selectImage = value;
});

localizationService.localize('imagepicker_dialogSelectImages').then(function (value) {
scope.labels.selectImages = value;
});

localizationService.localize('imagepicker_labelMaxRows', [scope.cfg.limit]).then(function (value) {
scope.labels.maxRows = value;
});

}

/// Gets an URL for a cropped version of the image (based on the current configuration)
function getImageUrl(item) {
return item.$image ? item.$image.image + '?width=' + scope.cfg.image.width + '&height=' + scope.cfg.image.height + '&mode=crop' : null;
Expand Down Expand Up @@ -126,7 +158,8 @@
};

scope.removeItem = function (index) {
if (confirm('Er du sikker på at du vil slette denne slide?')) {
var text = (scope.layout == 'list' ? scope.labels.confirmRemoveRow : scope.labels.confirmRemoveTile);
if (confirm(text)) {
scope.value.items.splice(index, 1);
}
};
Expand Down Expand Up @@ -158,8 +191,8 @@
} else {

scope.mediaPickerOverlay = {
view: "mediapicker",
title: "Select media",
view: 'mediapicker',
title: scope.labels.selectImage,
startNodeId: startNodeId,
multiPicker: false,
onlyImages: true,
Expand Down Expand Up @@ -238,6 +271,7 @@

initValue();
initConfig();
initLabels();

}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<language alias="da" intName="Danish" localName="dansk" lcid="6" culture="da-DK">
<area alias="imagepicker">

<key alias="modeTiles">Tiles</key>
<key alias="modeList">Liste</key>

<key alias="dialogSelectImage">Vælg billede</key>
<key alias="dialogSelectImages">Vælg billeder</key>

<key alias="confirmRemoveTile">Er du sikker på at du vil slette denne tile?</key>
<key alias="confirmRemoveRow">Er du sikker på at du vil slette denne række?</key>

<key alias="labelNotSpecified">Ikke angivet</key>
<key alias="labelNoRows">Der er endnu ikke tilføjet nogle billeder.</key>
<key alias="labelMaxRows">Du kan ikke tilføje flere end de %0% tilladte rækker.</key>

<key alias="labelImage">Billede</key>
<key alias="labelTitle">Titel</key>
<key alias="labelTitle_placeholder">Angiv titel her</key>
<key alias="labelDescription">Beskrivelse</key>
<key alias="labelDescriptionPlaceholder">Angiv beskrivelse her</key>

<key alias="labelLink">Link</key>
<key alias="labelLinkType">Type</key>
<key alias="labelLinkUrl">URL</key>
<key alias="labelLinkId">ID</key>
<key alias="labelLinkText">Tekst</key>
<key alias="labelLinkTarget">Target</key>

<key alias="optionAddImage">Add an image</key>
<key alias="optionRemove_item">Slet billedet fra galleriet</key>
<key alias="optionMoveRight">Flyt billedet til højre</key>
<key alias="optionMoveLeft">Flyt billedet til venstre</key>

<key alias="optionEditLink">Rediger link</key>
<key alias="optionRemoveLink">Slet link</key>
<key alias="optionAddLink">Tilføj link</key>

<key alias="optionAddRow">Tilføj ny række</key>

</area>
</language>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<language alias="en" intName="English" localName="English" lcid="6" culture="en-GB">
<area alias="imagepicker">

<key alias="modeTiles">Tiles</key>
<key alias="modeList">List</key>

<key alias="dialogSelectImage">Select image</key>
<key alias="dialogSelectImages">Select images</key>

<key alias="confirmRemoveTile">Are you sure you wish to remove this tile?</key>
<key alias="confirmRemoveRow">Are you sure you wish to remove this row?</key>

<key alias="labelNotSpecified">Not specified</key>
<key alias="labelNoRows">There has not yet been added any images.</key>
<key alias="labelMaxRows">You can't add more than the %0% allowed rows.</key>

<key alias="labelImage">Image</key>
<key alias="labelTitle">Title</key>
<key alias="labelTitlePlaceholder">Specify title here</key>
<key alias="labelDescription">Description</key>
<key alias="labelDescriptionPlaceholder">Specify description here</key>

<key alias="labelLink">Link</key>
<key alias="labelLinkType">Type</key>
<key alias="labelLinkUrl">URL</key>
<key alias="labelLinkId">ID</key>
<key alias="labelLinkText">Text</key>
<key alias="labelLinkTarget">Target</key>

<key alias="optionAddImage">Add an image</key>
<key alias="optionRemoveItem">Remove the image</key>
<key alias="optionMoveRight">Move the image to the right</key>
<key alias="optionMoveLeft">Move the image to the left</key>

<key alias="optionEditLink">Edit link</key>
<key alias="optionRemoveLink">Remove link</key>
<key alias="optionAddLink">Add link</key>

<key alias="optionAddRow">Add new row</key>

<key alias="tooltipEditRow">Edit row</key>
<key alias="tooltipRemoveRow">Remove row</key>

</area>
</language>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<language alias="en_us" intName="English (US)" localName="English (US)" lcid="" culture="en-US">
<area alias="imagepicker">

<key alias="modeTiles">Tiles</key>
<key alias="modeList">List</key>

<key alias="dialogSelectImage">Select image</key>
<key alias="dialogSelectImages">Select images</key>

<key alias="confirmRemoveTile">Are you sure you wish to remove this tile?</key>
<key alias="confirmRemoveRow">Are you sure you wish to remove this row?</key>

<key alias="labelNotSpecified">Not specified</key>
<key alias="labelNoRows">There has not yet been added any images.</key>
<key alias="labelMaxRows">You can't add more than the %0% allowed rows.</key>

<key alias="labelImage">Image</key>
<key alias="labelTitle">Title</key>
<key alias="labelTitlePlaceholder">Specify title here</key>
<key alias="labelDescription">Description</key>
<key alias="labelDescriptionPlaceholder">Specify description here</key>

<key alias="labelLink">Link</key>
<key alias="labelLinkType">Type</key>
<key alias="labelLinkUrl">URL</key>
<key alias="labelLinkId">ID</key>
<key alias="labelLinkText">Text</key>
<key alias="labelLinkTarget">Target</key>

<key alias="optionAddImage">Add an image</key>
<key alias="optionRemoveItem">Remove the image</key>
<key alias="optionMoveRight">Move the image to the right</key>
<key alias="optionMoveLeft">Move the image to the left</key>

<key alias="optionEditLink">Edit link</key>
<key alias="optionRemoveLink">Remove link</key>
<key alias="optionAddLink">Add link</key>

<key alias="optionAddRow">Add new row</key>

<key alias="tooltipEditRow">Edit row</key>
<key alias="tooltipRemoveRow">Remove row</key>

</area>
</language>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
font-size: 10px;
line-height: 12px;
}
.SkybrudImagePicker .umb-table-row {
-moz-user-select: initial;
-ms-user-select: initial;
-webkit-user-select: initial;
user-select: initial;
}
.SkybrudImagePicker .SkybrudImagePickerTiles > div {
display: flex;
flex-wrap: wrap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
line-height: 12px;
}

.umb-table-row {
-moz-user-select: initial;
-ms-user-select: initial;
-webkit-user-select: initial;
user-select: initial;
}

.SkybrudImagePickerTiles {

> div {
Expand Down

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

Loading

0 comments on commit 1ba76a1

Please sign in to comment.