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

Refactor formality translation context handling. #353

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

NarkNiro
Copy link
Member

@NarkNiro NarkNiro commented Aug 29, 2024

The problem with global formality configuration is true. That a target language has not been checked to see whether formality is supported. An error response from the DeepL API is returned for unsupported languages, which states ‘formality not supported’.

To enable better handling for formality, only supported target languages. An additional formality field is added in the SiteConfiguration, which reflects the options of the API.
The Formality field only appears for supported target languages, which is checked against the supported languages API.

An upgrade wizard has been provided to simplify the conversion of the Formality configuration to the SiteConfiguration.

Additionally, a DTO TranslateContext has been introduced, to centralise parameter handling for better handling of translation parameters.

@NarkNiro NarkNiro force-pushed the task/formality-refactor branch 2 times, most recently from d0bb220 to 575051d Compare August 29, 2024 13:19
Classes/ClientInterface.php Outdated Show resolved Hide resolved
Classes/Domain/Repository/PageRepository.php Outdated Show resolved Hide resolved
Classes/Domain/Repository/PageRepository.php Show resolved Hide resolved
Classes/Hooks/AbstractTranslateHook.php Outdated Show resolved Hide resolved
Classes/Hooks/AbstractTranslateHook.php Outdated Show resolved Hide resolved
Tests/Functional/Form/User/HasFormalitySupportTest.php Outdated Show resolved Hide resolved
Tests/Functional/Hooks/TranslateHookTest.php Show resolved Hide resolved
Tests/Functional/Updates/FormalityUpgradeWizardTest.php Outdated Show resolved Hide resolved
ext_localconf.php Outdated Show resolved Hide resolved
The problem with global formality configuration is true.
That a target language has not been checked to see whether formality is supported.
An error response from the DeepL API is returned for unsupported languages,
which states ‘formality not supported’.

To enable better handling for formality, only supported target languages.
An additional formality field is added in the SiteConfiguration,
which reflects the options of the API.
The Formality field only appears for supported target languages,
which is checked against the supported languages API.

An upgrade wizard has been provided to simplify the conversion of the Formality configuration to the SiteConfiguration.

Additionally, a DTO TranslateContext has been introduced,
to centralise parameter handling for better handling of translation parameters.
@calien666 calien666 merged commit 4dd53e6 into main Sep 3, 2024
11 checks passed
@calien666 calien666 deleted the task/formality-refactor branch September 3, 2024 15:15
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