Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization of text #2

Merged
merged 1 commit into from
Jun 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/App_Plugins/OpeningSoon/Lang/da-DK.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language>
<area alias="openingsoon">
<key alias="monday">Mandag</key>
<key alias="tuesday">Tirsdag</key>
<key alias="wednesday">Onsdag</key>
<key alias="thursday">Torsdag</key>
<key alias="friday">Fredag</key>
<key alias="saturday">Lørdag</key>
<key alias="sunday">Søndag</key>
<key alias="until">indtil</key>
<key alias="and">og</key>
<key alias="notScheduled">ikke angivet</key>
<key alias="clearAll">Ryd alt</key>
<key alias="autofill">Autofyld</key>
</area>
</language>
17 changes: 17 additions & 0 deletions src/App_Plugins/OpeningSoon/Lang/en-GB.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language>
<area alias="openingsoon">
<key alias="monday">Monday</key>
<key alias="tuesday">Tuesday</key>
<key alias="wednesday">Wednesday</key>
<key alias="thursday">Thursday</key>
<key alias="friday">Friday</key>
<key alias="saturday">Saturday</key>
<key alias="sunday">Sunday</key>
<key alias="until">until</key>
<key alias="and">and</key>
<key alias="notScheduled">not scheduled</key>
<key alias="clearAll">Clear all</key>
<key alias="autofill">Autofill</key>
</area>
</language>
17 changes: 17 additions & 0 deletions src/App_Plugins/OpeningSoon/Lang/en-US.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language>
<area alias="openingsoon">
<key alias="monday">Monday</key>
<key alias="tuesday">Tuesday</key>
<key alias="wednesday">Wednesday</key>
<key alias="thursday">Thursday</key>
<key alias="friday">Friday</key>
<key alias="saturday">Saturday</key>
<key alias="sunday">Sunday</key>
<key alias="until">until</key>
<key alias="and">and</key>
<key alias="notScheduled">not scheduled</key>
<key alias="clearAll">Clear all</key>
<key alias="autofill">Autofill</key>
</area>
</language>
18 changes: 13 additions & 5 deletions src/App_Plugins/OpeningSoon/OpeningSoon.Controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
angular.module("umbraco")
.controller("Jumoo.OpeningSoonController",
function($scope, assetsService) {
function($scope, assetsService, localizationService) {

assetsService.loadCss("/App_Plugins/OpeningSoon/Scripts/jquery.timepicker.css");

$scope.resetDays = function()
{
$scope.model.value = [
Expand All @@ -14,7 +14,15 @@ angular.module("umbraco")
{ 'name': 'Friday', 'scheduled': true, 'open': '', 'close' : '' },
{ 'name': 'Saturday', 'scheduled': true, 'open': '', 'close' : '' },
{ 'name': 'Sunday', 'scheduled': true, 'open': '', 'close' : '' }
];
];

$scope.model.value[0].name = localizationService.dictionary['openingsoon_monday'] || $scope.model.value[0].name;
$scope.model.value[1].name = localizationService.dictionary['openingsoon_tuesday'] || $scope.model.value[1].name;
$scope.model.value[2].name = localizationService.dictionary['openingsoon_wednesday'] || $scope.model.value[2].name;
$scope.model.value[3].name = localizationService.dictionary['openingsoon_thursday'] || $scope.model.value[3].name;
$scope.model.value[4].name = localizationService.dictionary['openingsoon_friday'] || $scope.model.value[4].name;
$scope.model.value[5].name = localizationService.dictionary['openingsoon_saturday'] || $scope.model.value[5].name;
$scope.model.value[6].name = localizationService.dictionary['openingsoon_sunday'] || $scope.model.value[6].name;
}

if ( !$scope.model.value ) { $scope.resetDays() ; }
Expand Down Expand Up @@ -57,8 +65,8 @@ angular.module("umbraco")
scope.$apply(function() {
var mytime = element.timepicker('getTime', new Date());
var timestring =
("0" + mytime.getHours()).substr(-2,2) + ":" +
("0" + mytime.getMinutes()).substr(-2,2) ;
("0" + (mytime != null ? mytime.getHours() : "0")).substr(-2,2) + ":" +
("0" + (mytime != null ? mytime.getMinutes() : "0")).substr(-2,2) ;
controller.$setViewValue(timestring);
});
});
Expand Down
22 changes: 20 additions & 2 deletions src/App_Plugins/OpeningSoon/openingsoon.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
input.jumoo-opening-time {
input.jumoo-opening-time {
width: 60px;
}

tr.jumoo-opening-entry {
height: 40px;
}
}

tr.jumoo-opening-entry td span.jumoo-inline-label {
display: inline-block;
padding-top: 5px;
}

tr.jumoo-opening-entry td.jumoo-opening-notscheduled {
color: #888;
}

tr.jumoo-opening-entry td:nth-child(2) {
padding-left: 5px;
padding-right: 5px;
}

.table-jumoo-opening tfoot > tr > td {
padding-top: 10px;
}
62 changes: 33 additions & 29 deletions src/App_Plugins/OpeningSoon/openingsoon.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
<div ng-controller="Jumoo.OpeningSoonController">

<table ng-model="model.value">
<tr ng-repeat="day in model.value" class="jumoo-opening-entry">
<td>{{day.name}}</td>
<td><input type="checkbox" ng-model="day.scheduled"></td>
<td ng-show="day.scheduled">
<input type="text" time-picker ng-model="day.open" class="jumoo-opening-time">
until
<input type="text" time-picker ng-model="day.close" class="jumoo-opening-time">
</td>
<td ng-show="!day.scheduled">
not scheduled
</td>

<td ng-show="model.config.SecondSet != 0 && day.scheduled"> and </td>
<td ng-show="model.config.SecondSet != 0 && day.scheduled">
<input type="text" time-picker ng-model="day.open2" class="jumoo-opening-time">
until
<input type="text" time-picker ng-model="day.close2" class="jumoo-opening-time">
</td>
</div>
</tr>

<tr>
<td colspan="4">
<a ng-show="model.config.enableClear" ng-click="clearAll()" class="btn">clear all</a>
<a ng-show="model.config.enableAutofill" ng-click="autofill()" class="btn">Autofill</a>
</td>
</tr>

<table ng-model="model.value" class="table-jumoo-opening">
<tbody>
<tr ng-repeat="day in model.value" class="jumoo-opening-entry">
<td>{{day.name}}</td>
<td><input type="checkbox" id="day-{{$index + 1}}" ng-model="day.scheduled"></td>

<td ng-show="day.scheduled">
<input type="text" time-picker ng-model="day.open" class="jumoo-opening-time">
<span class="jumoo-inline-label"><localize key="openingsoon_until">until</localize></span>
<input type="text" time-picker ng-model="day.close" class="jumoo-opening-time">
</td>
<td ng-show="!day.scheduled" class="jumoo-opening-notscheduled">
<localize key="openingsoon_notScheduled">not scheduled</localize>
</td>

<td ng-show="model.config.SecondSet != 0 && day.scheduled"> <localize key="openingsoon_and">and</localize> </td>
<td ng-show="model.config.SecondSet != 0 && day.scheduled">
<input type="text" time-picker ng-model="day.open2" class="jumoo-opening-time">
<span class="jumoo-inline-label"><localize key="openingsoon_until">until</localize></span>
<input type="text" time-picker ng-model="day.close2" class="jumoo-opening-time">
</td>
</div>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"></td>
<td>
<a ng-show="model.config.enableClear" ng-click="clearAll()" class="btn"><localize key="openingsoon_clearAll">clear all</localize></a>
<a ng-show="model.config.enableAutofill" ng-click="autofill()" class="btn"><localize key="openingsoon_autofill">Autofill</localize></a>
</td>
</tr>
</tfoot>
</table>
</div>