Commit b95c94c
authored
fix(project): use display fallback (#1129)
* fix(api): include source language targets
Treat the conversation or project source display language as part of the configured content translation target set when scheduling eager translation work. This makes eager scheduling match on-demand translation availability and queues translations such as Russian/Kyrgyz seed opinions into English when English is the conversation display language.
Apply the same target-set rule in the import worker because imported conversations create content translation work directly instead of going through the API scheduler.
Deploy: api, import-worker
* fix(agora): preserve inherited languages
Edit conversations that inherit project language settings now load and save with the same inherited/override model used during conversation creation.
Changes:
- Return language settings source and listed project language metadata from the edit endpoint
- Reuse the project language settings control on the edit page when project metadata is available
- Preserve project_inherited on save unless the user switches to a conversation override
- Keep update request and generated API contract/client types in sync
Deploy: agora, api
* fix(math-updater): compare language enums safely
Avoid comparing display_language_code and spoken_language_code columns directly in AI description translation work queries. PostgreSQL does not define equality between distinct enum types, which caused expired translation work recovery and first-pass resume paths to fail. Build matching display/spoken enum pairs instead, so each SQL predicate compares an enum column with a value of the same enum type. Add a regression test covering the supported eager translation pair mapping.
Deploy: math-updater
* feat(project): add machine translation
Add project pages to the existing content translation flow so listed projects can lazily request and display machine translations when dynamic translation is enabled and the target language is configured.
Product behavior:
- Manual project localizations remain native-quality content and do not show the translation toggle.
- Machine translations expose original and translated variants, defaulting based on whether the viewer understands the source language.
- Missing or failed machine translations can be retried from the project page with Show translation.
- Completed project translation events update the relevant cached project content without refetching the whole project page.
Implementation details:
- Add project as a content translation subject with project localized content DTOs and OpenAPI output.
- Return project body as sanitized-rendered HTML via bodyHtml plus originalContent and optional machineTranslation metadata.
- Queue project content translation work through the existing content translation service and availability checks.
- Add shared SSE topic builders and a project translation topic for realtime updates.
- Use generated content translation client calls from the frontend and patch project page cache on retry or SSE completion.
- Update dev project page fixtures and translation preview subject handling for project subjects.
Verification:
- cd services/agora && pnpm exec vue-tsc --noEmit
- cd services/agora && pnpm lint
- cd services/api && pnpm typecheck
Deploy: agora, api
* fix(project): use display fallback
Resolve project and conversation dynamic content using the user's display-language fallback chain on the backend.
Changes:
- add a shared display-language fallback chain and generic preferred-content resolver
- remove project-specific display-language persistence and API state
- make the project language selector update the global display language while showing all display languages with project-supported options first
- resolve project activity card translations per conversation instead of with a project-level language
- regenerate shared DTOs, OpenAPI clients, and the table-drop migration
Deploy: agora, api1 parent 13d590e commit b95c94c
100 files changed
Lines changed: 19210 additions & 1491 deletions
File tree
- services
- agora/src
- api
- .openapi-generator
- docs
- boot
- components
- newConversation
- project
- composables
- pages
- conversation/[conversationSlugId]/edit
- dev
- project
- utils
- api
- translation
- api
- database/flyway
- drizzle
- meta
- src
- service
- tests
- import-worker
- src/import_worker
- tests
- load-testing/src
- api
- .openapi-generator
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
66 | 82 | | |
67 | | - | |
68 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
69 | 104 | | |
70 | 105 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 106 | + | |
74 | 107 | | |
75 | 108 | | |
76 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
314 | 323 | | |
315 | 324 | | |
316 | 325 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
| |||
325 | 331 | | |
326 | 332 | | |
327 | 333 | | |
| 334 | + | |
| 335 | + | |
328 | 336 | | |
329 | 337 | | |
330 | 338 | | |
| |||
0 commit comments