feat(server): resolve app translations across remaining metadata resolvers (#22237)
## Summary
**PR 3/4** of the app-metadata-translations stack. Extends runtime
translation resolution to the remaining Twenty-rendered metadata types
so coverage is complete.
- New shared `MetadataTranslationResolverService.getApplicationCatalog({
applicationId, workspaceId, locale })` — the single seam for fetching an
app's per-locale catalog.
- Wired into the **page-layout tab**, **page-layout widget**,
**view-field-group**, **command-menu navigation item**, and **view
name** resolvers, each extended with an optional `applicationCatalog`
param (backward-compatible).
Together with PR 1/4 (object + field), this covers all seven
translatable metadata surfaces.
## Stack
Stacks on #22236 (PR 2/4). Base branch:
`claude/app-translation-2-sdk-manifest`.
## Verification note
`yarn install` could not complete in the remote dev environment, so
typecheck/lint/tests were not run locally — **CI is the source of
truth**.
https://claude.ai/code/session_01NiE7o3cd3zCLZarVkJa6UA
---
_Generated by [Claude
Code](https://claude.ai/code/session_01NiE7o3cd3zCLZarVkJa6UA)_
<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22237?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
+6
-15
@@ -5,7 +5,6 @@ import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
|
||||
import { ApplicationTranslationCacheService } from 'src/engine/core-modules/application/application-translation/application-translation-cache.service';
|
||||
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
|
||||
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
|
||||
import { ForbiddenError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
|
||||
@@ -45,7 +44,6 @@ export class FieldMetadataResolver {
|
||||
constructor(
|
||||
private readonly fieldMetadataService: FieldMetadataService,
|
||||
private readonly i18nService: I18nService,
|
||||
private readonly applicationTranslationCacheService: ApplicationTranslationCacheService,
|
||||
) {}
|
||||
|
||||
@ResolveField(() => Boolean, {
|
||||
@@ -71,19 +69,12 @@ export class FieldMetadataResolver {
|
||||
|
||||
const isStandardApp = fieldMetadata.applicationId === standardApplicationId;
|
||||
|
||||
const applicationRegistrationId = isStandardApp
|
||||
? null
|
||||
: await context.loaders.applicationRegistrationIdLoader.load({
|
||||
workspaceId,
|
||||
applicationId: fieldMetadata.applicationId,
|
||||
});
|
||||
|
||||
const applicationCatalog = isDefined(applicationRegistrationId)
|
||||
? await this.applicationTranslationCacheService.getCatalog({
|
||||
applicationRegistrationId,
|
||||
locale: context.req.locale,
|
||||
})
|
||||
: undefined;
|
||||
const applicationCatalog =
|
||||
await context.loaders.applicationTranslationCatalogLoader.load({
|
||||
applicationId: fieldMetadata.applicationId,
|
||||
workspaceId,
|
||||
locale: context.req.locale,
|
||||
});
|
||||
|
||||
return resolveFieldMetadataStandardOverride(
|
||||
fieldMetadata,
|
||||
|
||||
Reference in New Issue
Block a user