| 1034 | }; |
| 1035 | |
| 1036 | const handleLocaleChange = (newLocale: Locale) => { |
| 1037 | changeLocale(newLocale); |
| 1038 | |
| 1039 | // 通知所有已加载的插件更新语言 | Notify all loaded plugins to update locale |
| 1040 | if (pluginManagerRef.current) { |
| 1041 | pluginManagerRef.current.setLocale(newLocale); |
| 1042 | |
| 1043 | // 通过 MessageHub 通知需要重新获取节点模板 | Notify via MessageHub to refetch node templates |
| 1044 | if (messageHubRef.current) { |
| 1045 | messageHubRef.current.publish('locale:changed', { locale: newLocale }); |
| 1046 | } |
| 1047 | } |
| 1048 | }; |
| 1049 | |
| 1050 | const handleToggleDevtools = async () => { |
| 1051 | try { |