View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
20294Bug reportsTranslationpublic2025-11-12 16:31
ReporterFreda Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
Summary20294: Translation fails (Dari and Tigrinya) due to missing language code mappings
Description

No explicit error appears even when debug mode is enabled. The browser console shows a true response, but no translation result is produced. see screenshot.

After investigation (credit to Tim), it appears that the issue is caused by missing language code mappings in:

/assets/scripts/admin/translation.js

and possibly also in QuickTranslationController::translateGoogleApi

Adding a manual mapping for the language resolves the issue (tested in browser by manipulating translation.js).

Steps To Reproduce

Steps to reproduce

Create or open any survey with multiple languages.

Add Dari (prs) or Tigrinya (ti) as an additional language.

Open the “Quick Translation” tool.

Attempt to auto-translate from English to the additional language.

Expected result

The translation should complete successfully, similar to other supported languages.

Actual result

Translation fails see attached screenshot.
Debug mode does not reveal an error.

Proposed Fix:
Add proper mappings for prs (Dari) → fa-AF and ti (Tigrinya) → appropriate Google Translate language code both in:
assets/scripts/admin/translation.js
QuickTranslationController::translateGoogleApi

TagsNo tags attached.
Attached Files
Bug heat10
Complete LimeSurvey version number (& build).
I will donate to the project if issue is resolvedNo
Browserchrome
Database type & version..
Server OS (if known)
Webserver software & version (if known)
PHP Version.

Relationships

has duplicate 20323 closedc_schmitz Google Translate integration fails for some languages due to mismatched language codes (hat, prs, mya, swh, fil) 

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2025-10-25 15:31

updater   ~83671

@gabrieljenik, @tibor.pacalat, we also tested some languages with Google translate recently, see 20323.

There may be some more languages missing:

  1. Hausa (ha)
  2. Somali (so)

For the previously mentioned language "Dari" the issue could also be related to different language codes used (see my bug report link above). Google treats this as a variation of Persian and thus uses code "fa" while Limesurvey uses "prs" as language code.

c_schmitz

c_schmitz

2025-11-12 16:01

administrator   ~83754

https://github.com/LimeSurvey/LimeSurvey/pull/4523

c_schmitz

c_schmitz

2025-11-12 16:31

administrator   ~83756

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=39147

Related Changesets

LimeSurvey: master fe4ebd25

2025-11-12 16:31

c_schmitz

Committer: GitHub


Details Diff
Fixed issue 20294: Quick-translate using Google translation API would not work with some languages (04523) Affected Issues
20294
mod - application/controllers/QuickTranslationController.php Diff File
mod - application/views/quickTranslation/translateformheader_view.php Diff File
mod - assets/scripts/admin/translation.js Diff File
mod - composer.json Diff File
mod - vendor/composer/autoload_psr4.php Diff File
mod - vendor/composer/autoload_static.php Diff File
mod - vendor/composer/installed.php Diff File
rm - vendor/gtranslate-api/COPYING Diff
rm - vendor/gtranslate-api/ChangeLog Diff
rm - vendor/gtranslate-api/GTranslate.php Diff
rm - vendor/gtranslate-api/languages.ini Diff
rm - vendor/gtranslate-api/languages.v2.ini Diff
add - vendor/viniciusgava/google-translate-api/.gitignore Diff File
add - vendor/viniciusgava/google-translate-api/.travis.yml Diff File
add - vendor/viniciusgava/google-translate-api/LICENSE Diff File
add - vendor/viniciusgava/google-translate-api/composer.json Diff File
add - vendor/viniciusgava/google-translate-api/phpcs.xml Diff File
add - vendor/viniciusgava/google-translate-api/phpunit.xml Diff File
add - vendor/viniciusgava/google-translate-api/src/Client.php Diff File
add - vendor/viniciusgava/google-translate-api/src/DetectInterface.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/DetectErrorException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/InvalidAccessKeyException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/InvalidLanguageException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/InvalidSourceLanguageException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/InvalidTargetLanguageException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/InvalidTextException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/LanguagesErrorException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/Exception/TranslateErrorException.php Diff File
add - vendor/viniciusgava/google-translate-api/src/LanguagesInterface.php Diff File
add - vendor/viniciusgava/google-translate-api/src/TranslateInterface.php Diff File

Issue History

Date Modified Username Field Change
2025-10-10 16:40 Freda New Issue
2025-10-10 16:40 Freda File Added: Screenshot 2025-09-29 at 14.41.26.png
2025-10-13 09:58 tibor.pacalat Assigned To => gabrieljenik
2025-10-13 09:58 tibor.pacalat Status new => assigned
2025-10-25 15:31 Mazi Note Added: 83671
2025-10-25 15:31 Mazi Bug heat 0 => 2
2025-10-25 15:32 Mazi Relationship added related to 20323
2025-11-12 01:05 c_schmitz Assigned To gabrieljenik => c_schmitz
2025-11-12 15:36 c_schmitz Relationship replaced has duplicate 20323
2025-11-12 15:36 c_schmitz Bug heat 2 => 8
2025-11-12 15:36 Mazi Bug heat 8 => 10
2025-11-12 16:01 c_schmitz Status assigned => ready for code review
2025-11-12 16:01 c_schmitz Note Added: 83754
2025-11-12 16:31 c_schmitz Changeset attached => LimeSurvey master fe4ebd25
2025-11-12 16:31 c_schmitz Note Added: 83756
2025-11-12 16:31 c_schmitz Status ready for code review => resolved
2025-11-12 16:31 c_schmitz Resolution open => fixed