package localization

import (
	"context"
	"tercul/internal/domain"
)

// LocalizationQueries contains the query handlers for the localization aggregate.
type LocalizationQueries struct {
	repo domain.LocalizationRepository
}

// NewLocalizationQueries creates a new LocalizationQueries handler.
func NewLocalizationQueries(repo domain.LocalizationRepository) *LocalizationQueries {
	return &LocalizationQueries{repo: repo}
}

// GetTranslation returns a translation for a given key and language.
func (q *LocalizationQueries) GetTranslation(ctx context.Context, key string, language string) (string, error) {
	return q.repo.GetTranslation(ctx, key, language)
}

// GetTranslations returns a map of translations for a given set of keys and language.
func (q *LocalizationQueries) GetTranslations(ctx context.Context, keys []string, language string) (map[string]string, error) {
	return q.repo.GetTranslations(ctx, keys, language)
}

// GetAuthorBiography returns the biography of an author in a specific language.
func (q *LocalizationQueries) GetAuthorBiography(ctx context.Context, authorID uint, language string) (string, error) {
	return q.repo.GetAuthorBiography(ctx, authorID, language)
}

// GetWorkContent returns the content of a work in a specific language.
func (q *LocalizationQueries) GetWorkContent(ctx context.Context, workID uint, language string) (string, error) {
	return q.repo.GetWorkContent(ctx, workID, language)
}