Documentation ¶
Overview ¶
Copyright © 2022 Runar Kristoffersen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Runar Kristoffersen ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
Copyright © 2022 Runar Kristoffersen ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Runar Kristoffersen ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2022 Runar Kristoffersen ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func BuildTranslationKeyFromApi(api Api, l logger.AppLogger, projectKeyLike, localeLike string) map[string]map[string]string
- func Execute()
- func Flatten(m map[string]interface{}) map[string]interface{}
- func FlattenExtendedProject(ep types.ExtendedProject, locales []string) (map[string]map[string]string, error)
- func GetFileAndContent(dryRun bool, fn string, fi os.FileInfo) (f *os.File, content []byte, err error)
- func PrettyPrinttFile(filepath string, content string) (string, error)
- func ReplaceAllStringSubmatchFunc(re *regexp.Regexp, str string, repl func([]string, int, int) string) string
- type Api
- func (a Api) Do(r *http.Request, j interface{}) (*http.Response, error)
- func (a Api) Export(projectName string, format string, locale string, writer io.Writer) error
- func (a Api) Import(projectName string, kind string, locale string, reader io.Reader, dryRun bool) (*http.Response, handlers.ImportResult, error)
- func (a *Api) Login(username, password string) error
- func (a *Api) NewRequest(method string, subpath string, body io.Reader) (*http.Request, error)
- func (a Api) ServerInfo() (models.ServerInfo, error)
- func (a *Api) SetToken(token string)
- type Injecter
- type ReplacementFunc
- type TokenRestriction
- type Tokenizer
- type TraverserFunc
Constants ¶
This section is empty.
Variables ¶
var (
CLI config
)
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func Flatten ¶
Flatten takes a map and returns a new one where nested maps are replaced by dot-delimited keys.
func FlattenExtendedProject ¶
func GetFileAndContent ¶
func PrettyPrinttFile ¶ added in v0.5.0
Types ¶
type Api ¶
func (Api) Do ¶ added in v0.5.3
Do a http.request. If j is not nil, it will unmarshal to that destination
func (*Api) NewRequest ¶ added in v0.5.3
NewRequest is a thin wrapper around http.NewRequest
func (Api) ServerInfo ¶ added in v0.6.0
func (a Api) ServerInfo() (models.ServerInfo, error)
type Injecter ¶
type Injecter struct { Dir string DryRun bool OnReplaceCmd string ExtensionFilter map[string]bool IgnoreFilter []string Traverser TraverserFunc Regex *regexp.Regexp ReplacementFunc ReplacementFunc // contains filtered or unexported fields }
func NewInjector ¶
type ReplacementFunc ¶
type TokenRestriction ¶ added in v0.5.0
type TokenRestriction struct { Offset int AllowedTypes []chroma.TokenType AllowedValues []string OrSet []*TokenRestriction }
func NewTokenRestriction ¶ added in v0.5.0
func NewTokenRestriction(offset int) *TokenRestriction
func (*TokenRestriction) AddType ¶ added in v0.5.0
func (t *TokenRestriction) AddType(type_ ...chroma.TokenType) *TokenRestriction
func (*TokenRestriction) AddValue ¶ added in v0.5.0
func (t *TokenRestriction) AddValue(v ...string) *TokenRestriction
func (TokenRestriction) Matches ¶ added in v0.5.0
func (t TokenRestriction) Matches(i int, tokens []chroma.Token) bool
func (*TokenRestriction) Or ¶ added in v0.5.0
func (t *TokenRestriction) Or(v ...*TokenRestriction) *TokenRestriction
type Tokenizer ¶ added in v0.5.0
type Tokenizer struct { FilePath string Lexer chroma.Config // contains filtered or unexported fields }
func TokenizeSourceFileContent ¶ added in v0.5.0
type TraverserFunc ¶ added in v0.5.0
type TraverserFunc = func(*Tokenizer)