🐛 Fix warnings for unsupported token $type (#8873)

* 🐛 Fix warnings for unsupported token $type

Signed-off-by: Dexterity104 <hatanokanjiro@gmail.com>

* 🐛 Add changelog entry for Github #8790

---------

Signed-off-by: Dexterity104 <hatanokanjiro@gmail.com>
Signed-off-by: Dexterity <173429049+Dexterity104@users.noreply.github.com>
This commit is contained in:
Dexterity 2026-04-09 11:09:19 -04:00 committed by GitHub
parent d2050d5331
commit e49b7ce14c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 60 additions and 55 deletions

View File

@ -23,6 +23,7 @@
- Add drag-to-change for numeric inputs in workspace sidebar [Github #2466](https://github.com/penpot/penpot/issues/2466)
- Add CSS linter [Taiga #13790](https://tree.taiga.io/project/penpot/us/13790)
- Save and restore selection state in undo/redo (by @eureka928) [Github #6007](https://github.com/penpot/penpot/issues/6007)
- Fix warnings for unsupported token $type (by @Dexterity104) [Github #8790](https://github.com/penpot/penpot/issues/8790)
- Add per-group add button for typographies (by @eureka928) [Github #5275](https://github.com/penpot/penpot/issues/5275)
### :bug: Bugs fixed

View File

@ -7,6 +7,7 @@
(ns app.main.data.workspace.tokens.import-export
(:require
[app.common.json :as json]
[app.common.logging :as l]
[app.common.path-names :as cpn]
[app.common.types.tokens-lib :as ctob]
[app.config :as cf]
@ -44,10 +45,17 @@
(defn- show-unknown-types-warning [unknown-tokens]
(let [type->tokens (group-by-value unknown-tokens)]
(l/wrn :hint "unsupported token types found during import"
:tokens (str/join ", " (map (fn [[path type]] (str path " (" type ")")) unknown-tokens)))
(ntf/show {:content (tr "workspace.tokens.unknown-token-type-message")
:detail (->> (for [[token-type tokens] type->tokens]
(tr "workspace.tokens.unknown-token-type-section" token-type (count tokens)))
(str/join "<br>"))
:detail (->> (for [[token-type token-paths] type->tokens]
(str (tr "workspace.tokens.unknown-token-type-section" token-type (count token-paths))
"<br>"
(->> token-paths
(sort)
(map #(str "&nbsp;&nbsp;• " %))
(str/join "<br>"))))
(str/join "<br><br>"))
:type :toast
:level :info})))

View File

@ -8023,13 +8023,13 @@ msgstr "TOKENS - %s"
msgid "workspace.tokens.tools"
msgstr "Werkzeuge"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "Der Import war erfolgreich. Einige Token wurden nicht übernommen."
msgstr "Der Import war erfolgreich, aber einige Token wurden übersprungen, da sie nicht unterstützte $type-Werte verwenden. Details aufklappen, um zu sehen, welche Token betroffen sind."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "„%s“ wird nicht als Datentyp unterstützt (%s)\n"
msgstr "„%s“ wird nicht als Datentyp unterstützt (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8626,13 +8626,13 @@ msgstr "TOKENS - %s"
msgid "workspace.tokens.tools"
msgstr "Tools"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "Import was successful. Some tokens were not included."
msgstr "Import was successful, but some tokens were skipped because they use unsupported $type values. Expand details to see which tokens were affected."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Type '%s' is not supported (%s)\n"
msgstr "Type '%s' is not supported (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8477,15 +8477,13 @@ msgstr "Introduce un valor o un alias usando {alias}"
msgid "workspace.tokens.tools"
msgstr "Herramientas"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr ""
"La importación se ha realizado correctamente. Algunos tokens no se "
"incluyeron."
msgstr "La importación se ha realizado correctamente, pero algunos tokens fueron omitidos porque usan valores de $type no soportados. Expande los detalles para ver qué tokens se vieron afectados."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "El tipo '%s' no está soportado (%s)\n"
msgstr "El tipo '%s' no está soportado (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8150,13 +8150,13 @@ msgstr "TOKENS - %s"
msgid "workspace.tokens.tools"
msgstr "Outils"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "L'importation a réussi. Certains tokens n'ont pas été inclus."
msgstr "L'importation a réussi, mais certains tokens ont été ignorés car ils utilisent des valeurs $type non prises en charge. Développez les détails pour voir quels tokens ont été affectés."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Le type « %s » n'est pas pris en charge (%s)\n"
msgstr "Le type « %s » n'est pas pris en charge (%s) :"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8033,13 +8033,13 @@ msgstr "אסימונים - %s"
msgid "workspace.tokens.tools"
msgstr "כלים"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "הייבוא הצליח. חלק מהאסימונים לא נכללו."
msgstr "הייבוא הצליח, אך חלק מהאסימונים דולגו כי הם משתמשים בערכי $type שאינם נתמכים. הרחב את הפרטים כדי לראות אילו אסימונים הושפעו."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "הסוג %s לא נתמך (%s)\n"
msgstr "הסוג %s לא נתמך (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8187,13 +8187,13 @@ msgstr "टोकन - %s"
msgid "workspace.tokens.tools"
msgstr "औजार"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "आयात सफल रहा। कुछ टोकन शामिल नहीं किए गए।"
msgstr "आयात सफल रहा, लेकिन कुछ टोकन छोड़ दिए गए क्योंकि वे असमर्थित $type मानों का उपयोग करते हैं। प्रभावित टोकन देखने के लिए विवरण विस्तृत करें।"
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "टाइप '%s' समर्थित नहीं है (%s)\n"
msgstr "टाइप '%s' समर्थित नहीं है (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8419,15 +8419,13 @@ msgstr "TOKEN - %s"
msgid "workspace.tokens.tools"
msgstr "Strumenti"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr ""
"Limportazione è stata completata con successo. Alcuni token non sono stati "
"inclusi."
msgstr "Limportazione è stata completata con successo, ma alcuni token sono stati ignorati perché utilizzano valori $type non supportati. Espandi i dettagli per vedere quali token sono stati interessati."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Il tipo '%s' non è supportato (%s)\n"
msgstr "Il tipo '%s' non è supportato (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -7720,9 +7720,9 @@ msgstr "TEKSTVIENĪBAS - %s"
msgid "workspace.tokens.tools"
msgstr "Rīki"
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Veids \"%s\" nav atbalstīts (%s)\n"
msgstr "Veids \"%s\" nav atbalstīts (%s):"
#: src/app/main/ui/workspace/tokens/management/token_pill.cljs:132
msgid "workspace.tokens.value-not-valid"

View File

@ -8435,13 +8435,13 @@ msgstr "TOKENS - %s"
msgid "workspace.tokens.tools"
msgstr "Hulpmiddelen"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "Importeren was succesvol. Sommige tokens zijn niet inbegrepen."
msgstr "Importeren was succesvol, maar sommige tokens zijn overgeslagen omdat ze niet-ondersteunde $type-waarden gebruiken. Klap de details uit om te zien welke tokens getroffen zijn."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Typ '%s' wordt niet ondersteund (%s)\n"
msgstr "Typ '%s' wordt niet ondersteund (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -7956,13 +7956,13 @@ msgstr "TOKEN-URI- %s"
msgid "workspace.tokens.tools"
msgstr "Unelte"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "Import cu succes. Unele token-uri nu au fost incluse."
msgstr "Importul a fost realizat cu succes, dar unele token-uri au fost omise deoarece folosesc valori $type neacceptate. Extindeți detaliile pentru a vedea care token-uri au fost afectate."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Tipul '%s' nu este suportat (%s)\n"
msgstr "Tipul '%s' nu este suportat (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8107,13 +8107,13 @@ msgstr "TOKEN - %s"
msgid "workspace.tokens.tools"
msgstr "Verktyg"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "Importen lyckades. Vissa tokens inkluderades ej."
msgstr "Importen lyckades, men vissa tokens hoppades över eftersom de använder $type-värden som inte stöds. Expandera detaljerna för att se vilka tokens som påverkades."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Typen '%s' stödjs ej (%s)\n"
msgstr "Typen '%s' stöds ej (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -8393,13 +8393,13 @@ msgstr "TOKENLER - %s"
msgid "workspace.tokens.tools"
msgstr "Araçlar"
#: src/app/main/data/workspace/tokens/import_export.cljs:46
#: src/app/main/data/workspace/tokens/import_export.cljs:50
msgid "workspace.tokens.unknown-token-type-message"
msgstr "İçe aktarma başarılı oldu. Bazı tokenler dahil edilmedi."
msgstr "İçe aktarma başarılı oldu, ancak bazı tokenler desteklenmeyen $type değerleri kullandıkları için atlandı. Hangi tokenlerin etkilendiğini görmek için ayrıntıları genişletin."
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "'%s' türü desteklenmiyor (%s)\n"
msgstr "'%s' türü desteklenmiyor (%s):"
#: src/app/main/ui/workspace/tokens/management/forms/shadow.cljs:244, src/app/main/ui/workspace/tokens/management/forms/typography.cljs:199
msgid "workspace.tokens.use-reference"

View File

@ -7421,9 +7421,9 @@ msgstr "ТОКЕНИ - %s"
msgid "workspace.tokens.tools"
msgstr "Інструменти"
#: src/app/main/data/workspace/tokens/import_export.cljs:48
#: src/app/main/data/workspace/tokens/import_export.cljs:52
msgid "workspace.tokens.unknown-token-type-section"
msgstr "Тип \"%s\" непідтримуваний (%s)\n"
msgstr "Тип \"%s\" непідтримуваний (%s):"
#: src/app/main/ui/workspace/tokens/management/token_pill.cljs:132
msgid "workspace.tokens.value-not-valid"