fix: restore locales_path after removing embed-assets commit
The embed-assets commit made locales_path optional, and main.rs was updated to pass None. Removing that commit restored the PathBuf signature but left main.rs passing None. Restore the original locales_path initialization.
This commit is contained in:
+8
-1
@@ -2,6 +2,7 @@
|
|||||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||||
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
@@ -89,8 +90,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Ensure locales directory exists for i18n
|
||||||
|
let locales_path = PathBuf::from("./static/locales");
|
||||||
|
if !locales_path.exists() {
|
||||||
|
std::fs::create_dir_all(&locales_path).expect("Failed to create locales directory");
|
||||||
|
}
|
||||||
|
|
||||||
// Build all services via the factory
|
// Build all services via the factory
|
||||||
let factory = AppServiceFactory::with_config(storage_path, None, config.clone());
|
let factory = AppServiceFactory::with_config(storage_path, locales_path, config.clone());
|
||||||
|
|
||||||
let app_state = factory.build_app_state(db_pools).await
|
let app_state = factory.build_app_state(db_pools).await
|
||||||
.expect("Failed to build application state. If running in Docker, ensure the storage volume is writable by the oxicloud user (UID 1001)");
|
.expect("Failed to build application state. If running in Docker, ensure the storage volume is writable by the oxicloud user (UID 1001)");
|
||||||
|
|||||||
Reference in New Issue
Block a user