Skip to content
i18n / 0

jQuery

Last updated:

import $ from "jquery"
import { installJQuery } from "@javaabu/i18n/jquery"

installJQuery($)

$.__("Message")
$.trans("Message")
$.trans_choice("messages.apples", 3)
$.i18n.setLocale("dv") // the translator

With the script tag, this happens by itself if jQuery loads first. If it loads later, call I18n.installJQuery(jQuery).

$(el).translate() translates the translation attributes in the matched elements and everything inside them:

$("#contact-form").translate()
Documentation
All packages

javaabu/i18n

Source on GitHub