Skip to content

Commit

Permalink
gui: Add action detail to synced files tooltips
Browse files Browse the repository at this point in the history
  Since we now propose 2 different actions on recently synchronized
  files depending on the click area (i.e. parent folder path or the
  rest of the line), we specify in the tooltips which action will be
  performed.
  • Loading branch information
taratatach committed Apr 9, 2021
1 parent 880f960 commit d25526c
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 9 deletions.
25 changes: 22 additions & 3 deletions gui/elm/Window/Tray/Dashboard.elm
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,33 @@ update msg model =
renderFile : Helpers -> Model -> File -> Html Msg
renderFile helpers model file =
let
pathSeparator =
Platform.pathSeparator model.platform

( basename, extname ) =
File.splitName file.filename

timeAgo =
helpers.distance_of_time_in_words file.updated model.now

dirPath =
File.dirPath (Platform.pathSeparator model.platform) file.path file.filename
File.dirPath pathSeparator file.path file.filename

filenameTitle =
Locale.interpolate [ file.filename ] <|
helpers.t "Dashboard Open file {0}"

dirPathTitle =
if dirPath == pathSeparator then
helpers.t "Dashboard Show in parent folder"

else
Locale.interpolate [ dirPath ] <|
helpers.t "Dashboard Show in folder {0}"
in
div
[ class "file-line"
, title file.path
, title filenameTitle
, onClick (OpenPath file.path)
]
[ div [ class ("file-type file-type-" ++ file.icon) ] []
Expand All @@ -178,9 +196,10 @@ renderFile helpers model file =
, span [ class "file-name-ext" ] [ text extname ]
]
, span [ class "file-line-content file-extra" ]
[ span [ class "file-time-ago" ] [ text (helpers.distance_of_time_in_words file.updated model.now) ]
[ span [ class "file-time-ago" ] [ text timeAgo ]
, span
[ class "file-parent-folder"
, title dirPathTitle
, stopPropagationOn "click" <|
Json.map (\msg -> ( msg, True )) <|
Json.succeed (ShowInParent file.path)
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "synchronisieren ",
"Dashboard Syncing": "Synchronisiert",
"Dashboard Your cozy is up to date!": "Dein Cozy ist aktuell!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronize",
"Dashboard Syncing": "Syncing",
"Dashboard Your cozy is up to date!": "Your cozy is up to date!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronize",
"Dashboard Syncing": "Syncing",
"Dashboard Your cozy is up to date!": "Your cozy is up to date!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronización",
"Dashboard Syncing": "Sincronizando",
"Dashboard Your cozy is up to date!": "¡Su cozy esta actualizado!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} nombres no pueden terminar con el carácter `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} nombres no pueden contener los caracteres `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronisation",
"Dashboard Syncing": "En cours de synchronisation",
"Dashboard Your cozy is up to date!": "Votre Cozy est à jour !",
"Dashboard Open file {0}": "Ouvrir le fichier {0}",
"Dashboard Show in folder {0}": "Afficher dans le dossier {0}",
"Dashboard Show in parent folder": "Afficher dans le dossier parent",

"Error {0} names cannot end with character `{1}`": "les noms de {0} ne peuvent pas se finir par le caractère `{1}`",
"Error {0} names cannot include characters `{1}`": "les noms de {0} ne peuvent pas inclure les caractères `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "SIncronizza",
"Dashboard Syncing": "Sincronizzazione",
"Dashboard Your cozy is up to date!": "Il tuo cozy è aggiornato!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "同期",
"Dashboard Syncing": "同期中",
"Dashboard Your cozy is up to date!": "お使いの cozy は最新です!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchroniseren",
"Dashboard Syncing": "Bezig met synchroniseren",
"Dashboard Your cozy is up to date!": "Je Cozy is bijgewerkt!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
15 changes: 9 additions & 6 deletions gui/locales/nl_NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchroniseren",
"Dashboard Syncing": "Bezig met synchroniseren...",
"Dashboard Your cozy is up to date!": "Je Cozy is bijgewerkt!",
"Dashboard Open file {0}": "Bestand openen {0}",
"Dashboard Show in folder {0}": "Tonen in map {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "Namen met {0} mogen niet eindigen op '{1}'",
"Error {0} names cannot include characters `{1}`": "Namen met {0} mogen geen '{1}' bevatten",
Expand Down Expand Up @@ -147,12 +150,12 @@

"Helpers {0} day ago": "{0} dag geleden",
"Helpers {0} days ago": "{0} dagen geleden",
"Helpers {0} hour ago": "{0} hr ago",
"Helpers {0} hours ago": "{0} hrs ago",
"Helpers {0} minute ago": "{0} min ago",
"Helpers {0} minutes ago": "{0} mins ago",
"Helpers {0} month ago": "{0} mo ago",
"Helpers {0} months ago": "{0} mos ago",
"Helpers {0} hour ago": "{0} uur geleden",
"Helpers {0} hours ago": "{0} uur geleden",
"Helpers {0} minute ago": "{0} minuut geleden",
"Helpers {0} minutes ago": "{0} minuten geleden",
"Helpers {0} month ago": "{0} maand geleden",
"Helpers {0} months ago": "{0} maanden geleden",
"Helpers and": "en",
"Helpers Bytes": "Bytes",
"Helpers file": "bestand",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronizacja",
"Dashboard Syncing": "Synchronizuje",
"Dashboard Your cozy is up to date!": "Twój Cozy jest aktualny!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/sq.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "Synchronize",
"Dashboard Syncing": "Syncing",
"Dashboard Your cozy is up to date!": "Your cozy is up to date!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down
3 changes: 3 additions & 0 deletions gui/locales/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"Dashboard Synchronize": "同步",
"Dashboard Syncing": "同步中",
"Dashboard Your cozy is up to date!": "你的 cozy 已是最新状态!",
"Dashboard Open file {0}": "Open file {0}",
"Dashboard Show in folder {0}": "Show in folder {0}",
"Dashboard Show in parent folder": "Show in parent folder",

"Error {0} names cannot end with character `{1}`": "{0} names cannot end with character `{1}`",
"Error {0} names cannot include characters `{1}`": "{0} names cannot include characters `{1}`",
Expand Down

0 comments on commit d25526c

Please sign in to comment.