i18n date: abbreviazioni giorni localizzate (context Tide) in calendario, eventi e tooltip

This commit is contained in:
2026-09-02 12:50:04 +02:00
parent e9154f6eef
commit 60c777e650
5 changed files with 42 additions and 6 deletions
+10 -2
View File
@@ -69,7 +69,7 @@ Page {
for (var i = 0; i < n; i++) {
eventsModel.append({
kind: ex[i].kind,
date: Tides.fmtDate(ex[i].t),
date: Tides.fmtDate(ex[i].t, page.dayNames),
time: Tides.fmtHM(ex[i].t),
height: Tides.fmtH(ex[i].h, unit)
})
@@ -101,6 +101,14 @@ Page {
qsTr("Full moon"), qsTr("Waning gibbous"), qsTr("Last quarter"), qsTr("Waning crescent")
]
// abbreviazioni giorni localizzate (context unico "Tide")
property var dayNames: [
qsTranslate("Tide", "Sun"), qsTranslate("Tide", "Mon"),
qsTranslate("Tide", "Tue"), qsTranslate("Tide", "Wed"),
qsTranslate("Tide", "Thu"), qsTranslate("Tide", "Fri"),
qsTranslate("Tide", "Sat")
]
SilicaFlickable {
id: flick
anchors.fill: parent
@@ -203,7 +211,7 @@ Page {
onClicked: {
var t = page.port ? Tides.tide(page.port, new Date(nowBase + (mouse.x / width) * (page.days * 86400000))) : 0
var d = new Date(nowBase + (mouse.x / width) * (page.days * 86400000))
tip.text = Tides.fmtDate(d.getTime()) + " " + Tides.fmtHM(d.getTime()) + " → " + Tides.fmtH(t, page.unit)
tip.text = Tides.fmtDate(d.getTime(), page.dayNames) + " " + Tides.fmtHM(d.getTime()) + " → " + Tides.fmtH(t, page.unit)
tip.visible = true
tipTimer.restart()
}