فهرست منبع

fix(locale): make install with locale

jguer 4 سال پیش
والد
کامیت
0c45a390a2
9فایلهای تغییر یافته به همراه740 افزوده شده و 111 حذف شده
  1. 1 0
      .gitignore
  2. 12 9
      Makefile
  3. 2 2
      config.go
  4. 0 1
      main.go
  5. 1 1
      pkg/completion/completion.go
  6. 1 1
      pkg/text/print.go
  7. 640 0
      po/en.po
  8. 82 96
      po/pt.po
  9. 1 1
      upgrade.go

+ 1 - 0
.gitignore

@@ -25,3 +25,4 @@ qemu-*
 # Locale
 *.mo
 *.pot
+*.po~

+ 12 - 9
Makefile

@@ -16,20 +16,20 @@ PATCHVERSION := 7
 VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION}
 
 LOCALEDIR := po
-SYSTEMLOCALEPATH := $(DESTDIR)$(PREFIX)/share/locale
+SYSTEMLOCALEPATH := $(DESTDIR)$(PREFIX)/share/locale/
 
-LANGS := pt
-POTFILE := ${PKGNAME}.po
+LANGS := pt en
+POTFILE := default.pot
 POFILES := $(addprefix $(LOCALEDIR)/,$(addsuffix .po,$(LANGS)))
 MOFILES := $(POFILES:.po=.mo)
 
 GOFLAGS := -v -mod=mod
 EXTRA_GOFLAGS ?=
-LDFLAGS := $(LDFLAGS) -X "main.yayVersion=${VERSION} -X main.localePath=${SYSTEMLOCALEPATH}"
+LDFLAGS := $(LDFLAGS) -X "main.yayVersion=${VERSION}" -X "main.localePath=${SYSTEMLOCALEPATH}"
 
 RELEASE_DIR := ${PKGNAME}_${VERSION}_${ARCH}
 PACKAGE := $(RELEASE_DIR).tar.gz
-SOURCES ?= $(shell find . -name "*.go" -type f ! -path "./vendor/*")
+SOURCES ?= $(shell find . -name "*.go" -type f)
 
 .PRECIOUS: ${LOCALEDIR}/%.po
 
@@ -106,8 +106,7 @@ lint:
 
 .PHONY: fmt
 fmt:
-	#go fmt -mod=vendor $(GOFILES) ./... Doesn't work yet but will be supported soon
-	gofmt -s -w $(SOURCES)
+	go fmt ./...
 
 .PHONY: install
 install: build ${MOFILES}
@@ -116,6 +115,9 @@ install: build ${MOFILES}
 	install -Dm644 completions/bash $(DESTDIR)$(PREFIX)/share/bash-completion/completions/${PKGNAME}
 	install -Dm644 completions/zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_${PKGNAME}
 	install -Dm644 completions/fish $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/${PKGNAME}.fish
+	for lang in ${LANGS}; do \
+		install -Dm644 ${LOCALEDIR}/$${lang}.mo $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/${PKGNAME}.mo; \
+	done
 
 .PHONY: uninstall
 uninstall:
@@ -140,8 +142,9 @@ $(PACKAGE): $(BIN) $(RELEASE_DIR)
 
 locale: ${MOFILES}
 
-${LOCALEDIR}/${POTFILE}: ${GOFILES}
-	xgettext --from-code=UTF-8 -Lc -sc -d ${PKGNAME} -kGet -o locale/${PKGNAME}.pot ${GOFILES}
+${LOCALEDIR}/${POTFILE}: ${SOURCES}
+	xgotext -in . -out po
+	# xgettext --from-code=UTF-8 -Lc -sc -d ${PKGNAME} -kGet -o ${LOCALEDIR}/${PKGNAME}.pot ${SOURCES}
 
 ${LOCALEDIR}/%.po: ${LOCALEDIR}/${POTFILE}
 	test -f $@ || msginit -l $* -i $< -o $@

+ 2 - 2
config.go

@@ -86,6 +86,8 @@ type Configuration struct {
 
 var yayVersion = "9.4.3"
 
+var localePath = "/usr/share/locale"
+
 // configFileName holds the name of the config file.
 const configFileName string = "config.json"
 
@@ -127,8 +129,6 @@ var mode = modeAny
 
 var hideMenus = false
 
-var localePath = "/usr/share/locale"
-
 // SaveConfig writes yay config to file.
 func (config *Configuration) saveConfig() error {
 	marshalledinfo, err := json.MarshalIndent(config, "", "\t")

+ 0 - 1
main.go

@@ -43,7 +43,6 @@ func initGotext() {
 		localePath = envLocalePath
 	}
 
-	// fmt.Printf("path: %s Lang: %s", localePath, os.Getenv("LANG"))
 	gotext.Configure(localePath, os.Getenv("LANG"), "yay")
 }
 

+ 1 - 1
pkg/completion/completion.go

@@ -59,7 +59,7 @@ func Update(alpmHandle *alpm.Handle, aurURL, cacheDir string, interval int, forc
 
 // CreateAURList creates a new completion file
 func createAURList(aurURL string, out io.Writer) error {
-	resp, err := http.Get(aurURL + "/packages.gz")
+	resp, err := http.Get(filepath.Join(aurURL, "/packages.gz"))
 	if err != nil {
 		return err
 	}

+ 1 - 1
pkg/text/print.go

@@ -50,5 +50,5 @@ func PrintInfoValue(str, value string) {
 		value = gotext.Get("None")
 	}
 
-	fmt.Fprintln(os.Stdout, bold("%-16s%s")+" %s\n", str, ":", value)
+	fmt.Fprintf(os.Stdout, bold("%-16s%s")+" %s\n", str, ":", value)
 }

+ 640 - 0
po/en.po

@@ -0,0 +1,640 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2020-05-30 00:37+0200\n"
+"Last-Translator:  <me@jguer.space>\n"
+"Language-Team: English\n"
+"Language: en\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: xgotext\n"
+
+#: install.go:561
+msgid " (Build Files Exist)"
+msgstr " (Build Files Exist)"
+
+#: install.go:557
+msgid " (Installed)"
+msgstr " (Installed)"
+
+#: depCheck.go:279
+msgid " (Target"
+msgstr " (Target"
+
+#: depCheck.go:281
+msgid " (Wanted by: "
+msgstr " (Wanted by: "
+
+#: callbacks.go:72
+msgid " Input too long"
+msgstr " Input too long"
+
+#: cmd.go:442
+msgid " [Installed]"
+msgstr " [Installed]"
+
+#: cmd.go:398 install.go:164 install.go:198
+msgid " there is nothing to do"
+msgstr " there is nothing to do"
+
+#: depCheck.go:170
+msgid "%s Installing %s will remove:"
+msgstr "%s Installing %s will remove:"
+
+#: install.go:581 install.go:656 install.go:663
+msgid "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
+msgstr "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
+
+#: download.go:273
+msgid "%s already downloaded -- use -f to overwrite"
+msgstr "%s already downloaded -- use -f to overwrite"
+
+#: install.go:1084
+msgid "%s already made -- skipping build"
+msgstr "%s already made -- skipping build"
+
+#: main.go:24 main.go:32
+msgid "%s and %s unset"
+msgstr "%s and %s unset"
+
+#: config.go:263
+msgid "%s is not set"
+msgstr "%s is not set"
+
+#: exec.go:70
+msgid "%s is present."
+msgstr "%s is present."
+
+#: install.go:1073
+msgid "%s is up to date -- skipping"
+msgstr "%s is up to date -- skipping"
+
+#: install.go:1006
+msgid "%s not satisfied, flushing install queue"
+msgstr "%s not satisfied, flushing install queue"
+
+#: install.go:750
+msgid "%s: No changes -- skipping"
+msgstr "%s: No changes -- skipping"
+
+#: utils.go:47
+msgid "%s: can't use target with option --aur -- skipping"
+msgstr "%s: can't use target with option --aur -- skipping"
+
+#: utils.go:42
+msgid "%s: can't use target with option --repo -- skipping"
+msgstr "%s: can't use target with option --repo -- skipping"
+
+#: upgrade.go:272
+msgid "%s: ignoring package upgrade (%s => %s)"
+msgstr "%s: ignoring package upgrade (%s => %s)"
+
+#: upgrade.go:289
+msgid "%s: local (%s) is newer than AUR (%s)"
+msgstr "%s: local (%s) is newer than AUR (%s)"
+
+#: download.go:298
+msgid "(%d/%d) Downloaded PKGBUILD from ABS: %s"
+msgstr "(%d/%d) Downloaded PKGBUILD from ABS: %s"
+
+#: install.go:803
+msgid "(%d/%d) Parsing SRCINFO: %s"
+msgstr "(%d/%d) Parsing SRCINFO: %s"
+
+#: print.go:102 print.go:143
+msgid "(Installed)"
+msgstr "(Installed)"
+
+#: print.go:100 print.go:141
+msgid "(Installed: %s)"
+msgstr "(Installed: %s)"
+
+#: print.go:91
+msgid "(Orphaned)"
+msgstr "(Orphaned)"
+
+#: print.go:95
+msgid "(Out-of-date: %s)"
+msgstr "(Out-of-date: %s)"
+
+#: print.go:291
+msgid "AUR URL"
+msgstr "AUR URL"
+
+#: config.go:264
+msgid "Add %s or %s to your environment variables"
+msgstr "Add %s or %s to your environment variables"
+
+#: main.go:225
+msgid "Avoid running yay as root/sudo."
+msgstr "Avoid running yay as root/sudo."
+
+#: print.go:297
+msgid "Check Deps"
+msgstr "Check Deps"
+
+#: upgrade.go:165
+msgid "Checking development packages..."
+msgstr "Checking development packages..."
+
+#: depCheck.go:137
+msgid "Checking for conflicts..."
+msgstr "Checking for conflicts..."
+
+#: depCheck.go:144
+msgid "Checking for inner conflicts..."
+msgstr "Checking for inner conflicts..."
+
+#: clean.go:213
+msgid "Cleaning (%d/%d): %s"
+msgstr "Cleaning (%d/%d): %s"
+
+#: depCheck.go:196
+msgid "Conflicting packages will have to be confirmed manually"
+msgstr "Conflicting packages will have to be confirmed manually"
+
+#: print.go:299
+msgid "Conflicts With"
+msgstr "Conflicts With"
+
+#: depCheck.go:273
+msgid "Could not find all required packages:"
+msgstr "Could not find all required packages:"
+
+#: clean.go:229
+msgid "Deleting (%d/%d): %s"
+msgstr "Deleting (%d/%d): %s"
+
+#: print.go:295
+msgid "Depends On"
+msgstr "Depends On"
+
+#: print.go:289
+msgid "Description"
+msgstr "Description"
+
+#: install.go:655
+msgid "Diffs to show?"
+msgstr "Diffs to show?"
+
+#: clean.go:89
+msgid "Do you want to remove ALL AUR packages from cache?"
+msgstr "Do you want to remove ALL AUR packages from cache?"
+
+#: clean.go:106
+msgid "Do you want to remove ALL untracked AUR files?"
+msgstr "Do you want to remove ALL untracked AUR files?"
+
+#: clean.go:91
+msgid "Do you want to remove all other AUR packages from cache?"
+msgstr "Do you want to remove all other AUR packages from cache?"
+
+#: install.go:891
+msgid "Downloaded PKGBUILD (%d/%d): %s"
+msgstr "Downloaded PKGBUILD (%d/%d): %s"
+
+#: config.go:267
+msgid "Edit PKGBUILD with?"
+msgstr "Edit PKGBUILD with?"
+
+#: cmd.go:342
+msgid "Error during AUR search: %s\n"
+msgstr "Error during AUR search: %s\n"
+
+#: print.go:358
+msgid "Explicitly installed packages: %s"
+msgstr "Explicitly installed packages: %s"
+
+#: print.go:303
+msgid "First Submitted"
+msgstr "First Submitted"
+
+#: print.go:44
+msgid "Flagged Out Of Date AUR Packages:"
+msgstr "Flagged Out Of Date AUR Packages:"
+
+#: vcs.go:146
+msgid "Found git repo: %s"
+msgstr "Found git repo: %s"
+
+#: vcs.go:63
+msgid "GenDB finished. No packages were installed"
+msgstr "GenDB finished. No packages were installed"
+
+#: print.go:292
+msgid "Groups"
+msgstr "Groups"
+
+#: keys.go:84
+msgid "Import?"
+msgstr "Import?"
+
+#: keys.go:97
+msgid "Importing keys with gpg..."
+msgstr "Importing keys with gpg..."
+
+#: print.go:287
+msgid "Keywords"
+msgstr "Keywords"
+
+#: print.go:304
+msgid "Last Modified"
+msgstr "Last Modified"
+
+#: print.go:293
+msgid "Licenses"
+msgstr "Licenses"
+
+#: print.go:300
+msgid "Maintainer"
+msgstr "Maintainer"
+
+#: print.go:296
+msgid "Make Deps"
+msgstr "Make Deps"
+
+#: download.go:281
+msgid "Missing ABS packages:"
+msgstr "Missing ABS packages:"
+
+#: print.go:28
+msgid "Missing AUR Packages:"
+msgstr "Missing AUR Packages:"
+
+#: print.go:286
+msgid "Name"
+msgstr "Name"
+
+#: pkg/text/print.go:50
+msgid "None"
+msgstr "None"
+
+#: print.go:298
+msgid "Optional Deps"
+msgstr "Optional Deps"
+
+#: print.go:36
+msgid "Orphaned AUR Packages:"
+msgstr "Orphaned AUR Packages:"
+
+#: print.go:307 print.go:309
+msgid "Out-of-date"
+msgstr "Out-of-date"
+
+#: keys.go:115
+msgid "PGP keys need importing:"
+msgstr "PGP keys need importing:"
+
+#: install.go:872
+msgid "PKGBUILD up to date, Skipping (%d/%d): %s"
+msgstr "PKGBUILD up to date, Skipping (%d/%d): %s"
+
+#: install.go:662
+msgid "PKGBUILDs to edit?"
+msgstr "PKGBUILDs to edit?"
+
+#: print.go:314
+msgid "Package Base ID"
+msgstr "Package Base ID"
+
+#: print.go:315
+msgid "Package Base"
+msgstr "Package Base"
+
+#: install.go:580
+msgid "Packages to cleanBuild?"
+msgstr "Packages to cleanBuild?"
+
+#: upgrade.go:363
+msgid "Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
+msgstr "Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
+
+#: cmd.go:346
+msgid "Packages to install (eg: 1 2 3, 1-3 or ^4)"
+msgstr "Packages to install (eg: 1 2 3, 1-3 or ^4)"
+
+#: upgrade.go:360
+msgid "Packages to upgrade."
+msgstr "Packages to upgrade."
+
+#: print.go:302
+msgid "Popularity"
+msgstr "Popularity"
+
+#: install.go:267 install.go:307
+msgid "Proceed with install?"
+msgstr "Proceed with install?"
+
+#: print.go:294
+msgid "Provides"
+msgstr "Provides"
+
+#: query.go:568
+msgid "Querying AUR..."
+msgstr "Querying AUR..."
+
+#: install.go:219
+msgid "Remove make dependencies after install?"
+msgstr "Remove make dependencies after install?"
+
+#: callbacks.go:46
+msgid "Repository "
+msgstr "Repository "
+
+#: print.go:618
+msgid "Repository AUR"
+msgstr "Repository AUR"
+
+#: print.go:285
+msgid "Repository"
+msgstr "Repository"
+
+#: upgrade.go:148
+msgid "Searching AUR for updates..."
+msgstr "Searching AUR for updates..."
+
+#: upgrade.go:138
+msgid "Searching databases for updates..."
+msgstr "Searching databases for updates..."
+
+#: cmd.go:343 query.go:235
+msgid "Showing repo packages only"
+msgstr "Showing repo packages only"
+
+#: print.go:316
+msgid "Snapshot URL"
+msgstr "Snapshot URL"
+
+#: print.go:361
+msgid "Ten biggest packages:"
+msgstr "Ten biggest packages:"
+
+#: install.go:479
+msgid "The following packages are not compatible with your architecture:"
+msgstr "The following packages are not compatible with your architecture:"
+
+#: callbacks.go:36 print.go:615
+msgid "There are %d providers available for %s:"
+msgstr "There are %d providers available for %s:"
+
+#: exec.go:71
+msgid "There may be another Pacman instance running. Waiting..."
+msgstr "There may be another Pacman instance running. Waiting..."
+
+#: print.go:359
+msgid "Total Size occupied by packages: %s"
+msgstr "Total Size occupied by packages: %s"
+
+#: print.go:357
+msgid "Total foreign installed packages: %s"
+msgstr "Total foreign installed packages: %s"
+
+#: print.go:356
+msgid "Total installed packages: %s"
+msgstr "Total installed packages: %s"
+
+#: install.go:486
+msgid "Try to build them anyway?"
+msgstr "Try to build them anyway?"
+
+#: print.go:290
+msgid "URL"
+msgstr "URL"
+
+#: print.go:288
+msgid "Version"
+msgstr "Version"
+
+#: print.go:301
+msgid "Votes"
+msgstr "Votes"
+
+#: print.go:354
+msgid "Yay version v%s"
+msgstr "Yay version v%s"
+
+#: install.go:581 install.go:656 install.go:663
+msgid "[N]one"
+msgstr "[N]one"
+
+#: keys.go:122
+msgid ""
+"\n"
+"%s %s, required by: %s"
+msgstr ""
+"\n"
+"%s %s, required by: %s"
+
+#: clean.go:94
+msgid ""
+"\n"
+"Build directory:"
+msgstr ""
+"\n"
+"Build directory:"
+
+#: callbacks.go:56 print.go:628
+msgid ""
+"\n"
+"Enter a number (default=1): "
+msgstr ""
+"\n"
+"Enter a number (default=1): "
+
+#: depCheck.go:153
+msgid ""
+"\n"
+"Inner conflicts found:"
+msgstr ""
+"\n"
+"Inner conflicts found:"
+
+#: depCheck.go:167
+msgid ""
+"\n"
+"Package conflicts found:"
+msgstr ""
+"\n"
+"Package conflicts found:"
+
+#: install.go:268 install.go:308 install.go:487 install.go:591 install.go:674
+msgid "aborting due to user"
+msgstr "aborting due to user"
+
+#: install.go:513
+msgid "cannot find package name: %v"
+msgstr "cannot find package name: %v"
+
+#: install.go:1046 install.go:1118
+msgid "could not find PKGDEST for: %s"
+msgstr "could not find PKGDEST for: %s"
+
+#: install.go:790
+msgid "editor did not exit successfully, aborting: %s"
+msgstr "editor did not exit successfully, aborting: %s"
+
+#: download.go:84 download.go:109
+msgid "error cloning %s: %s"
+msgstr "error cloning %s: %s"
+
+#: install.go:922
+msgid "error downloading sources: %s"
+msgstr "error downloading sources: %s"
+
+#: query.go:234
+msgid "error during AUR search: %s"
+msgstr "error during AUR search: %s"
+
+#: download.go:96 download.go:121
+msgid "error fetching %s: %s"
+msgstr "error fetching %s: %s"
+
+#: install.go:331 install.go:440
+msgid "error installing repo packages"
+msgstr "error installing repo packages"
+
+#: install.go:1030 install.go:1070 install.go:1081 install.go:1093
+msgid "error making: %s"
+msgstr "error making: %s"
+
+#: download.go:135
+msgid "error merging %s: %s"
+msgstr "error merging %s: %s"
+
+#: download.go:89 download.go:114
+msgid "error reading %s"
+msgstr "error reading %s"
+
+#: install.go:73
+msgid "error refreshing databases"
+msgstr "error refreshing databases"
+
+#: clean.go:217 download.go:130
+msgid "error resetting %s: %s"
+msgstr "error resetting %s: %s"
+
+#: main.go:111
+msgid "failed to create BuildDir directory '%s': %s"
+msgstr "failed to create BuildDir directory '%s': %s"
+
+#: main.go:99
+msgid "failed to create cache directory '%s': %s"
+msgstr "failed to create cache directory '%s': %s"
+
+#: main.go:91
+msgid "failed to create config directory '%s': %s"
+msgstr "failed to create config directory '%s': %s"
+
+#: download.go:288
+msgid "failed to get pkgbuild: %s: %s"
+msgstr "failed to get pkgbuild: %s: %s"
+
+#: download.go:296
+msgid "failed to link %s: %s"
+msgstr "failed to link %s: %s"
+
+#: main.go:52
+msgid "failed to open config file '%s': %s"
+msgstr "failed to open config file '%s': %s"
+
+#: main.go:74
+msgid "failed to open vcs file '%s': %s"
+msgstr "failed to open vcs file '%s': %s"
+
+#: install.go:808
+msgid "failed to parse %s -- skipping: %s"
+msgstr "failed to parse %s -- skipping: %s"
+
+#: install.go:811
+msgid "failed to parse %s: %s"
+msgstr "failed to parse %s: %s"
+
+#: main.go:59
+msgid "failed to read config file '%s': %s"
+msgstr "failed to read config file '%s': %s"
+
+#: main.go:81
+msgid "failed to read vcs file '%s': %s"
+msgstr "failed to read vcs file '%s': %s"
+
+#: cmd.go:356 config.go:334 print.go:644
+msgid "input too long"
+msgstr "input too long"
+
+#: callbacks.go:82 print.go:654
+msgid "invalid number: %s"
+msgstr "invalid number: %s"
+
+#: parser.go:146
+msgid "invalid option '%s'"
+msgstr "invalid option '%s'"
+
+#: cmd.go:338 cmd.go:372 cmd.go:389 print.go:78 print.go:121 query.go:230
+msgid "invalid sort mode. Fix with yay -Y --bottomup --save"
+msgstr "invalid sort mode. Fix with yay -Y --bottomup --save"
+
+#: callbacks.go:87 print.go:659
+msgid "invalid value: %d is not between %d and %d"
+msgstr "invalid value: %d is not between %d and %d"
+
+#: keys.go:110
+msgid "no keys to import"
+msgstr "no keys to import"
+
+#: cmd.go:319
+msgid "no packages match search"
+msgstr "no packages match search"
+
+#: config.go:299
+msgid "no"
+msgstr "no"
+
+#: parser.go:136
+msgid "only one operation may be used at a time"
+msgstr "only one operation may be used at a time"
+
+#: print.go:446
+msgid "package '%s' was not found"
+msgstr "package '%s' was not found"
+
+#: depCheck.go:193
+msgid "package conflicts can not be resolved with noconfirm, aborting"
+msgstr "package conflicts can not be resolved with noconfirm, aborting"
+
+#: keys.go:101
+msgid "problem importing keys"
+msgstr "problem importing keys"
+
+#: install.go:176
+msgid "refusing to install AUR packages as root, aborting"
+msgstr "refusing to install AUR packages as root, aborting"
+
+#: clean.go:114
+msgid "removing AUR packages from cache..."
+msgstr "removing AUR packages from cache..."
+
+#: clean.go:186 clean.go:208
+msgid "removing untracked AUR files from cache..."
+msgstr "removing untracked AUR files from cache..."
+
+#: install.go:1127
+msgid "the PKGDEST for %s is listed by makepkg but does not exist: %s"
+msgstr "the PKGDEST for %s is listed by makepkg but does not exist: %s"
+
+#: main.go:189
+msgid "unable to CreateHandle: %s"
+msgstr "unable to CreateHandle: %s"
+
+#: cmd.go:175
+msgid "unhandled operation"
+msgstr "unhandled operation"
+
+#: cmd.go:439
+msgid "unknown-version"
+msgstr "unknown-version"
+
+#: config.go:298
+msgid "yes"
+msgstr "yes"

+ 82 - 96
po/pt.po

@@ -1,13 +1,12 @@
 # Translators:
 # Jguer <>, 2020
-
 msgid ""
 msgstr ""
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
 "X-Generator: xgotext\n"
 
 #: install.go:561
@@ -34,8 +33,7 @@ msgstr " Input demasiado longo"
 msgid " [Installed]"
 msgstr " [Instalado]"
 
-#: install.go:164
-#: install.go:198
+#: cmd.go:398 install.go:164 install.go:198
 msgid " there is nothing to do"
 msgstr " não há nada a fazer"
 
@@ -43,11 +41,10 @@ msgstr " não há nada a fazer"
 msgid "%s Installing %s will remove:"
 msgstr "%s Instalar %s irá remover:"
 
-#: install.go:581
-#: install.go:656
-#: install.go:663
+#: install.go:581 install.go:656 install.go:663
 msgid "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
-msgstr "%s [A]Todos [Ab]ortar [I]nstalado [No]Não instalado or (1 2 3, 1-3, ^4)"
+msgstr ""
+"%s [A]Todos [Ab]ortar [I]nstalado [No]Não instalado or (1 2 3, 1-3, ^4)"
 
 #: download.go:273
 msgid "%s already downloaded -- use -f to overwrite"
@@ -57,6 +54,11 @@ msgstr "%s já descarregado -- utilize -f para forçar"
 msgid "%s already made -- skipping build"
 msgstr "%s já feito -- saltando compilação"
 
+#: main.go:24 main.go:32
+#, fuzzy
+msgid "%s and %s unset"
+msgstr "%s e %s não definidos"
+
 #: config.go:263
 msgid "%s is not set"
 msgstr "%s não está definido"
@@ -83,7 +85,8 @@ msgstr "%s: não é possível utilizar a opção --aur com este pacote -- ignora
 
 #: utils.go:42
 msgid "%s: can't use target with option --repo -- skipping"
-msgstr "%s: não é possível utilizar a opção --repo com este pacote -- ignorando"
+msgstr ""
+"%s: não é possível utilizar a opção --repo com este pacote -- ignorando"
 
 #: upgrade.go:272
 msgid "%s: ignoring package upgrade (%s => %s)"
@@ -101,16 +104,11 @@ msgstr "(%d/%d) PKGBUILD ABS descarregado: %s"
 msgid "(%d/%d) Parsing SRCINFO: %s"
 msgstr "(%d/%d) Analisando SRCINFO: %s"
 
-#: print.go:102
-#: print.go:143
+#: print.go:102 print.go:143
 msgid "(Installed)"
 msgstr "(Instalado)"
 
-#: print.go:100
-msgid "(Installed: %s)"
-msgstr "(Instalado: %s)"
-
-#: print.go:141
+#: print.go:100 print.go:141
 msgid "(Installed: %s)"
 msgstr "(Instalado: %s)"
 
@@ -130,7 +128,7 @@ msgstr "URL AUR"
 msgid "Add %s or %s to your environment variables"
 msgstr "Adicione %s ou %s às suas variáveis de ambiente"
 
-#: main.go:221
+#: main.go:225
 msgid "Avoid running yay as root/sudo."
 msgstr "Evite executar yay como root/sudo."
 
@@ -238,7 +236,6 @@ msgstr "Importar?"
 msgid "Importing keys with gpg..."
 msgstr "Importando chaves com gpg..."
 
-
 #: print.go:287
 msgid "Keywords"
 msgstr "Palavras Chave"
@@ -271,6 +268,10 @@ msgstr "Pacotes AUR em falta:"
 msgid "Name"
 msgstr "Nome"
 
+#: pkg/text/print.go:50
+msgid "None"
+msgstr "Nenhum"
+
 #: print.go:298
 msgid "Optional Deps"
 msgstr "Dependências opcionais"
@@ -279,8 +280,7 @@ msgstr "Dependências opcionais"
 msgid "Orphaned AUR Packages:"
 msgstr "Pacotes AUR Orfãos:"
 
-#: print.go:307
-#: print.go:309
+#: print.go:307 print.go:309
 msgid "Out-of-date"
 msgstr "Desatualizado"
 
@@ -316,12 +316,15 @@ msgstr "Pacotes a excluir:  (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
 msgid "Packages to install (eg: 1 2 3, 1-3 or ^4)"
 msgstr "Pacotes a instalar (eg: 1 2 3, 1-3 or ^4) "
 
+#: upgrade.go:360
+msgid "Packages to upgrade."
+msgstr "Pacotes a atualizar."
+
 #: print.go:302
 msgid "Popularity"
 msgstr "Popularidade"
 
-#: install.go:267
-#: install.go:307
+#: install.go:267 install.go:307
 msgid "Proceed with install?"
 msgstr "Proceder com a instalação"
 
@@ -357,8 +360,7 @@ msgstr "A procurar atualizações na AUR..."
 msgid "Searching databases for updates..."
 msgstr "A procurar atualizações nos repositórios..."
 
-#: cmd.go:343
-#: query.go:235
+#: cmd.go:343 query.go:235
 msgid "Showing repo packages only"
 msgstr "Mostrando apenas pacotes de repositório"
 
@@ -374,8 +376,7 @@ msgstr "Dez maiores pacotes:"
 msgid "The following packages are not compatible with your architecture:"
 msgstr "Os seguintes pacotes não são compatíveis com a sua arquitetura:"
 
-#: callbacks.go:36
-#: print.go:615
+#: callbacks.go:36 print.go:615
 msgid "There are %d providers available for %s:"
 msgstr "Existem %d pacotes que fornecem %s:"
 
@@ -411,48 +412,55 @@ msgstr "Versão"
 msgid "Votes"
 msgstr "Votos"
 
-#: main.go:32
-#: main.go:24
-msgid "%s and % unset"
-msgstr "%s e %s não definidos"
-
-
 #: print.go:354
 msgid "Yay version v%s"
 msgstr "Yay versão v%s"
 
-#: install.go:581
-#: install.go:656
-#: install.go:663
+#: install.go:581 install.go:656 install.go:663
 msgid "[N]one"
 msgstr "[N]enhum"
 
 #: keys.go:122
-msgid "\n%s %s, required by: %s"
-msgstr "\n%s %s, necessário para: %s"
+msgid ""
+"\n"
+"%s %s, required by: %s"
+msgstr ""
+"\n"
+"%s %s, necessário para: %s"
 
 #: clean.go:94
-msgid "\nBuild directory:"
-msgstr "\nDiretório de compilação:"
+msgid ""
+"\n"
+"Build directory:"
+msgstr ""
+"\n"
+"Diretório de compilação:"
 
-#: callbacks.go:56
-#: print.go:628
-msgid "\nEnter a number (default=1): "
-msgstr "\nIntroduza um número (por defeito=1):"
+#: callbacks.go:56 print.go:628
+msgid ""
+"\n"
+"Enter a number (default=1): "
+msgstr ""
+"\n"
+"Introduza um número (por defeito=1):"
 
 #: depCheck.go:153
-msgid "\nInner conflicts found:"
-msgstr "\nConflitos internos encontrados:"
+msgid ""
+"\n"
+"Inner conflicts found:"
+msgstr ""
+"\n"
+"Conflitos internos encontrados:"
 
 #: depCheck.go:167
-msgid "\nPackage conflicts found:"
-msgstr "\nConflitos de pacotes encontrados:"
-
-#: install.go:268
-#: install.go:308
-#: install.go:487
-#: install.go:591
-#: install.go:674
+msgid ""
+"\n"
+"Package conflicts found:"
+msgstr ""
+"\n"
+"Conflitos de pacotes encontrados:"
+
+#: install.go:268 install.go:308 install.go:487 install.go:591 install.go:674
 msgid "aborting due to user"
 msgstr "Abortando por opção do utilizador"
 
@@ -460,8 +468,7 @@ msgstr "Abortando por opção do utilizador"
 msgid "cannot find package name: %v"
 msgstr "nome de pacote não encontrado: %v"
 
-#: install.go:1046
-#: install.go:1118
+#: install.go:1046 install.go:1118
 msgid "could not find PKGDEST for: %s"
 msgstr "não encontrado PKGDEST para: %s"
 
@@ -469,8 +476,7 @@ msgstr "não encontrado PKGDEST para: %s"
 msgid "editor did not exit successfully, aborting: %s"
 msgstr "editor não terminou com sucesso, abortando: %s"
 
-#: download.go:84
-#: download.go:109
+#: download.go:84 download.go:109
 msgid "error cloning %s: %s"
 msgstr "erro clonando %s: %s"
 
@@ -482,20 +488,15 @@ msgstr "erro ao descarregar fontes: %s"
 msgid "error during AUR search: %s"
 msgstr "erro durante pesquisa AUR: %s"
 
-#: download.go:96
-#: download.go:121
+#: download.go:96 download.go:121
 msgid "error fetching %s: %s"
 msgstr "erro ao descarregar %s: %s"
 
-#: install.go:331
-#: install.go:440
+#: install.go:331 install.go:440
 msgid "error installing repo packages"
 msgstr "erro ao instalar pacotes de repositório"
 
-#: install.go:1030
-#: install.go:1070
-#: install.go:1081
-#: install.go:1093
+#: install.go:1030 install.go:1070 install.go:1081 install.go:1093
 msgid "error making: %s"
 msgstr "erro compilando: %s"
 
@@ -503,8 +504,7 @@ msgstr "erro compilando: %s"
 msgid "error merging %s: %s"
 msgstr "erro merging %s: %s"
 
-#: download.go:89
-#: download.go:114
+#: download.go:89 download.go:114
 msgid "error reading %s"
 msgstr "erro lendo %s"
 
@@ -512,20 +512,19 @@ msgstr "erro lendo %s"
 msgid "error refreshing databases"
 msgstr "erro refrescando base de dados"
 
-#: clean.go:217
-#: download.go:130
+#: clean.go:217 download.go:130
 msgid "error resetting %s: %s"
 msgstr "erro ao fazer o reset a %s: %s"
 
-#: main.go:107
+#: main.go:111
 msgid "failed to create BuildDir directory '%s': %s"
 msgstr "falha ao crear pasta BuildDir: '%s': %s"
 
-#: main.go:95
+#: main.go:99
 msgid "failed to create cache directory '%s': %s"
 msgstr "falha ao crear pasta de cache '%s': %s"
 
-#: main.go:87
+#: main.go:91
 msgid "failed to create config directory '%s': %s"
 msgstr "falha ao crear pasta de configuração '%s': %s"
 
@@ -537,11 +536,11 @@ msgstr "falha ao obter PKGBUILD: %s: %s"
 msgid "failed to link %s: %s"
 msgstr "falha ao criar symlink %s: %s"
 
-#: main.go:48
+#: main.go:52
 msgid "failed to open config file '%s': %s"
 msgstr "falha ao abrir ficheiro de configuração '%s': %s"
 
-#: main.go:70
+#: main.go:74
 msgid "failed to open vcs file '%s': %s"
 msgstr "falha ao abrir ficheiro VCS '%s': %s"
 
@@ -553,22 +552,19 @@ msgstr "falha ao analizar %s -- ignorando: %s"
 msgid "failed to parse %s: %s"
 msgstr "falha ao analizar %s: %s"
 
-#: main.go:55
+#: main.go:59
 msgid "failed to read config file '%s': %s"
 msgstr "falha ao ler ficheiro de configuração '%s': %s"
 
-#: main.go:77
+#: main.go:81
 msgid "failed to read vcs file '%s': %s"
 msgstr "falha ao ler ficheiro VCS '%s': %s"
 
-#: cmd.go:356
-#: config.go:334
-#: print.go:644
+#: cmd.go:356 config.go:334 print.go:644
 msgid "input too long"
 msgstr "input demasiado longo"
 
-#: callbacks.go:82
-#: print.go:654
+#: callbacks.go:82 print.go:654
 msgid "invalid number: %s"
 msgstr "número inválido: %s"
 
@@ -576,17 +572,11 @@ msgstr "número inválido: %s"
 msgid "invalid option '%s'"
 msgstr "opção inválida '%s'"
 
-#: cmd.go:338
-#: cmd.go:372
-#: cmd.go:389
-#: query.go:230
-#: print.go:78
-#: print.go:121
+#: cmd.go:338 cmd.go:372 cmd.go:389 print.go:78 print.go:121 query.go:230
 msgid "invalid sort mode. Fix with yay -Y --bottomup --save"
 msgstr "sort mode inválido. Corrigir com yay -Y --bottomup --save"
 
-#: callbacks.go:87
-#: print.go:659
+#: callbacks.go:87 print.go:659
 msgid "invalid value: %d is not between %d and %d"
 msgstr "valor inválido: %d não está entre %d e %d"
 
@@ -626,7 +616,7 @@ msgstr "recusando instalar pacotes AUR como root, abortando"
 msgid "removing AUR packages from cache..."
 msgstr "removendo pacotes AUR da cache..."
 
-#: clean.go:186
+#: clean.go:186 clean.go:208
 msgid "removing untracked AUR files from cache..."
 msgstr "removendo ficheiros AUR não seguidos da cache..."
 
@@ -634,7 +624,7 @@ msgstr "removendo ficheiros AUR não seguidos da cache..."
 msgid "the PKGDEST for %s is listed by makepkg but does not exist: %s"
 msgstr "PKGDEST para %s é listado pelo makepkg mas não existe: %s"
 
-#: main.go:185
+#: main.go:189
 msgid "unable to CreateHandle: %s"
 msgstr "não é possível executar CreateHandle: %s"
 
@@ -649,7 +639,3 @@ msgstr "versão-desconhecida"
 #: config.go:298
 msgid "yes"
 msgstr "sim"
-
-#: pkg/text/print.go:50
-msgid "None"
-msgstr "Nenhum"

+ 1 - 1
upgrade.go

@@ -357,7 +357,7 @@ func upgradePkgs(aurUp, repoUp upSlice) (ignore, aurNames stringset.StringSet, e
 	sort.Sort(repoUp)
 	sort.Sort(aurUp)
 	allUp := append(repoUp, aurUp...)
-	fmt.Printf("%s"+bold(" %d ")+"%s\n", bold(cyan("::")), allUpLen, bold("Packages to upgrade."))
+	fmt.Printf("%s"+bold(" %d ")+"%s\n", bold(cyan("::")), allUpLen, bold(gotext.Get("Packages to upgrade.")))
 	allUp.print()
 
 	text.Infoln(gotext.Get("Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"))