Improve language handling#107
Merged
Merged
Conversation
- Add optional `language` enum (EN/DE/HU) to RecipeRequest spec - Spring API forwards client UI language to GenAI service - All clients regenerated: TS api.ts, Kotlin RecipeRequest, Python clients - Web client sends active UI language with each recipe request - Add i18n test suite and update GeneratePage/ProfilePage tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🧹 The preview environment was removed because this PR was closed. |
The inline enums generated two incompatible Language types, breaking the controller that copies the request language into profile preferences. $ref a shared Language schema so codegen emits one enum everywhere. Also fix the German-locale ProfilePage test to click "Automatisch". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9c9be4d to
39deb9a
Compare
# Conflicts: # services/spring-api/src/main/kotlin/org/openapitools/api/AIApiController.kt
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Can you please review if the language picker looks fine on your phones? Especially @paulwiese on iOS |
The recipe controller serializes the GenAI request body to a JSON string via objectMapper.writeValueAsString, so the test helper must deserialize it rather than casting the captured value to a Map. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Looks good! |
paulwiese
reviewed
Jun 18, 2026
| const tagLabels = selectedTags.map((id) => tagsById.get(id)?.label).filter(Boolean) | ||
| const fullPrompt = tagLabels.length > 0 ? `${prompt}\n\nPreferences: ${tagLabels.join(', ')}` : prompt | ||
| const body: RecipeRequest = {prompt: fullPrompt} | ||
| const body: RecipeRequest = {prompt: fullPrompt, language: currentLanguage()} |
Collaborator
There was a problem hiding this comment.
Do I understand it correctly that the language is detected based on Browser settings etc. ?
Collaborator
Author
There was a problem hiding this comment.
Yes, it's
- Language set in the preferences
- If Auto: language of the browser
- If not supported: English
(So now the same for GenAI as it is for the UI)
Resolve conflicts: - AIApiController: keep main's Retrofit-based internal client, fold in the language-override feature (RecipeRequest.language overrides the forwarded profile's preference). - AIApiTest: rewrite the language test against the Retrofit mock, capturing the forwarded RecipeRequestForwarded. - Regenerate the Python internal clients from the resolved openapi-internal spec (package renamed to cooking_assistant_gen_ai_services_api_internal_client). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional
languageenum to RecipeRequest so generated recipes match the active UI language.🤖 Generated with Claude Code