答案1
试试这个。如果它有效,它不会是永久的……目前还不是。最好在保留任何变量之前进行测试以确保它有效。命令是set $LANG=en_US.utf8
我从 Launchpad 找到了清单区域设置相关的环境变量以及它们在您的系统上配置的功能。此链接不仅包含列表,还包含有关区域设置配置的有用信息。
LANG
Provides default value for LC_* variables that have not been explicitly set.
LC_ADDRESS
How addresses are formatted (country first or last, where zip code goes etc.).
LC_ALL
Overrides individual LC_* settings: if LC_ALL is set, none of the below have any effect.
LC_COLLATE
How strings (file names...) are alphabetically sorted. Using the "C" or "POSIX" locale here results in a strcmp()-like sort order, which may be preferable to language-specific locales.
LC_CTYPE
How characters are classified as letters, numbers etc. This determines things like how characters are converted between upper and lower case.
LC_IDENTIFICATION
Metadata about the locale information.
LC_MEASUREMENT
What units of measurement are used (feet, meters, pounds, kilos etc.).
LC_MESSAGES
What language should be used for system messages.
LC_MONETARY
What currency you use, its name, and its symbol.
LC_NAME
How names are represented (surname first or last, etc.).
LC_NUMERIC
How you format your numbers. For example, in many countries a period (.) is used as a decimal separator, while others use a comma (,).
LC_PAPER
Paper sizes: 11 x 17 inches, A4, etc.
LC_RESPONSE
Determines how responses (such as Yes and No) appear in the local language
LC_TELEPHONE
What your telephone numbers look like.
LC_TIME
How your time and date are formatted. Use for example "en_DK.UTF-8" to get a 24-hour-clock in some programs.
设置这些的最佳方法是使用localectl
。它是系统区域设置守护进程的前端界面system-localed
。守护进程和工具都有手册页。当我搜索文档时,我输入man locale
并按下TABbash 完成。它显示了 6 或 7 个不同区域设置相关工具和资源的选项。一定要检查一下。我相信你一定会发现它们很有用。
无论如何,正如我在评论中所说,您可以通过键入来找到设备上当前的语言locale -a
。一旦您知道提供英文文本的名称(可能是 en_US.utf8),您就可以使用它来构建所需的命令。
在更改任何内容之前,请务必记录您的旧设置,以防您以后想要将其恢复。您可以使用以下命令执行此操作:
localectl status >> old.settings
echo;echo;echo " ~~ installed Locales ~~";echo;echo;
localectl list-locales >> old.settings
# The last line does the same as "locale -a" but may have more info about your settings
此外,请记住阅读其他手册页,看看是否可以找到任何其他列表类型命令。如果确实old.settings
如此,请务必将它们添加到我们制作的文件中。每当您开始更改此类配置时,都需要记录您的起点。如果您有备份系统,也请进行备份。
该命令应采用以下形式:
localectl set-locale [name-of-new-locale-file]
如果 en_US.utf8 出现在语言环境列表中,则使用它。
这将更改系统的 $LANG 变量。这将修复终端,但会破坏其他一些东西。例如,时间可能不对。我上面发布的列表提供了修复任何问题的变量。只需在列表中找到控制您需要重置的问题的键,然后重置它即可。