我的主要问题是:
- 哪些 (env) 变量控制着 Firefox 中时间和日期的格式,还有什么影响(UI、拼写检查)?
我尝试更改语言环境设置、软件包、Firefox 语言包和 Firefox 设置,但我想不出一个组合来再次给我想要的结果:
- 如何在 en-US 中使用 Firefox(拼写检查和不太重要的 UI),但时间以 24 小时格式显示(日期显示为除 mm DD yy 之外的任何内容)?
在某些以前版本的 Kubuntu 中,我通过将语言环境的一些常规部分设置为 en-GB 来“修复”我的问题,但这具有将 Pidgin 的拼写检查从 en-US 更改为 en-GB 的不良副作用。这次我什至无法重现该结果(尽管一直在做笔记)。
我尝试了 StackExchange 和其他地方的许多建议,但没有一个对我有用。幸运的是,我在绝望中记得除了在 StackExchange 上回答问题外,我还可以提问!
输出和状态:
我在 Kubuntu 18.04 上使用 Firefox 66.0.3(64 位)。
在 Firefox > Addons > Languages 中,我安装了 en-US 和 en-GB。
在 Firefox > Preferences > Language and Appearance > Language:对于 UI 语言和网站显示语言,我尝试了 en-US 和 en-GB,没有任何更改。
在 chrome://global/locale/intl.properties 的 Firefox 中:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# LOCALIZATION NOTE (intl.accept_languages):
# This is a comma-separated list of valid BCP 47 language tags.
#
# Begin with the language tag of your locale. Next, include language
# tags for other languages that you expect most users of your locale to be
# able to speak, so that their browsing experience degrades gracefully if
# content is not available in their primary language.
#
# It is recommended that you include "en-US, en" at the end of the list as a
# last resort. However, if you know that users of your locale would prefer a
# different variety of English, or if they are not likely to understand
# English at all, you may opt to include a different English language tag, or
# to exclude English altogether.
#
# For example, the Breton [br] locale might consider including French and
# British English in their list, since those languages are commonly spoken in
# the same area as Breton:
# intl.accept_languages=br, fr-FR, fr, en-GB, en
intl.accept_languages=en-US, en
# LOCALIZATION NOTE (font.language.group):
# This preference controls the initial setting of the language drop-down menu
# in the Content > Fonts & Colors > Advanced preference panel.
#
# Set it to the value of one of the menuitems in the "selectLangs" menulist in
# http://dxr.mozilla.org/mozilla-central/source/browser/components/preferences/fonts.xul
font.language.group=x-western
# LOCALIZATION NOTE (intl.charset.detector):
# This preference controls the initial setting for the character encoding
# detector. Valid values are ja_parallel_state_machine for Japanese, ruprob
# for Russian and ukprob for Ukrainian and the empty string to turn detection
# off. The value must be empty for locales other than Japanese, Russian and
# Ukrainian.
intl.charset.detector=
# LOCALIZATION NOTE (pluralRule): Pick the appropriate plural rule for your
# language. This will determine how many plural forms of a word you will need
# to provide and in what order.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
pluralRule=1
# LOCALIZATION NOTE (intl.menuitems.alwaysappendaccesskeys, intl.menuitems.insertseparatorbeforeaccesskeys):
# Valid values are: true, false, <empty string>
# Missing preference or empty value equals false.
intl.menuitems.alwaysappendaccesskeys=
intl.menuitems.insertseparatorbeforeaccesskeys=true
输出locale
:
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE=C
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=et_EE.UTF-8
LC_NAME=et_EE.UTF-8
LC_ADDRESS=et_EE.UTF-8
LC_TELEPHONE=et_EE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=et_EE.UTF-8
LC_ALL=
输出printenv | grep LC_
:
LC_MEASUREMENT=de_DE.UTF-8
LC_PAPER=et_EE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_NAME=et_EE.UTF-8
LC_COLLATE=C
LC_ADDRESS=et_EE.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TELEPHONE=et_EE.UTF-8
LC_IDENTIFICATION=et_EE.UTF-8
LC_TIME=en_GB.UTF-8
输出localectl status
:
System Locale: LANG=en_US.UTF-8
LC_NUMERIC=et_EE.UTF-8
LC_TIME=et_EE.UTF-8
LC_MONETARY=et_EE.UTF-8
LC_PAPER=et_EE.UTF-8
LC_NAME=et_EE.UTF-8
LC_ADDRESS=et_EE.UTF-8
LC_TELEPHONE=et_EE.UTF-8
LC_MEASUREMENT=et_EE.UTF-8
LC_IDENTIFICATION=et_EE.UTF-8
VC Keymap: n/a
X11 Layout: us
X11 Model: pc105
输出locale -a
:
C
C.UTF-8
POSIX
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IL
en_IL.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
et_EE.utf8
如果我从终端启动 Firefox,我会收到以下警告,也许这也是相关的:
(firefox:15865): Gtk-WARNING **: 17:27:21.499: Locale not supported by C library.
Using the fallback 'C' locale.
(/usr/lib/firefox/firefox:15933): Gtk-WARNING **: 17:27:21.873: Locale not supported by C library.
Using the fallback 'C' locale.
(/usr/lib/firefox/firefox:15982): Gtk-WARNING **: 17:27:22.569: Locale not supported by C library.
Using the fallback 'C' locale.
(/usr/lib/firefox/firefox:16024): Gtk-WARNING **: 17:27:24.441: Locale not supported by C library.
Using the fallback 'C' locale.
(/usr/lib/firefox/firefox:16152): Gtk-WARNING **: 17:27:26.382: Locale not supported by C library.
Using the fallback 'C' locale.
我使用的是 German locale
de_DE.UTF-8
,但它的输出中缺少locale -a
(如问题中所示)。解决方案(感谢@GunnarHjalmarsson)也是通过以下方式生成: