mirror of
https://github.com/penpot/penpot.git
synced 2026-05-30 04:08:08 +00:00
🐛 Fix keep copy untranslated to preserve token name validation (#9877)
This commit is contained in:
parent
0c568b0b2d
commit
310f224ab6
@ -683,7 +683,11 @@
|
||||
token-id)]
|
||||
(let [tokens (vals (ctob/get-tokens tokens-lib (ctob/get-id token-set)))
|
||||
unames (map :name tokens) ;; TODO: add function duplicate-token in tokens-lib
|
||||
suffix (tr "workspace.tokens.duplicate-suffix")
|
||||
;; "copy" is intentionally not translated here. Token names are validated
|
||||
;; against a restricted set of allowed characters (currently English-compatible),
|
||||
;; so translating this suffix could introduce invalid characters and break
|
||||
;; token name validation.
|
||||
suffix "copy"
|
||||
copy-name (cfh/generate-unique-name (:name token) unames :suffix suffix)
|
||||
new-token (-> token
|
||||
(ctob/reid (uuid/next))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user