[i18n] Load custom nodes locales from ComfyUI server (#2314)

This commit is contained in:
Chenlei Hu
2025-01-22 17:37:02 -05:00
committed by GitHub
parent 08d2322817
commit 1bcc00cd33
2 changed files with 22 additions and 0 deletions

View File

@@ -877,6 +877,15 @@ export class ComfyApi extends EventTarget {
async getFolderPaths(): Promise<Record<string, string[]>> {
return (await axios.get(this.internalURL('/folder_paths'))).data
}
/**
* Gets the custom nodes i18n data from the server.
*
* @returns The custom nodes i18n data
*/
async getCustomNodesI18n(): Promise<Record<string, any>> {
return (await axios.get(this.apiURL('/i18n'))).data
}
}
export const api = new ComfyApi()