Allow Google translate and manual translation to co-exist

Created on 3 January 2024, 9 months ago
Updated 20 March 2024, 6 months ago

Problem/Motivation

Site editors may be able to translate the interface and key blocks, but not translate content. Ideally people could use Drupal's language switcher to do the former at the same time as getting Google Translate to do the rest. (Note that Google Translate honors a "notranslate" class that can be put on blocks.)

Proposed resolution

(Add an option to) replace the direct-from google dropdown (which doesn't look good in most themes) with Drupal core's language switcher.

Allow part-human, part-machine translations by triggering Google translate and Drupal interface translation at the same time, allowing sections of your site's localization to be done by humans and the rest by machines.

Remaining tasks

I maintain https://www.drupal.org/project/cyborgtranslate β†’ and before doing any more work there i wanted to see if its approach would be of interest here.

The biggest difference actually is deriving the list of available languages from Drupal's configuration, but that could all be hidden/controlled by a single toggle, that hides the existing language selection and provides link to Drupal's (or instructions to enable language modules) if using Drupal's language switcher is selected.

The "Session" (query string) approach to language negotiation can be (goofily, but effectively) extended to also communicate to Google Translate what the translation should be: ?language=es#googtrans(en|es)

User interface changes

Add toggle and instructions for this option to the settings form.

Use (something more like) the built-in language switcher in place of the google translate dropdown if so.

✨ Feature request
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024