New module 'Internationalization'

This commit is contained in:
Manuel Cillero 2017-07-26 13:27:55 +02:00
parent e997e7a20c
commit 003589f73e
47 changed files with 8417 additions and 0 deletions

View file

@ -0,0 +1,16 @@
/**
* Rewrite autocomplete inputs to pass the language of the node currently being
* edited in the path.
*
* This functionality ensures node autocompletes get suggestions for the node's
* language rather than the current interface language.
*/
Drupal.behaviors.i18n = function (context) {
if (Drupal.settings && Drupal.settings.i18n) {
$('form[id^=node-form]', context).find('input.autocomplete[value^=' + Drupal.settings.i18n.interface_path + ']').each(function () {
$(this).val($(this).val().replace(Drupal.settings.i18n.interface_path, Drupal.settings.i18n.content_path));
});
}
};