langselector

package
v0.0.0-...-520a03a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Locale changed state: has been done
	//
	// Locale 更改状态:已经修改完成
	LocaleStateChanged = 0
	// Locale changed state: changing
	//
	// Locale 更改状态:正在修改中
	LocaleStateChanging = 1
)

Variables

View Source
var (
	// Error: not found the file
	//
	// 错误:没有此文件
	ErrFileNotExist = fmt.Errorf("File not exist")
	// Error: not found the locale
	//
	// 错误:无效的 Locale
	ErrLocaleNotFound = fmt.Errorf("Locale not found")
	// Error: changing locale failure
	//
	// 错误:修改 locale 失败
	ErrLocaleChangeFailed = fmt.Errorf("Changing locale failed")
)

Functions

func GetLocales

func GetLocales() []string

func Run

func Run()

Types

type LangSelector

type LangSelector struct {
	PropsMu sync.RWMutex
	// The current locale
	CurrentLocale string
	// Store locale changed state
	LocaleState int32
	// dbusutil-gen: equal=nil
	Locales []string
	// contains filtered or unexported fields
}

func (*LangSelector) AddLocale

func (lang *LangSelector) AddLocale(locale string) *dbus.Error

func (*LangSelector) DeleteLocale

func (lang *LangSelector) DeleteLocale(locale string) *dbus.Error

func (*LangSelector) GetExportedMethods

func (v *LangSelector) GetExportedMethods() dbusutil.ExportedMethods

func (*LangSelector) GetInterfaceName

func (*LangSelector) GetInterfaceName() string

func (*LangSelector) GetLanguageSupportPackages

func (lang *LangSelector) GetLanguageSupportPackages(locale string) (packages []string, busErr *dbus.Error)

func (*LangSelector) GetLocaleDescription

func (lang *LangSelector) GetLocaleDescription(locale string) (description string, busErr *dbus.Error)

func (*LangSelector) GetLocaleList

func (lang *LangSelector) GetLocaleList() (locales []LocaleInfo, busErr *dbus.Error)

Get locale info list that deepin supported

得到系统支持的 locale 信息列表

func (*LangSelector) Reset

func (lang *LangSelector) Reset() *dbus.Error

Reset set user desktop environment locale to system default locale

func (*LangSelector) SetLocale

func (lang *LangSelector) SetLocale(locale string) *dbus.Error

Set user desktop environment locale, the new locale will work after relogin. (Notice: this locale is only for the current user.)

设置用户会话的 locale,注销后生效,此改变只对当前用户生效。

locale: see '/etc/locale.gen'

type LocaleInfo

type LocaleInfo struct {
	// Locale name
	Locale string
	// Locale description
	Desc string
}

type LocaleInfos

type LocaleInfos []LocaleInfo

func (LocaleInfos) Get

func (infos LocaleInfos) Get(locale string) (LocaleInfo, error)

Jump to

Keyboard shortcuts

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