poplural

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Overview

This file is generated by poplural/generator/main.go; DO NOT EDIT

Package poplural provides support for using gettext plural forms in text.

NOTE: The following package are subject to change and are not intended primarily for official use. However, they can be helpful if you want to implement your own catalog. So use them at your own risk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	NPlurals int
	FormFunc func(n int64) int
}

func MustParse

func MustParse(rule string) *Form

func Parse

func Parse(rule string) (*Form, error)

Parse parses a plural forms header and returns a function to evaluate this header. If for a header there is already a predefined function, this function will be returned.

func (*Form) Evaluate

func (f *Form) Evaluate(a interface{}) int

type PluralFunc

type PluralFunc = func(n interface{}) int

func ForLanguage

func ForLanguage(lang language.Tag) (PluralFunc, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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