Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOrCreateMessage ¶
func GetOrCreateMessage(messages MessageMap, msgRef MessageRef, value string) po.Message
GetOrCreateMessage retrieves the message in messages at the msgRef key. If it does not exist, then it is created with the given value. If value is not empty and the original msg translation is empty, then it is updated with value.
func RegisterFunc ¶
func RegisterFunc(key string, f poUpdateFunc)
RegisterFunc registers the given method for the given key in the poMethods bundle
func RegisterRuleSet ¶
RegisterRuleSet registers the given RuleSet for the given key in the poRuleSet bundle
func UpdatePOFiles ¶
func UpdatePOFiles(config map[string]interface{})
UpdatePOFiles creates or updates PO files of the module in the given dir with the data in the Translation registry. It is meant to be called from a Po updater start file which imports all the project's module.
Types ¶
type MessageMap ¶
type MessageMap map[MessageRef]po.Message
MessageMap is a map with all po-related informations
type MessageRef ¶
type MessageRef struct { MsgId string // contains filtered or unexported fields }
A MessageRef identifies unique messages
type RuleSet ¶
RuleSet contains the rules defining the files targeted by the custom i18n-Update methods
func GetPoUpdateRuleSet ¶
GetPoUpdateRuleSet returns the rule set for an usage outside the package