talk.py 846 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # THIS FILE IS A PART OF VCStudio
  2. # PYTHON 3
  3. # this file handles language
  4. import os
  5. from settings import settings
  6. def text(var):
  7. data = open("settings/languages/"+settings.read("Language")+".data")
  8. data = data.read()
  9. data = data.split("]")
  10. #finding the keyword
  11. for line in data:
  12. if line.startswith("\n"+var):
  13. return line.replace("\n"+var+" = [", "")
  14. #Try English
  15. data = open("settings/languages/English.data")
  16. data = data.read()
  17. data = data.split("]")
  18. #finding the keyword
  19. for line in data:
  20. if line.startswith("\n"+var):
  21. return line.replace("\n"+var+" = [", "!")
  22. #If Couldn't Find
  23. return "!Missing! "+var
  24. def alert(message):
  25. os.system("notify-send -i "+os.getcwd()+'/tinyicon.png "VCStudio" "'+message+'"')