Skip to content

Commit

Permalink
Merge pull request transifex#144 from transifex/pseudo-fixes
Browse files Browse the repository at this point in the history
Pseudo flag fixes
  • Loading branch information
codegaze authored Nov 29, 2022
2 parents 23afbc7 + 8203d83 commit 4a01798
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/tx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ func Main() {
)
}

if arguments.Pseudo && arguments.Source {
return cli.Exit(errorColor(
"It doesn't make sense to use the '--pseudo' flag with the "+
"CLI in \"source pull\" mode ('--source' flag). Please use with "+
" translation files.",
), 1)
}

if arguments.Source && !arguments.Translations &&
(arguments.All || len(arguments.Languages) > 0) {
return cli.Exit(errorColor(
Expand Down
8 changes: 8 additions & 0 deletions internal/txlib/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ func (task *ResourcePullTask) Run(send func(string), abort func()) {
return
}
fileFilter := setFileTypeExtensions(args.FileType, cfgResource.FileFilter)
if args.Pseudo {
fileFilter = strings.Replace(
fileFilter,
"<lang>",
"<lang>_pseudo",
-1,
)
}
localFiles := searchFileFilter(".", fileFilter)

for localLanguageCode, filePath := range cfgResource.Overrides {
Expand Down

0 comments on commit 4a01798

Please sign in to comment.