Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add raw localizations to meta types, fields and enums #314

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

Etienne-Buschong
Copy link
Contributor

Currently, it is only possible to query localizations by explicitly specifying the target language for the client. There are also use-cases where the localization is not immediately used in a client, but needed to be processed in another system. In this case it is convenient to be able to query the translations in all locales in a single request.

@Etienne-Buschong Etienne-Buschong requested a review from Yogu March 19, 2024 09:24
@Etienne-Buschong Etienne-Buschong force-pushed the meta-field-localizations-i18n-string branch from 7924603 to ba10b81 Compare March 20, 2024 07:43
@Etienne-Buschong
Copy link
Contributor Author

Can be reviewed again.

@Etienne-Buschong
Copy link
Contributor Author

Should I also add tests in meta-schema.spec.ts?

@Yogu
Copy link
Member

Yogu commented Mar 20, 2024

Should I also add tests in meta-schema.spec.ts?

ah yes please, forgot about them here. You could probably also add some unit tests that query the properties in the Field etc. instances directly (e.g. from a model created by createModel())

@Etienne-Buschong Etienne-Buschong force-pushed the meta-field-localizations-i18n-string branch from ba10b81 to 65445d6 Compare March 20, 2024 14:22
@Etienne-Buschong
Copy link
Contributor Author

Added the tests.

@@ -939,6 +1024,84 @@ describe('Meta schema API', () => {
});
});

it('can query raw localization of types', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a test for a field where only one of the languages is present, to make sure the value omits this key then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a test for a field on the root entity type and a value object, both with only german translations

Currently, it is only possible to query localizations by
explicitly specifying the target language for the client.
There are also use-cases where the localization is not
immediately used in a client, but needed to be processed
in another system. In this case it is convenient to be
able to query the translations in all locales in a single
request.
@Etienne-Buschong Etienne-Buschong force-pushed the meta-field-localizations-i18n-string branch from 65445d6 to 4b98144 Compare March 21, 2024 08:25
@Yogu Yogu merged commit 4f19988 into main Mar 21, 2024
28 checks passed
@Yogu Yogu deleted the meta-field-localizations-i18n-string branch March 21, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants