Commit avant changement d'agent vers devstral
This commit is contained in:
@ -14,6 +14,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/mathieu/personotes/internal/api"
|
||||
"github.com/mathieu/personotes/internal/i18n"
|
||||
"github.com/mathieu/personotes/internal/indexer"
|
||||
"github.com/mathieu/personotes/internal/watcher"
|
||||
)
|
||||
@ -37,6 +38,13 @@ func main() {
|
||||
logger.Fatalf("echec de l indexation initiale: %v", err)
|
||||
}
|
||||
|
||||
// Load translations
|
||||
translator := i18n.New("en") // Default language: English
|
||||
if err := translator.LoadFromDir("./locales"); err != nil {
|
||||
logger.Fatalf("echec du chargement des traductions: %v", err)
|
||||
}
|
||||
logger.Printf("traductions chargees: %v", translator.GetAvailableLanguages())
|
||||
|
||||
w, err := watcher.Start(ctx, *notesDir, idx, logger)
|
||||
if err != nil {
|
||||
logger.Fatalf("echec du watcher: %v", err)
|
||||
@ -69,7 +77,8 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
apiHandler := api.NewHandler(*notesDir, idx, templates, logger)
|
||||
apiHandler := api.NewHandler(*notesDir, idx, templates, logger, translator)
|
||||
mux.Handle("/api/i18n/", apiHandler) // I18n translations
|
||||
mux.Handle("/api/v1/notes", apiHandler) // REST API v1
|
||||
mux.Handle("/api/v1/notes/", apiHandler) // REST API v1
|
||||
mux.Handle("/api/search", apiHandler)
|
||||
|
||||
Reference in New Issue
Block a user