locale

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 3 Imported by: 0

README

localization - localization support Functions for ge Text Editor

localization is a package that provides various localization functions for the ge text editor.

Features

localization support

License

This package is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(c Cell, flag CharClass) bool

Types

type BreakPolicy

type BreakPolicy interface {
	IsBreakPoint(p2, p1, c rune) bool
}

type BreakRule

type BreakRule func(p2, p1, c rune) bool

type Bullet

type Bullet struct {
	Marker []byte
	Width  int
}

type Cell

type Cell struct {
	Ch                   rune // int32
	Style                tcell.Style
	Size                 int
	Width                int // screen cell width
	Class                CharClass
	TotalWidthLogicalRow int // screen cell total width of logical row without hanging indent
	LogicalRowIndex      int
}

Cell represents a single character Cell on screen.

func (*Cell) Clear

func (c *Cell) Clear()

func (*Cell) IsEmpty

func (m *Cell) IsEmpty() bool

type CharClass

type CharClass int
const (
	OTHER CharClass = 1 << iota
	CONTROLCODE
	TAB
	NEWLINE
	DEL
	EOF
	WORD // Treat it as a set of words
	NUMBER
	ALPHABET
	PROHIBITED
	DECIMAL_SEPARATOR
	WIDECHAR // 全角文字
	UPPERCASE
	SYMBOL
	SPACE
	HIRAGANA
	KATAKANA
)

type Locale

type Locale interface {
	LocaleName() string
	DisplayName() string

	GetCharClass(r rune) CharClass
	RuneWidth(r rune) int

	Bullets() []Bullet
	BreakPolicy() BreakPolicy
	WordPolicy() WordPolicy
}

type WordPolicy

type WordPolicy interface {
	Boundary(text []byte, cursor int) (start, end int, ok bool)
}

Jump to

Keyboard shortcuts

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