Comment 4 for bug 1932579

Revision history for this message
Carlos Eduardo Alves (kmiksi) wrote (last edit ):

This bug also prevents the use of snap command autocomplete, echoing these error messages when TAB is pressed....

```
$ snap [TAB]2021/08/26 11:39:40.041113 main.go:176: description of prepare-image's "<target-dir>" is lowercase in locale "pt_BR": "o directório de destino"

```

I found that there is a typo in the file "/usr/share/locale-langpack/pt/LC_MESSAGES/snappy.mo".

```
$ dpkg -S /usr/share/locale-langpack/pt/LC_MESSAGES/snappy.mo
language-pack-pt-base: /usr/share/locale-langpack/pt/LC_MESSAGES/snappy.mo
$ dpkg -l language-pack-pt-base
ii language-pack-pt-base 1:20.04+20210802 all translations for language Portuguese
```

An available workaround is to fix the file manually...

```
sudo sed -i 's/o directório de destino/O directório de destino/' /usr/share/locale-langpack/pt/LC_MESSAGES/snappy.mo
```

Probably must be fixed into language-pack-pt-base translation sources.

Or.... this can be interpreted as a bug in snapd that imposes capitalization rules on translations, at some "main.go" at line 176, as the message says.
I've downloaded snapd sources and found this validation on "cmd/snap/main.go":

```
$ dpkg -l snapd
ii snapd 2.49.2+20.04 amd64 Daemon and tooling that enable snap packages
$ cd /tmp && apt source snapd
$ sed '174,177!d' /tmp/snapd-2.49.2+20.04/cmd/snap/main.go
                // note IsLower != !IsUpper for runes with no upper/lower.
                if unicode.IsLower(r) && !strings.HasPrefix(desc, "login.ubuntu.com") && !strings.HasPrefix(desc, cmdName) {
                        noticef("description of %s's %q is lowercase: %q", cmdName, optName, desc)
                }
```