🐛 Fix keep copy untranslated to preserve token name validation (#9877)

This commit is contained in:
Eva Marco 2026-05-26 16:26:13 +02:00 committed by GitHub
parent 0c568b0b2d
commit 310f224ab6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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))