Documentation
¶
Overview ¶
Package util provides libs for git-po-helper implementation.
Index ¶
- Constants
- Variables
- func AbbrevCommit(oid string) string
- func AnswerIsTrue(answer string) bool
- func CheckCamelCaseConfigVariableInPotFile() error
- func CheckCorePoFile(locale string) bool
- func CheckPoFile(locale, poFile string) bool
- func CheckPoFileWithPrompt(locale, poFile string, prompt string) bool
- func CheckPrereq() error
- func CheckUnfinishedPoFiles(commit string, poFiles []string) bool
- func CmdCheckCommits(args ...string) bool
- func CmdCheckPo(args ...string) bool
- func CmdInit(fileName string, onlyCore bool) bool
- func CmdUpdate(fileName string) bool
- func DiffFileRevision(src, dest FileRevision) bool
- func DiffFiles(src string, dest string) bool
- func Exist(name string) bool
- func GetPrettyLocaleName(locale string) (string, error)
- func GetUserInput(prompt, defaultValue string) string
- func IsDir(name string) bool
- func IsFile(name string) bool
- func ReportInfoAndErrors(errs []string, prompt string, ok bool)
- func ReportWarnAndErrors(errs []string, prompt string, ok bool)
- func ShowExecError(err error)
- func ShowManpageConfigs(onlyCamelCase bool) error
- func ShowTeams(args ...string) bool
- func UpdatePotFile() (string, bool)
- type CheckPoEntryFunc
- type FileRevision
- type Team
- type User
Constants ¶
const ( PoDir = "po" GitPot = "git.pot" CorePot = "git-core.pot" )
Define const variables
const (
EightSpaces = " "
)
Variables ¶
var (
PotFileURL = "https://github.com/git-l10n/pot-changes/raw/pot/master/po/git.pot"
)
Functions ¶
func AnswerIsTrue ¶
AnswerIsTrue indicates answer is a true value
func CheckCamelCaseConfigVariableInPotFile ¶ added in v0.6.2
func CheckCamelCaseConfigVariableInPotFile() error
func CheckCorePoFile ¶
CheckCorePoFile checks syntax of "po/xx.po" against "po/git-core.pot"
func CheckPoFile ¶
CheckPoFile checks syntax of "po/xx.po".
func CheckPoFileWithPrompt ¶ added in v0.3.0
CheckPoFileWithPrompt checks syntax of "po/xx.po", and use specific prompt.
func CheckUnfinishedPoFiles ¶ added in v0.5.0
func CmdCheckCommits ¶
CmdCheckCommits implements check-commits sub command.
func DiffFileRevision ¶
func DiffFileRevision(src, dest FileRevision) bool
DiffFileRevision implements diff on two files with specific revision.
func GetPrettyLocaleName ¶
GetPrettyLocaleName shows full language name and location
func GetUserInput ¶
GetUserInput reads user input from stdin
func ReportInfoAndErrors ¶ added in v0.5.0
func ReportWarnAndErrors ¶ added in v0.5.0
func ShowExecError ¶
func ShowExecError(err error)
ShowExecError will try to return error message of stderr
func ShowManpageConfigs ¶ added in v0.6.2
func UpdatePotFile ¶ added in v0.6.0
UpdatePotFile creates or update pot file. If the returned pot filename is not empty, it's caller's duty to remove it.
Types ¶
type CheckPoEntryFunc ¶ added in v0.6.2
type FileRevision ¶
FileRevision is used as an argument for diff function
type Team ¶
Team contains infomation for a l10n team.
func ParseTeams ¶
ParseTeams implements parse of "po/TEAMS" file.