comparelocalization

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package comparelocalization 提供 OFD 对比报告使用的本地化消息。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalLanguage added in v0.2.5

func CanonicalLanguage(value string) string

CanonicalLanguage 保留对比工具支持的繁体中文,其他语言沿用共用回退规则。

func Diagnostic added in v0.2.5

func Diagnostic(locale, text string) string

Diagnostic 仅翻译引擎自带的说明,未知诊断和底层错误原样保留。 调用方只用于诊断字段,不能用于文档文字、路径或 XML 内容。

func RegisterDesktop added in v0.2.5

func RegisterDesktop()

RegisterDesktop 将共用目录注册为桌面的语言来源,命令行报告无需注册。

func ScriptMessages added in v0.2.5

func ScriptMessages(locale string) map[string]string

ScriptMessages 只导出离线交互需要的简单占位消息,不包含文档数据或桌面状态。

func Text added in v0.2.5

func Text(locale, id string, args ...any) string

Text 用显式语言格式化消息;桌面与离线报告共用目录,不读取窗口状态。

Types

type Localizer

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

func New

func New(languageTag string) (*Localizer, error)

func (*Localizer) Language

func (l *Localizer) Language() string

func (*Localizer) Message

func (l *Localizer) Message(id string, data any) string

Jump to

Keyboard shortcuts

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