mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 07:23:30 +08:00
Related: https://meta.discourse.org/t/ai-translation-progress-graph/405915/3 A more thorough translation progress screen. Progress now covers posts, topics, categories and tags. The overview cards show the total content in scope, how many are fully translated across all supported locales, and how many still need language detection. Eligibility follows the existing translation settings, including max age, category scope, bot content and PM settings. Tags don't have eligibility settings, so they use the total instead. Opening a card loads its per-locale breakdown separately, so the initial page load doesn't also run every detail query. For each locale, content already in that language is excluded from eligible. Pending includes eligible content that still needs language detection. The posts query is quite heavy, so the overview is cached together for 2h and each detail target has its own 2h cache. Relevant translation settings are part of the cache key, and a distributed mutex prevents duplicate detail queries when two requests miss the same cache. **Perf note**: Calculating translation progress can be expensive on large sites, particularly for posts. The production dataset used for testing contained approximately 2 million posts, 2.5 million post localizations, and 730,000 topic localizations. Post eligibility must also inspect `raw` for the empty and maximum-length rules, so the candidate scope cannot be answered entirely from the existing indexes. To limit the impact we do have cache, and details are fetched only when a card is opened, and the queries aggregate localization coverage in bulk instead of repeatedly probing the localization indexes for every eligible record and target locale. Co-authored-by: awesomerobot <kris.aubuchon@discourse.org> |
||
|---|---|---|
| .. | ||
| controllers | ||
| helpers/discourse_ai/ai_bot | ||
| jobs | ||
| mailers | ||
| models | ||
| serializers | ||
| services | ||
| views | ||