2

I have been searching but I cannot find where this message is kept:

Terminal window with warning in English

Here is the message as text:

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

I want to translate this message into my language, so others would understand it better. It would give a better first impression.

Quentin
  • 23
  • This is a message comes when you open your terminal for the first time. Its just telling you how to use sudo. To remove the message use a sudo command like sudo apt update etc once and it will not appear next time you open the terminal :) – Parag Katoch May 16 '21 at 17:59
  • Hello, I do not want to remove it but to translate it into my language, so other understand it better. But thanks for the pointer – Quentin May 16 '21 at 18:02
  • 3
    I don't think this is something you'll get translated, since it seems to be hardcoded in /etc/bash.bashrc without using a translation mechanism: https://git.launchpad.net/ubuntu/+source/bash/tree/debian/etc.bash.bashrc#n48 – muru May 16 '21 at 18:03
  • you can change your terminal language like this https://askubuntu.com/a/977821/1112104 but if you want to get only the output translated then you can use a translator and translate the output manually eg like using trans https://manpages.ubuntu.com/manpages/cosmic/man1/trans.1.html :) – Parag Katoch May 16 '21 at 18:08

1 Answers1

4

This question is related: Remove note about sudo that appears when opening the terminal

You could edit the /etc/bash.bashrc file and manually change the sudo hint text to whatever you like. The relevant section is the following:

# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then
    case " $(groups) " in *\ admin\ *|*\ sudo\ *)
    if [ -x /usr/bin/sudo ]; then
    cat <<-EOF
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
EOF
fi
esac

fi

  • Many thanks for you researches! @gunnar-hjalmarsson is there any way to i18n this part? – Quentin May 20 '21 at 17:27
  • 1
    @Quentin: Yes, in theory. It seems to be a Debian specific file, but I doubt that Debian has an interest in making it translatable. So maybe Ubuntu only. But in my opinion it wouldn't be worth it. Too much work for a message which only shows up once for a newly created user account. – Gunnar Hjalmarsson May 21 '21 at 19:32
  • It was worth trying :) Thanks Gunnar – Quentin May 21 '21 at 19:44
  • @Quentin: It looks like the "sudo hint" is a pure Ubuntu invention. But it doesn't change my opinion that making it translatable would be to overdo it. – Gunnar Hjalmarsson May 21 '21 at 22:40