Actualiza la inicialización de traza+localización
This commit is contained in:
parent
cac4c2f102
commit
67952f6840
7 changed files with 12 additions and 12 deletions
|
|
@ -2,4 +2,4 @@
|
|||
pub const CONFIG_DIR: &'static str = "config";
|
||||
|
||||
mod settings;
|
||||
pub use crate::config::settings::{CONFIG, SETTINGS};
|
||||
pub use settings::{CONFIG, SETTINGS};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{Lazy, base, locale, trace};
|
||||
use crate::{Lazy, base, trace};
|
||||
use crate::config::SETTINGS;
|
||||
use crate::core::{Server, all, server};
|
||||
use crate::core::module::register_module;
|
||||
|
|
@ -32,11 +32,11 @@ pub fn run(bootstrap: Option<fn()>) -> Result<Server, std::io::Error> {
|
|||
);
|
||||
}
|
||||
|
||||
// Traza de seguimiento.
|
||||
Lazy::force(&trace::TRACING);
|
||||
// Inicia la traza de la aplicación.
|
||||
Lazy::force(&server::tracing::TRACING);
|
||||
|
||||
// Identificador de idioma.
|
||||
Lazy::force(&locale::LANGID);
|
||||
// Asigna identificador de idioma.
|
||||
Lazy::force(&server::langid::LANGID);
|
||||
|
||||
// Ejecuta la función de inicio de la aplicación.
|
||||
if bootstrap != None {
|
||||
|
|
|
|||
|
|
@ -2,5 +2,10 @@ pub use actix_web::{
|
|||
App, HttpRequest, HttpResponse, HttpServer, Responder, Result, http, web
|
||||
};
|
||||
|
||||
mod tracing;
|
||||
|
||||
mod langid;
|
||||
pub use langid::LANGID;
|
||||
|
||||
mod main;
|
||||
pub use main::run;
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@ pub use fluent_templates::{static_loader as static_locale, Loader as Locale};
|
|||
pub use fluent_templates;
|
||||
pub use fluent_templates::fluent_bundle::FluentValue;
|
||||
|
||||
mod locale;
|
||||
pub use locale::LANGID;
|
||||
|
||||
#[macro_export]
|
||||
/// Permite integrar fácilmente localización en temas, módulos y componentes.
|
||||
macro_rules! localize {
|
||||
( $DEF_LANGID:literal, $locales:literal $(, $core_locales:literal)? ) => {
|
||||
use $crate::locale::*;
|
||||
use $crate::core::server::LANGID;
|
||||
|
||||
static_locale! {
|
||||
static LOCALES = {
|
||||
|
|
@ -1,5 +1,2 @@
|
|||
pub use tracing::{Level, event, span};
|
||||
pub use tracing::{debug, error, info, trace, warn};
|
||||
|
||||
mod trace;
|
||||
pub use trace::TRACING;
|
||||
Loading…
Add table
Add a link
Reference in a new issue