//
// Created by sasha on 08.12.2025.
//

#ifndef RU_DANSOFT_PUZZLE15_LOCALE_H
#define RU_DANSOFT_PUZZLE15_LOCALE_H

#include <string>
#include <map>
#include <vector>

class Locale {
private:
    std::string locale;
    std::map<std::string,std::string> translate;

    static Locale* instance;

    Locale();

    std::vector<std::string> parseString(const std::string& str, char delimiter);

    // Удаляем копирование и присваивание
    Locale(const Locale&) = delete;
    Locale& operator=(const Locale&) = delete;

public:
    static Locale* getInstance() {
        if (!instance) {
            instance = new Locale();
        }
        return instance;
    }

    bool init(std::string locale);
    std::string tr(const std::string &string);

};

#endif //RU_DANSOFT_PUZZLE15_LOCALE_H
