Skip to content

Commit

Permalink
builder: i18n/desktop: support setting output type
Browse files Browse the repository at this point in the history
msgfmt can produce more than just .desktop files.

Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
  • Loading branch information
metux committed Dec 11, 2023
1 parent 2c9af01 commit a81f407
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/builder/i18n/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (b I18nDesktop) JobRun() error {
inSuffix := b.RequiredEntryStr(target.KeySourceSuffix)
outSuffix := b.RequiredEntryStr(target.KeyOutputSuffix)
installdir := b.InstallDir()
typ := "--" + b.RequiredEntryStr(target.KeyI18nType)

perm := b.InstallPerm()

Expand All @@ -43,7 +44,7 @@ func (b I18nDesktop) JobRun() error {

fileutil.WriteFileLines(tmpfile, lines)

b.ExecAbort(append(b.BuilderCmd(), "--desktop", "-d", podir, "--template", tmpfile, "-o", outfile), "")
b.ExecAbort(append(b.BuilderCmd(), typ, "-d", podir, "--template", tmpfile, "-o", outfile), "")

b.InstallPkgFile(outfile, installdir, perm)
}
Expand Down
1 change: 1 addition & 0 deletions examples/conf/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ platform:
install/perm: 0664
i18n/linguas: ${i18n::linguas}
i18n/po/dir: po
i18n/type: desktop
source/suffix: .desktop.in
output/suffix: .desktop

Expand Down
1 change: 1 addition & 0 deletions spec/target/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const (
KeyI18nCategory = Key("i18n/category")
KeyI18nDomain = Key("i18n/domain")
KeyI18nPoDir = Key("i18n/po/dir")
KeyI18nType = Key("i18n/type")
)

// generators
Expand Down

0 comments on commit a81f407

Please sign in to comment.