Closed imsi32 closed 2 months ago
I set my Styles with probability bold = true in init.lua file
You should use ui.Style()
to create a Style
, e.g.:
ui.Style():fg("red"):bg("blue"):bold()
Doc of ui.Style
: https://yazi-rs.github.io/docs/plugins/layout#style
I added a time and date component using os.date() function. However, it gives me only English text, which is not my local.
Could you please try calling os.setlocale("")
or os.setlocale("C")
before os.date()
and see which one works, we can add it to the setup.lua
if either of them worked.
Doc of os.setlocale
: https://www.lua.org/manual/5.4/manual.html#pdf-os.setlocale
First of all, I am sorry to put two different issue into one issue. For the bold font issue, I just added :bold()
after I styled components like the following and it worked.
component:style(style_a):bold()
For the local text issue I tried os.setlocale()
, os.setlocale("")
and os.setlocale("C")
. The only one working is os.setlocale("")
.
The only one working is os.setlocale("").
I've added it to the setup.lua in https://github.com/sxyazi/yazi/pull/1241/files#diff-1efb3f807841b778a047aae5032cf99bf0b4294e7036f8f09c5cc1b994906ffa, you should no longer need to set it up before calling os.date()
as now Yazi will initialize it automatically.
I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
alacritty 0.13.2
Did you try the latest code to see if this problem got fixed?
Tried, but the problem still
yazi --debug
outputyazi.log
Describe the bug
While I developing my plugin, I encounter two issues which I believe it is because local system preferences like language, time - date form, fonts etc. cannot accessed by plugins. The issues:
bold = true
in init.lua file. My texts are not applied with this property. However, if I use theme.toml, or used bold font in other application like neovim, its works.os.date()
function. However, it gives me only English text, which is not my local. These does not happen when I use this function in neovim which gives my local values.Expected Behavior
According to my issues:
os:date'()
function returns texts with my language (local preferences)To Reproduce
For the 1st issue:
bold = true
property in init.lua of a pluginFor the 2nd issue:
os:date()
functionConfiguration
These sections are from yatline.yazi plugin's init.lua file.
Anything else?
In Yazi:
In Neovim: