Skip to content

Commit d989395

Browse files
committed
Add italian locale; Clean up
1 parent 86cc248 commit d989395

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cms/web/practice/js/l10n.js

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ angular.module('pws.l10n', [])
8888
{it: 'La quantità di tempo, in secondi, disponibile per l\'esecuzione di un testcase.'},
8989
'Tags are useful to classify tasks by a common characteristic or technique, such as: <i>greedy</i>, <i>graphs</i>, and so on.':
9090
{it: 'I tag servono per classificare e raggruppare i problemi in base ad una caratteristica comune, ad esempio: <i>greedy</i>, <i>grafi</i>, e così via.'},
91+
'Your browser is outdated or your PDF plugin is deactivated':
92+
{it: 'Il tuo browser non è aggiornato, oppure hai disattivato il plugin per i PDF'},
9193

9294
// Submissions page
9395
'Submit a solution':

cms/web/practice/js/task.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ angular.module('pws.task', [])
121121
}
122122
);
123123
})
124-
.controller('StatementCtrl', function($scope, $window, taskbarManager) {
124+
.controller('StatementCtrl', function(taskbarManager) {
125125
taskbarManager.setActiveTab(1);
126126
})
127127
.controller('AttachmentsCtrl', function(taskbarManager) {
@@ -213,18 +213,18 @@ angular.module('pws.task', [])
213213
subsDatabase.subDetails(id);
214214
};
215215
})
216-
.directive('pdf', function() {
216+
.directive('pdf', function($window, l10n) {
217217
return {
218218
restrict: 'E',
219219
link: function(scope, element, attrs) {
220220
scope.loadTask.then(function() {
221-
var goodBrowser = !!window.Worker;
221+
var goodBrowser = !!$window.Worker;
222222
var hasBuiltInPdf = !("ActiveXObject" in window) && !/iPhone|iPod|Android|BlackBerry|Opera Mini|Phone|Mobile/i.test(navigator.userAgent);
223223
var pdfURL = location.pathname.replace(/[^\/]*$/, '') + 'files/' + scope.task.statements.it + '/testo.pdf';
224-
var downloadButton = '<a href="' + pdfURL + '" class="btn btn-lg btn-success">Download</a>';
224+
var downloadButton = '<a href="' + pdfURL + '" class="btn btn-success" style="margin-top:5px;">Download PDF</a>';
225225
if (goodBrowser && hasBuiltInPdf)
226-
element.replaceWith('<object data="' + pdfURL + '" type="application/pdf" class="' + attrs.class +
227-
'">Update your browser!' + downloadButton + '</object>');
226+
element.replaceWith('<object data="' + pdfURL + '" type="application/pdf" class="' + attrs.class +
227+
'">' + l10n.get('Your browser is outdated or your PDF plugin is deactivated') + '<br>' + downloadButton + '</object>');
228228
else if (goodBrowser)
229229
element.replaceWith('<iframe seamless src="assets/pdfjs/web/viewer.html?file=' + pdfURL +
230230
'" class="' + attrs.class +'"/>');

0 commit comments

Comments
 (0)