import json
import os

class langHandel:
    def __init__(self,node):
        self.node = node
        lang="en"
        if os.path.exists("lang/lang.json"):
            with open("lang/lang.json", 'r', encoding='utf-8') as file:
                lang = json.load(file)
                lang= lang.get("language" )
        file_path="lang/"+lang+".json"
        if os.path.exists(file_path):
            with open(file_path, 'r', encoding='utf-8') as file:
                self.data = json.load(file)



    def get_value(self,   key):
        if self.node in self.data:
            return self.data[self.node].get(key, "Key not found")
        else:
            return "Node not found"
