带有 tkinter 的希伯来语

编程入门 行业动态 更新时间:2024-10-25 21:31:27
本文介绍了带有 tkinter 的希伯来语 - BiDi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在使用 tkinter 开发 Python GUI 应用程序,该应用程序以希伯来语显示文本.

I'm working on a python GUI application, using tkinter, which displays text in Hebrew.

在 Windows (10, python 3.6, tkinter 8.6) 上,希伯来语字符串显示正常.

On Windows (10, python 3.6, tkinter 8.6) Hebrew strings are displayed fine.

在 Linux(Ubuntu 14,python 3.4 和 3.6,tkinter 8.6)上,希伯来语字符串显示不正确 - 没有 BiDi 意识 - 我是否遗漏了什么?

On Linux (Ubuntu 14, both python 3.4 and 3.6, tkinter 8.6) Hebrew strings are displayed incorrectly - with no BiDi awareness - am I missing something?

我安装了 pybidi,并通过 bidi.algorithm.get_display(hebrew_string) - 字符串显示正确.
但是,在 Windows 上,get_display(hebrew_string) 显示不正确.

I installed pybidi, and via bidi.algorithm.get_display(hebrew_string) - the strings are displayed correctly.
But then, on Windows, get_display(hebrew_string) is displayed incorrectly.

python-tkinter-Linux 不支持 BiDi 吗?
我必须用 get_display(string) 包裹每个字符串吗?
我必须用 only_on_linux(...) 函数包装 get_display(string) 吗?

Is BiDi not supported on python-tkinter-Linux?
Must I wrap each string with get_display(string)?
Must I wrap get_display(string) with a only_on_linux(...) function?

推荐答案

我搜索了一下,发现 tk/tcl 大约从 2011 年开始使用 Windows bidi 支持是一个已知问题,但它们在 linux 上显然没有任何等价物.示例:https://wiki.tcl.tk/3158.Python/Tkinter:将 Tkinter 用于 RTL(从右到左)语言,例如阿拉伯语/希伯来语? 有一些针对 *nix 的解决方法.我不确定 Mac 是否支持最新的 tcl/tk.

I searched a bit and it is a known issue that tk/tcl uses Windows bidi support since about 2011, but their is apparently nothing equivalent on linux. Example: https://wiki.tcl.tk/3158. One answer to Python/Tkinter: Using Tkinter for RTL (right-to-left) languages like Arabic/Hebrew? has some workarounds for *nix. I am not sure about Mac support with the latest tcl/tk.

对于跨平台工作,您需要一个在 Windows 上回显并在您的 Ubuntu 上反转的函数.

For cross-platform work you will need a function that echoes on Windows and reverses on your Ubuntu.

这篇关于带有 tkinter 的希伯来语 - BiDi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 08:01:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1391339.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:希伯来   tkinter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!