Webanizr Logo
Open / sluit menu
Module translate

Last change: January 22, 2020

Current version: 1.1.4

The translate module loads a dictionary and then uses i18next to perform translations.

syntax

webanizr.collect('translate', parameters, callback);

parameters

The collect method of dragAndDrop accepts the following three parameters.

url__dictionary (required)

The url to the dictionary. The dictionary should be a key-value json list where the keys are the words and the values the translations.

callback

The function that is called when the dictionary is loaded.

syntax

webanizr.send('translate', list, parameters, callback);

callback

The function to pass the data onto after the dragging event has concluded.

list

The list of words to translate

parameters

The send method of translate accepts the following parameters

type__action (optional)

The following action types are supported:

  • translatelist: translate the list of words

  • translatedom: translate all the elements in a given dom element that have the data-wtrans attribute

id__dom (required for translatedom)

The dom id of the element in which all elements with the data-wtrans should be translated

demos

https://cdn.cpmodules.webanizr.com/demo/translations/index.html

changelog

  • January 22, 2020: 1.1.4 - Fixed loading of the i18next library
  • October 5, 2019: 1.1.2 - Mustache tags now stay intact
  • October 3, 2019: 1.1.1 - texts with dots in it are now also translated
  • October 3, 2019: 1.1.0 - added the translatedom action
  • October 3, 2019: 1.0.0 - first version