mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
translate all analytics to English for template metadata (#6292)
## Summary Track template metadata in English for analytics regardless of user's locale to enable consistent statistical analysis. ## Changes - **What**: Load English [template index](https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/public/templates) alongside localized version (cloud builds only) - **What**: Added `getEnglishMetadata()` method to `workflowTemplatesStore` that returns English versions of template tags, category, useCase, models, and license - **What**: Updated `MixpanelTelemetryProvider` to prefer English metadata for analytics events, falling back to localized values ## Review Focus English template fetch only triggers in cloud builds via `isCloud` flag. Non-cloud builds see no bundle size impact. Method returns null when English templates unavailable, with fallback to localized data ensuring analytics continue working in edge cases. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6292-translate-all-analytics-to-English-for-template-metadata-2986d73d365081fdbc21f372aa9bb41e) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -205,15 +205,20 @@ export class MixpanelTelemetryProvider implements TelemetryProvider {
|
||||
const template = templatesStore.getTemplateByName(
|
||||
activeWorkflow.filename
|
||||
)
|
||||
|
||||
const englishMetadata = templatesStore.getEnglishMetadata(
|
||||
activeWorkflow.filename
|
||||
)
|
||||
|
||||
return {
|
||||
is_template: true,
|
||||
workflow_name: activeWorkflow.filename,
|
||||
template_source: template?.sourceModule,
|
||||
template_category: template?.category,
|
||||
template_tags: template?.tags,
|
||||
template_models: template?.models,
|
||||
template_use_case: template?.useCase,
|
||||
template_license: template?.license
|
||||
template_category: englishMetadata?.category ?? template?.category,
|
||||
template_tags: englishMetadata?.tags ?? template?.tags,
|
||||
template_models: englishMetadata?.models ?? template?.models,
|
||||
template_use_case: englishMetadata?.useCase ?? template?.useCase,
|
||||
template_license: englishMetadata?.license ?? template?.license
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user