Introduction
Last updated:
On this page
i18n
i18n gives JavaScript the same __(), trans() and trans_choice() functions that Laravel has, with the same arguments and the same output. It works with React, Vue, jQuery and vanilla JS.
<Forms.Text name="message" :label="__('Message')" />
- The same as Laravel. JSON and group lookups, fallbacks,
:name/:Name/:NAMEplaceholders,<tag>callbacks, and pluralization for every locale in Laravel's table. The tests compare against output from the realIlluminate\Translation\Translator. - Finds the locale itself from the page head and
<html lang>, and knows the text direction, including for Dhivehi. - Loads your existing translations: the Laravel JS Localization format (including a
window.Langalready on the page), JSON, gettext.po, XLIFF,.properties, ARB, and anything else throughregisterFormat(). - No dependencies. About 5.6 kB gzipped.
Using an AI coding assistant? See AI assistants.