AIGODLIKE / AIGODLIKE-ComfyUI-Translation

A plugin for multilingual translation of ComfyUI,This plugin implements translation of resident menu bar/search bar/right-click context menu/node, etc
https://www.aigodlike.com/
1.42k stars 118 forks source link

How to access translations from another node #133

Closed chrisgoringe closed 8 months ago

chrisgoringe commented 9 months ago

I'm the author of the Use Everywhere nodes, and they include a couple of nodes which transmit data to inputs that match a certain string pattern or regex. So this is a non-visual element which needs to be translated in order to match visual elements...

https://github.com/chrisgoringe/cg-use-everywhere/issues/81

I'm wondering if it is possible for a third party node to access the translations in this node - it looks like it would be a case of accessing the static T object, but wanted to do it cleanly!

My thought would be to add a new entry to cg-use-everywhere.json which isn't a node - like:

 "Use Everywhere extra translations" : { "seed-regex" : ".*seed.*" }

which could be accessed something like

T.Nodes["Use Everywhere extra translations"]["seed-regex"]

I'm happy to do the PR, but want to check if you are comfortable with this slight misuse of the json structure!

Yorha4D commented 8 months ago

@chrisgoringe You can refer to the translation of zh-CN