Skip to content

Commit

Permalink
Fix E2E tests (twentyhq#9919)
Browse files Browse the repository at this point in the history
Fortunately we're not using NODE_ENV=production for our deployment, but
we need to think of a better long-term fix. Not easy because Lingui
strips out messages in production environment
  • Loading branch information
FelixMalfait authored and eliezer-rodrigues037 committed Jan 30, 2025
1 parent 2be65cd commit d30f267
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
run: NODE_ENV=production NODE_OPTIONS="--max-old-space-size=10240" npx nx build twenty-front

- name: Build server
run: NODE_ENV=production npx nx build twenty-server
run: npx nx build twenty-server

- name: Create and setup database
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,13 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
return objectMetadata[labelKey];
}

i18n.activate(locale);
const messageId = generateMessageId(objectMetadata[labelKey] ?? '');
const translatedMessage = i18n._(messageId);

return i18n._(generateMessageId(objectMetadata[labelKey]));
if (translatedMessage === messageId) {
return objectMetadata[labelKey] ?? '';
}

return translatedMessage;
}
}

0 comments on commit d30f267

Please sign in to comment.