I need to get names of columns with arabic language for data tables in kivymd, I tried a lot but failed, How can I do that ?
from bidi.algorithm import get_display
from kivymd.app import MDApp
from kivymd.uix.screen import MDScreen
from kivy.lang import Builder
from kivymd.uix.label import MDLabel, MDIcon
from kivymd.uix.button import MDRectangleFlatButton, MDIconButton
from kivy.core.window import Window
from kivymd.uix.datatables import MDDataTable
from kivy.metrics import dp
import arabic_reshaper
class DemoApp(MDApp):
def build(self):
self.title = "Morgan_Apps"
self.theme_cls.primary_palette="Blue"
self.theme_cls.primary_hue="600"
self.theme_cls.theme_style="Dark"
first_name = arabic_reshaper.reshape(u'الاسم الأول')
first_name = get_display(first_name)
last_name = arabic_reshaper.reshape(u'الاسم الأخير')
last_name = get_display(last_name)
table = MDDataTable(
column_data=[(first_name, dp(30)),
(Last_name, dp(30))],
pos_hint={"center_x": 0.5, "center_y": 0.4},
size_hint=(0.6, 0.2))
screen = MDScreen()
screen.add_widget(table)
return screen
if __name__ == "__main__":
DemoApp().run()
thanks for help