🏗️ Updated Language domain usage in main
This commit is contained in:
parent
2c23c74118
commit
c9db0f0ce0
7
main.go
7
main.go
|
@ -98,8 +98,8 @@ func NewApp(ctx context.Context, config *domain.Config) (*App, error) {
|
|||
return
|
||||
}
|
||||
|
||||
lang, err := language.Parse(head)
|
||||
if err != nil || lang == language.Und {
|
||||
lang := domain.NewLanguage(head)
|
||||
if lang == domain.LanguageUnd {
|
||||
res, err := staticer.Do(r.Context(), r.URL.Path)
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
|
@ -155,8 +155,7 @@ func NewApp(ctx context.Context, config *domain.Config) (*App, error) {
|
|||
|
||||
contentLanguage := make([]string, len(p.Translations))
|
||||
for i := range p.Translations {
|
||||
base, _ := p.Translations[i].Language.Base()
|
||||
contentLanguage[i] = base.String()
|
||||
contentLanguage[i] = p.Translations[i].Language.Code()
|
||||
}
|
||||
|
||||
w.Header().Set(common.HeaderContentLanguage, strings.Join(contentLanguage, ", "))
|
||||
|
|
Loading…
Reference in New Issue