Bug Description
When force_language is set in config.php (e.g., 'force_language' => 'tr'), the OldTranslationProvider::getAvailableLanguages() method returns only the forced language instead of all languages that the AI model can translate between.
This causes the translation language dropdowns to appear empty (or with only 1 language) in any app that uses the legacy ITranslationManager API — most notably Nextcloud Talk (spreed), where clicking "Translate" on a chat message shows no language options.
Root Cause
OldTranslationProvider::getAvailableLanguages() uses $this->l10nFactory->getLanguages() to build the language pair list:
$coreL = $this->l10nFactory->getLanguages();
$languages = array_merge($coreL['commonLanguages'], $coreL['otherLanguages']);
IFactory::getLanguages() returns installed UI translation languages, not all languages the AI can translate. When force_language restricts the server to a single locale, only that one language is returned → N×(N-1) = 0 language pairs.
The newer TranslateProvider (TaskProcessing API) has the same underlying issue — it also relies on l10nFactory->getLanguages() in getInputShapeEnumValues(), but this path is used by the Assistant app which may handle it differently.
Steps to Reproduce
- Set
'force_language' => 'tr' in config.php
- Enable
integration_openai with a working API endpoint
- Open Nextcloud Talk (spreed)
- Click the "⋯" (more options) menu on a message → "Translate"
- Source and target language dropdowns are empty
Expected Behavior
The translation provider should list all languages that the AI model can translate between, regardless of the server's force_language setting. An AI translation provider's available languages are independent of the server's UI language configuration.
Suggested Fix
Instead of relying on l10nFactory->getLanguages(), use a static/hardcoded list of common languages (similar to how the model already translates via free-text prompts and is not limited to installed locales). This list could be:
- A comprehensive set of ISO 639 languages
- Configurable via admin settings
- Or fetched from a standard language registry
This would also fix the same issue in TranslateProvider::getInputShapeEnumValues().
Environment
- Nextcloud: 33.0.2
- integration_openai: 4.3.1
- PHP: 8.4
- Talk (spreed): 23.0.3
force_language: tr
Bug Description
When
force_languageis set inconfig.php(e.g.,'force_language' => 'tr'), theOldTranslationProvider::getAvailableLanguages()method returns only the forced language instead of all languages that the AI model can translate between.This causes the translation language dropdowns to appear empty (or with only 1 language) in any app that uses the legacy
ITranslationManagerAPI — most notably Nextcloud Talk (spreed), where clicking "Translate" on a chat message shows no language options.Root Cause
OldTranslationProvider::getAvailableLanguages()uses$this->l10nFactory->getLanguages()to build the language pair list:IFactory::getLanguages()returns installed UI translation languages, not all languages the AI can translate. Whenforce_languagerestricts the server to a single locale, only that one language is returned → N×(N-1) = 0 language pairs.The newer
TranslateProvider(TaskProcessing API) has the same underlying issue — it also relies onl10nFactory->getLanguages()ingetInputShapeEnumValues(), but this path is used by the Assistant app which may handle it differently.Steps to Reproduce
'force_language' => 'tr'inconfig.phpintegration_openaiwith a working API endpointExpected Behavior
The translation provider should list all languages that the AI model can translate between, regardless of the server's
force_languagesetting. An AI translation provider's available languages are independent of the server's UI language configuration.Suggested Fix
Instead of relying on
l10nFactory->getLanguages(), use a static/hardcoded list of common languages (similar to how the model already translates via free-text prompts and is not limited to installed locales). This list could be:This would also fix the same issue in
TranslateProvider::getInputShapeEnumValues().Environment
force_language:tr