[Newbies] 如何在不更改系统语言的情况下修改应用语言
Tofloor
poster avatar
XYZ
deepin
2023-07-22 01:12
Author

各位大佬好,刚从win11切换到deepin, 才发现deepin才是我的菜。

我的问题是,

保持系统语言为中文,如何修改例如邮箱应用的语言为英文呢

Reply Favorite View the author
All Replies
卖了摩托继续写Bug
deepin
2023-07-22 01:32
#1

一个思路,在桌面创建一个脚本文件

内容为:

#! /usr/bash
LANGUAGE=en_US
deepin-mail

然后给这个脚本添加执行权限,双击的时候就可以在全局中文的情况下以英文环境打开邮件应用

Reply View the author
卖了摩托继续写Bug
deepin
2023-07-22 01:36
#2

再扩展一下,自己创建一个脚本,丢到任意目录,修改 /usr/share/applications/deepin-mail.desktop 中的 Exec 字段为自己的脚本,这样的话从 launcher 中打开也是英文了。

image.png

image.png

Reply View the author
卖了摩托继续写Bug
deepin
2023-07-22 01:37
#3

可以实现。脚本位置可以放到 /usr/bin 或者其他任意不妨碍你的目录下。保持 desktop 文件内的 Exec 字段与脚本位置一致就行。
image.png

Reply View the author
安洛
deepin
2023-07-22 01:56
#4

楼上说的没毛病,基本思路就是修改LANGUAGE环境变量。

不过,/usr/share/applications下的desktop文件会被更新覆盖;如果希望长期保存,比较好的方案是将文件复制一份到~/.local/share/applications下再修改,但这样做的缺点是只对当前用户生效。两个方案需要自己权衡。

Reply View the author
XYZ
deepin
2023-07-22 02:09
#5
卖了摩托继续写Bug

再扩展一下,自己创建一个脚本,丢到任意目录,修改 /usr/share/applications/deepin-mail.desktop 中的 Exec 字段为自己的脚本,这样的话从 launcher 中打开也是英文了。

image.png

image.png

感谢👍

Reply View the author
hotime
deepin
2023-07-22 02:55
#6

LANGUAGE=en_US这一局部环境变量可以直接在桌面入口文件的Exec中通过bash -c执行多个语句来提前设定,省去额外创建脚本的辛苦。

在DeepinV20中:修改/usr/share/applications/deepin-mail.desktop,将其中的Exec行内容修改为:

Exec=bash -c "LANGUAGE=en_US; deepin-mail %U"

在DeepinV23中:如果使用默认的玲珑应用,则修改/persistent/linglong/entries/share/applications/deepin-mail.desktop,将其中的Exec行内容修改为:

Exec=bash -c "LANGUAGE=en_US; ll-cli run org.deepin.mail --exec deepin-mail %U"
Reply View the author
XYZ
deepin
2023-07-22 07:41
#7
hotime

LANGUAGE=en_US这一局部环境变量可以直接在桌面入口文件的Exec中通过bash -c执行多个语句来提前设定,省去额外创建脚本的辛苦。

在DeepinV20中:修改/usr/share/applications/deepin-mail.desktop,将其中的Exec行内容修改为:

Exec=bash -c "LANGUAGE=en_US; deepin-mail %U"

在DeepinV23中:如果使用默认的玲珑应用,则修改/persistent/linglong/entries/share/applications/deepin-mail.desktop,将其中的Exec行内容修改为:

Exec=bash -c "LANGUAGE=en_US; ll-cli run org.deepin.mail --exec deepin-mail %U"

谢谢

Reply View the author