package com.printhub.printhub.controller.config;

import com.printhub.printhub.service.I18nService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/lang")
public class I18nController {

    @Autowired
    private I18nService i18nService;

    @GetMapping
    public Map<String, String> getLanguage(@RequestParam(defaultValue = "es") String lang) {
        return i18nService.getTranslations(lang);
    }
}

