#pragma once

#include <filesystem>
#include <string_view>
#include <vector>

#include "presentation/localization/LocaleTypes.h"

namespace ta::presentation::localization
{
    class LocaleRepository final
    {
    public:
        explicit LocaleRepository(std::filesystem::path directory);

        [[nodiscard]] std::vector<LocaleOption> discover() const;
        [[nodiscard]] TranslationMap load(std::string_view file_name) const;

    private:
        std::filesystem::path directory_;

        [[nodiscard]] std::filesystem::path safe_file_path(std::string_view file_name) const;
    };
}
