- Issue created by @brettsh
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.
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?
Active
3.0
Code