Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

localization.py 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  1. import sys
  2. import locale
  3. system_locale = locale.getdefaultlocale()[0]
  4. # system_locale may be nil
  5. system_language = system_locale[0:2] if system_locale is not None else "en"
  6. if system_language not in ['en','ru','zh']:
  7. system_language = 'en'
  8. windows_font_name_map = {
  9. 'en' : 'cour',
  10. 'ru' : 'cour',
  11. 'zh' : 'simsun_01'
  12. }
  13. darwin_font_name_map = {
  14. 'en' : 'cour',
  15. 'ru' : 'cour',
  16. 'zh' : 'Apple LiSung Light'
  17. }
  18. linux_font_name_map = {
  19. 'en' : 'cour',
  20. 'ru' : 'cour',
  21. 'zh' : 'cour'
  22. }
  23. def get_default_ttf_font_name():
  24. platform = sys.platform
  25. if platform[0:3] == 'win': return windows_font_name_map.get(system_language, 'cour')
  26. elif platform == 'darwin': return darwin_font_name_map.get(system_language, 'cour')
  27. else: return linux_font_name_map.get(system_language, 'cour')
  28. SID_HOT_KEY = 1
  29. if system_language == 'en':
  30. StringsDB = {'S_HOT_KEY' : 'hot key'}
  31. elif system_language == 'ru':
  32. StringsDB = {'S_HOT_KEY' : 'горячая клавиша'}
  33. elif system_language == 'zh':
  34. StringsDB = {'S_HOT_KEY' : '热键'}
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...