With locale LANG=da_DK.UTF-8 snap will throw strange warning on snap refresh - and more snap commands

Bug #1808213 reported by zob on 2018-12-12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Translations
De danske oversættere af Ubuntu
Zygmunt Krynicki
snapd (Ubuntu)

Bug Description

To reproduce change locale LANG to da_DK.UTF-8
Make sure to use ubuntu 18.10

Snap versions:

lars@lars-ThinkPad-P50-tinker:~$ snap --version
2018/12/12 19:51:16.123791 main.go:152: description of advise-snap's "from-apt" is lowercase: "advise-snap vil tale med apt via en apt-hook"
snap 2.36.2
snapd 2.36.2
series 16
ubuntu 18.10
kernel 4.18.0-12-generic

As you might have noticed above this is also thrown when running snap --version

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: snapd 2.35.5+18.10
ProcVersionSignature: Ubuntu 4.18.0-12.13-generic 4.18.17
Uname: Linux 4.18.0-12-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Wed Dec 12 19:43:21 2018
InstallationDate: Installed on 2018-04-29 (227 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
 PATH=(custom, no user)
SourcePackage: snapd
UpgradeStatus: Upgraded to cosmic on 2018-11-03 (39 days ago)

zob (zob) wrote :
zob (zob) wrote :

Here's another person who sees this: https://askubuntu.com/questions/1088575/weird-message-when-installing-programs

Source code is in snap/main.go function lintDesc

func lintDesc(cmdName, optName, desc, origDesc string) {
 if len(optName) == 0 {
  logger.Panicf("option on %q has no name", cmdName)
 if len(origDesc) != 0 {
  logger.Panicf("description of %s's %q of %q set from tag (=> no i18n)", cmdName, optName, origDesc)
 if len(desc) > 0 {
  // decode the first rune instead of converting all of desc into []rune
  r, _ := utf8.DecodeRuneInString(desc)
  // note IsLower != !IsUpper for runes with no upper/lower.
  // Also note that login.u.c. is the only exception we're allowing for
  // now, but the list of exceptions could grow -- if it does, we might
  // want to change it to check for urlish things instead of just
  // login.u.c.
  if unicode.IsLower(r) && !strings.HasPrefix(desc, "login.ubuntu.com") {
   noticef("description of %s's %q is lowercase: %q", cmdName, optName, desc)

zob (zob) wrote :

Running the same snap commands with locale LANG=C there is no message.

Zygmunt Krynicki (zyga) wrote :

The localisation is wrong, the translated string should be capitalised.

Changed in snapd (Ubuntu):
status: New → Confirmed
Adolfo Jayme (fitojb) on 2018-12-14
Changed in ubuntu-translations:
assignee: nobody → De danske oversættere af Ubuntu (ubuntu-l10n-da)
scootergrisen (scootergrisen) wrote :

Maybe the translator wanted to use the command name (lower case) instead of translating "Advise" to "Rådgiv".


    Advise will talk to apt via an apt hook
    advise-snap vil tale med apt via en apt-hook

Some options:
    Rådgiv vil tale med apt via en apt-hook
    Rådgivning vil tale med apt via en apt-hook
    Advise vil tale med apt via en apt-hook
    Kommandoen advise-snap vil tale med apt via en apt-hook

I will leave it up to other to select what is best.

Zygmunt Krynicki (zyga) wrote :

I recently worked on something similar, let me look at this closely.

Changed in snapd:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Zygmunt Krynicki (zyga)
Ask Hjorth Larsen (askhl) wrote :

Thanks for reporting this, and to all of you for the discussion.

I/we discussed this when translating it.

The problem is that 'advise(-snap)' is used like a verb, but is also the name of a command. This means when we translate it, we need to choose either a proper translation (i.e., a verb), or we need to keep the name of the command, which is of course case sensitive.

However we (translators) are normally content in knowing that the translation contains the same information as the original string. So we may choose either. It is actually somewhat surprising that the code performs this check. Does anybody know why? I suspect that the current translation is okay, and therefore should not be cause for warning (at least not to the user).

Ask Hjorth Larsen (askhl) wrote :

Sorry, I meant to say that it is used as a noun, not a verb. But this does not change much.

John Lenton (chipaca) wrote :

Reading the code, the English original is wrong also. Apologies for that; we'll fix.

It should read like "command", with Advise being a verb.

Ask Hjorth Larsen (askhl) wrote :

So what will happen exactly on the dev side?

There are many cases in snappy where command names are used rather interchangeably as command names (nouns) or verbs, prompting translators to decide which of the two to pick. Should I/we update the string to get rid of the warning? (Maybe for next language pack update)

General i18n advice: It is probably worth writing a "# TRANSLATORS: <insert text here>" comment if the translators should know something in particular.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers