i18n

package
v0.0.0-...-9882097 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package i18n internationalization support for card

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

Block 卡片元素

func Card

func Card(blocks ...*LocalizedBlock) *Block

Card creates a i18n card block

func (*Block) Blue

func (b *Block) Blue() *Block

Blue 设置卡片标题栏颜色(蓝色)

func (*Block) Carmine

func (b *Block) Carmine() *Block

Carmine 设置卡片标题栏颜色(洋红色)

func (*Block) Green

func (b *Block) Green() *Block

Green 设置卡片标题栏颜色(绿色)

func (*Block) Grey

func (b *Block) Grey() *Block

Grey 设置卡片标题栏颜色(灰色)

func (*Block) Indigo

func (b *Block) Indigo() *Block

Indigo 设置卡片标题栏颜色(靛青色)

func (b *Block) Link(href *card.URLBlock) *Block

Link 设置卡片跳转链接

func (*Block) MarshalJSON

func (b *Block) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Block) NoForward

func (b *Block) NoForward() *Block

NoForward 设置后,卡片将不可转发

func (*Block) Orange

func (b *Block) Orange() *Block

Orange 设置卡片标题栏颜色(橙色)

func (*Block) Purple

func (b *Block) Purple() *Block

Purple 设置卡片标题栏颜色(紫色)

func (*Block) Red

func (b *Block) Red() *Block

Red 设置卡片标题栏颜色(红色)

func (*Block) Render

func (b *Block) Render() card.Renderer

Render 渲染为 Renderer

func (*Block) String

func (b *Block) String() string

String implements fmt.Stringer

func (*Block) Title

func (b *Block) Title(texts ...*LocalizedTextBlock) *Block

Title set title with locale

func (*Block) Turquoise

func (b *Block) Turquoise() *Block

Turquoise 设置卡片标题栏颜色(松石绿)

func (*Block) UpdateMulti

func (b *Block) UpdateMulti(updateMulti bool) *Block

UpdateMulti set card can be updated

func (*Block) Violet

func (b *Block) Violet() *Block

Violet 设置卡片标题栏颜色(紫红色)

func (*Block) Wathet

func (b *Block) Wathet() *Block

Wathet 设置卡片标题栏颜色(浅蓝色)

func (*Block) Yellow

func (b *Block) Yellow() *Block

Yellow 设置卡片标题栏颜色(黄色)

type LocalizedBlock

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

LocalizedBlock .

func WithLocale

func WithLocale(locale string, elements ...card.Element) *LocalizedBlock

WithLocale creates a block with locale

func (*LocalizedBlock) Render

func (lb *LocalizedBlock) Render() card.Renderer

Render .

type LocalizedTextBlock

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

LocalizedTextBlock contains text with locale

func LocalizedText

func LocalizedText(locale, text string) *LocalizedTextBlock

LocalizedText .

type TextBlock

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

TextBlock contains LocalizedTextBlock and render it to I18N

func Text

func Text(texts ...*LocalizedTextBlock) *TextBlock

Text .

func (*TextBlock) Render

func (t *TextBlock) Render() card.Renderer

Render .

Jump to

Keyboard shortcuts

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