Add: Chamorro, Chuukese, Fijian, Marshallese, Tahitian, Tok Pisin, and Tongan

Created on 28 August 2024, 4 months ago

Problem/Motivation

Using Gtranslate, we would like to add the following translations for our "English" language site:
- Chamorro
- Chuukese
- Fijian
- Marshallese
- Tahitian
- Tok Pisin
- Tongan

However, while these languages exist in Google Translate, they are not available in the GTranslate module.

Proposed resolution

If there is no other option than custom code, would something like this work?

function custom_gtranslate_override_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
    if ($form_id === 'gtranslate_settings_form') {
        // Add custom language codes and names.
        $form['languages']['#options']['ch'] = 'Chamorro';
        $form['languages']['#options']['fj'] = 'Fijian';
        // Add additional languages as needed.
    }
}

Or an I being naive?

💬 Support request
Status

Active

Version

3.0

Component

Code

Created by

🇦🇺Australia brettsh

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

Comments & Activities

Production build 0.71.5 2024