i18n

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package i18n exposes helpers for basic string translation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(trans map[string]map[string]string) core.Plugin

New creates an i18n plugin with the supplied translation table.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin installs basic internationalisation helpers. It exposes two JavaScript functions:

setLang(lang) - sets the active language
t(key)        - returns the translation for the given key

Translations are provided as a map of language codes to key/value pairs.

func (*Plugin) Install

func (p *Plugin) Install(a *core.App)

Install exposes translation helpers to the JavaScript environment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL