Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export locale for system commands run from Lua #2038

Open
alerque opened this issue May 30, 2024 · 1 comment · May be fixed by #2064
Open

Export locale for system commands run from Lua #2038

alerque opened this issue May 30, 2024 · 1 comment · May be fixed by #2064
Assignees
Labels
enhancement Software improvement or feature request
Milestone

Comments

@alerque
Copy link
Member

alerque commented May 30, 2024

One more for after we better work out how we're handling the locale code internally...

When I run os.execute() from Lua inside a SILE document, I would expect the document locale setting to have been exported as an env var ahead of time.

\begin{document}
\language[main=tr]
\fluent[name=Docker]{hello}
\eject
\begin{lua}
local date = os.execute("date")
local date = os.execute("env LC_ALL=tr_TR.UTF-8 date")
\end{lua}
\end{document}
$ sile foo.sil -o - -b text
SILE v0.14.17.r414-g6382ac4 (LuaJIT 2.1.1700206165) [Rust]
<d/foo.sil> as sil
<./core/languages.lua:78> as xml
Merhaba Docker![1]  1
                     <./core/sile.lua:566> as lua
Fri May 31 01:47:20 AM +03 2024
Cum 31 May 2024 01:47:20 +03
[2]
2

Note the output of the first date command does not track the document context.

@alerque alerque added the enhancement Software improvement or feature request label May 30, 2024
@alerque alerque added this to the v0.x.y milestone May 30, 2024
@alerque alerque self-assigned this Jun 12, 2024
@alerque alerque modified the milestones: v0.x.y, v0.15.4, v0.15.x Jun 12, 2024
@alerque
Copy link
Member Author

alerque commented Jun 12, 2024

I basically have this working now, but the system locale setting needs something more than our two letter language codes. This is hung up on needing BCP47 language codes.

@alerque alerque linked a pull request Jun 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Software improvement or feature request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant