package com.printhub.printhub.controller.home;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Locale;

@Controller
public class HomeController {

    @Autowired
    private MessageSource messageSource;

    @GetMapping("/")
    public String index(Model model, Locale locale) {
        model.addAttribute("title", messageSource.getMessage("t-home", null, locale));
        return "printhub/home"; 
    }
}

