Documentation ¶
Index ¶
- Constants
- Variables
- func CheckFile(fileName string) (string, string, error)
- func ConvertToTemplatedString(aString string) string
- func CopyFileContents(src, dst string) error
- func CopyI18nStringInfoMap(i18nStringInfoMap map[string]I18nStringInfo) map[string]I18nStringInfo
- func CreateI18nStringInfoMap(i18nStringInfos []I18nStringInfo) (map[string]I18nStringInfo, error)
- func CreateOutputDirsIfNeeded(outputDirname string) error
- func CreateTmpFile(content string) (*os.File, error)
- func FindFilePath(filename string) (string, error)
- func GetAbsFileInfo(fileNamePath string) (os.FileInfo, error)
- func GetTemplatedStringArgs(aString string) []string
- func ImportsForASTFile(astFile *ast.File) (*ast.GenDecl, error)
- func IsInterpolatedString(aString string) bool
- func IsTemplatedString(aString string) bool
- func ParseStringList(stringList string, delimiter string) []string
- func SaveI18nStringInfos(printer PrinterInterface, options Options, i18nStringInfos []I18nStringInfo, ...) error
- func SaveI18nStringsInPo(printer PrinterInterface, options Options, i18nStrings []I18nStringInfo, ...) error
- func SaveStrings(printer PrinterInterface, options Options, stringInfos map[string]StringInfo, ...) error
- func SaveStringsInPo(printer PrinterInterface, options Options, stringInfos map[string]StringInfo, ...) error
- func UnescapeHTML(byteArray []byte) []byte
- type ExcludedStrings
- type I18nStringInfo
- type Options
- type PrinterInterface
- type StringInfo
Constants ¶
View Source
const ( TEMPLATED_STRING_REGEXP = `\{\{\.[[:alnum:][:punct:][:print:]]+?\}\}` INTERPOLATED_STRING_REGEXP = `%(?:[#v]|[%EGUTXbcdefgopqstvx])` )
Variables ¶
View Source
var BLANKS = []string{", ", "\t", "\n", "\n\t", "\t\n"}
Functions ¶
func CopyFileContents ¶
func CopyI18nStringInfoMap ¶
func CopyI18nStringInfoMap(i18nStringInfoMap map[string]I18nStringInfo) map[string]I18nStringInfo
func CreateI18nStringInfoMap ¶
func CreateI18nStringInfoMap(i18nStringInfos []I18nStringInfo) (map[string]I18nStringInfo, error)
func FindFilePath ¶
func GetTemplatedStringArgs ¶
func IsInterpolatedString ¶
func IsTemplatedString ¶
func ParseStringList ¶
func SaveI18nStringInfos ¶
func SaveI18nStringInfos(printer PrinterInterface, options Options, i18nStringInfos []I18nStringInfo, fileName string) error
func SaveI18nStringsInPo ¶
func SaveI18nStringsInPo(printer PrinterInterface, options Options, i18nStrings []I18nStringInfo, fileName string) error
func SaveStrings ¶
func SaveStrings(printer PrinterInterface, options Options, stringInfos map[string]StringInfo, outputDirname string, fileName string) error
func SaveStringsInPo ¶
func SaveStringsInPo(printer PrinterInterface, options Options, stringInfos map[string]StringInfo, outputDirname string, fileName string) error
func UnescapeHTML ¶
Types ¶
type ExcludedStrings ¶
type I18nStringInfo ¶
type I18nStringInfo struct { ID string `json:"id"` Translation string `json:"translation"` Modified bool `json:"modified"` }
func I18nStringInfoMapValues2Array ¶
func I18nStringInfoMapValues2Array(i18nStringInfosMap map[string]I18nStringInfo) []I18nStringInfo
func LoadI18nStringInfos ¶
func LoadI18nStringInfos(fileName string) ([]I18nStringInfo, error)
type Options ¶
type Options struct { CommandFlag string HelpFlag bool LongHelpFlag bool VerboseFlag bool DryRunFlag bool PoFlag bool MetaFlag bool SourceLanguageFlag string LanguagesFlag string GoogleTranslateApiKeyFlag string OutputDirFlag string OutputMatchImportFlag bool OutputMatchPackageFlag bool OutputFlatFlag bool ExcludedFilenameFlag string SubstringFilenameFlag string FilenameFlag string DirnameFlag string RecurseFlag bool IgnoreRegexpFlag string LanguageFilesFlag string I18nStringsFilenameFlag string I18nStringsDirnameFlag string RootPathFlag string InitCodeSnippetFilenameFlag string QualifierFlag string }
type PrinterInterface ¶
Click to show internal directories.
Click to hide internal directories.