Skip to content

Commit 9f623b9

Browse files
authored
Update desklet.js
Translation code comments in English
1 parent 884e480 commit 9f623b9

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

desklets/cinnaclock@dingo/desklet.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ MyDesklet.prototype = {
119119
this.settings.bind("dayFont", "dayFont", this._onSettingsChanged);
120120
this.settings.bind("dateFont", "dateFont", this._onSettingsChanged);
121121

122-
// Binding Ombre
122+
// Binding Shadow
123123
this.settings.bind("horizontal-dayshadow", "horDayShadow", this._onSettingsChanged);
124124
this.settings.bind("vertical-dayshadow", "vertDayShadow", this._onSettingsChanged);
125125
this.settings.bind("dayshadow-blur", "dayShadowBlur", this._onSettingsChanged);
@@ -133,36 +133,33 @@ MyDesklet.prototype = {
133133
this.settings.bind("dateshadow-blur", "dateShadowBlur", this._onSettingsChanged);
134134
this.settings.bind("dateshadow-color", "dateShadowColor", this._onSettingsChanged);
135135

136-
// Binding maiuscolo
137-
this.settings.bind("time-uppercase", "timeUppercase", this._onSettingsChanged);
138-
this.settings.bind("day-uppercase", "dayUppercase", this._onSettingsChanged);
139-
this.settings.bind("date-uppercase", "dateUppercase", this._onSettingsChanged);
140-
141-
// Binding interruttori
136+
// Binding uppercase and other
137+
this.settings.bind("time-uppercase", "timeUppercase", this._onSettingsChanged);
138+
this.settings.bind("day-uppercase", "dayUppercase", this._onSettingsChanged);
139+
this.settings.bind("date-uppercase", "dateUppercase", this._onSettingsChanged);
140+
142141
this.settings.bind("show-time", "showTime", this._onSettingsChanged);
143142
this.settings.bind("show-day", "showDay", this._onSettingsChanged);
144143
this.settings.bind("show-date", "showDate", this._onSettingsChanged);
145144

146-
// Binding Offset Verticali
147145
this.settings.bind("day-vertical-offset", "dayVerticalOffset", this._onSettingsChanged);
148146
this.settings.bind("date-vertical-offset", "dateVerticalOffset", this._onSettingsChanged);
149147
},
150-
151148

152149
_onSettingsChanged: function() {
153-
// GESTIONE VISIBILITÀ
150+
// Visibility
154151
this._timeBox.visible = this.showTime;
155152
this._dayBox.visible = this.showDay;
156153
this._dateBox.visible = this.showDate;
157154

158-
// GESTIONE STILI (Font, Colori, Ombre)
155+
// Style
159156
let s = (h, v, b, c) => (b > 0 || h != 0 || v != 0) ? `text-shadow: ${h}px ${v}px ${b}px ${c};` : "";
160157

161158
this._time.set_style(this._parseFontString(this.timeFont, this.timeColor) + s(this.horTimeShadow, this.vertTimeShadow, this.timeShadowBlur, this.timeShadowColor));
162159
this._day.set_style(this._parseFontString(this.dayFont, this.dayColor) + s(this.horDayShadow, this.vertDayShadow, this.dayShadowBlur, this.dayShadowColor));
163160
this._date.set_style(this._parseFontString(this.dateFont, this.dateColor) + s(this.horDateShadow, this.vertDateShadow, this.dateShadowBlur, this.dateShadowColor));
164161

165-
// GESTIONE POSIZIONAMENTO (Translation/Offset)
162+
// Offset
166163
this._dayBox.set_translation(0, this.dayVerticalOffset, 0);
167164
this._dateBox.set_translation(0, this.dateVerticalOffset, 0);
168165

@@ -176,22 +173,19 @@ _updateDate: function() {
176173
let dayText = displayDate.toLocaleFormat(this.dayFormat);
177174
let dateText = displayDate.toLocaleFormat(this.dateFormat);
178175

179-
// GESTIONE ORA
176+
180177
if (this.timeUppercase) {
181178
timeText = timeText.toUpperCase();
182179
}
183180

184-
// GESTIONE GIORNO
185181
if (this.dayUppercase) {
186182
dayText = dayText.toUpperCase();
187183
} else {
188-
// Se non è tutto maiuscolo, mettiamo solo la prima lettera maiuscola (es: Sabato)
189184
if (dayText) {
190185
dayText = dayText.charAt(0).toUpperCase() + dayText.slice(1);
191186
}
192187
}
193188

194-
// GESTIONE DATA
195189
if (this.dateUppercase) {
196190
dateText = dateText.toUpperCase();
197191
}

0 commit comments

Comments
 (0)