diff --git a/pagetop-admin/src/lib.rs b/pagetop-admin/src/lib.rs index 6ac9b553..ee89c0e0 100644 --- a/pagetop-admin/src/lib.rs +++ b/pagetop-admin/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -new_static_locales!(LOCALES_ADMIN); +static_locales!(LOCALES_ADMIN); mod summary; diff --git a/pagetop-bootsier/src/lib.rs b/pagetop-bootsier/src/lib.rs index 95fc9360..40e837ad 100644 --- a/pagetop-bootsier/src/lib.rs +++ b/pagetop-bootsier/src/lib.rs @@ -1,8 +1,8 @@ use pagetop::prelude::*; -new_static_locales!(LOCALES_BOOTSIER); +static_locales!(LOCALES_BOOTSIER); -new_static_files!(bootsier); +static_files!(bootsier); pub struct Bootsier; diff --git a/pagetop-build/src/lib.rs b/pagetop-build/src/lib.rs index 5b9cfa61..8c53d241 100644 --- a/pagetop-build/src/lib.rs +++ b/pagetop-build/src/lib.rs @@ -59,7 +59,7 @@ //! ```rust#ignore //! use pagetop::prelude::*; //! -//! new_static_files!(guides); +//! static_files!(guides); //! ``` //! //! Also you can get the bundle as a static reference to the generated HashMap resources collection: @@ -67,7 +67,7 @@ //! ```rust#ignore //! use pagetop::prelude::*; //! -//! new_static_files!(guides => BUNDLE_GUIDES); +//! static_files!(guides => BUNDLE_GUIDES); //! ``` //! //! You can build more than one resources file to compile with your project. diff --git a/pagetop-bulmix/src/lib.rs b/pagetop-bulmix/src/lib.rs index a399546a..272f83b2 100644 --- a/pagetop-bulmix/src/lib.rs +++ b/pagetop-bulmix/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -new_static_files!(bulmix); +static_files!(bulmix); pub struct Bulmix; diff --git a/pagetop-homedemo/src/lib.rs b/pagetop-homedemo/src/lib.rs index 2db941bd..0ee1ae3b 100644 --- a/pagetop-homedemo/src/lib.rs +++ b/pagetop-homedemo/src/lib.rs @@ -1,8 +1,8 @@ use pagetop::prelude::*; -new_static_locales!(LOCALES_HOMEDEMO); +static_locales!(LOCALES_HOMEDEMO); -new_static_files!(homedemo); +static_files!(homedemo); pub struct HomeDemo; diff --git a/pagetop-node/src/lib.rs b/pagetop-node/src/lib.rs index 5fada548..1494aaa0 100644 --- a/pagetop-node/src/lib.rs +++ b/pagetop-node/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -new_static_locales!(LOCALES_NODE); +static_locales!(LOCALES_NODE); //mod entity; mod migration; diff --git a/pagetop-user/src/lib.rs b/pagetop-user/src/lib.rs index e1eb385d..749ee99e 100644 --- a/pagetop-user/src/lib.rs +++ b/pagetop-user/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -new_static_locales!(LOCALES_USER); +static_locales!(LOCALES_USER); mod migration; diff --git a/pagetop/src/core/module/all.rs b/pagetop/src/core/module/all.rs index e4e2b923..b8243c68 100644 --- a/pagetop/src/core/module/all.rs +++ b/pagetop/src/core/module/all.rs @@ -1,14 +1,14 @@ use crate::core::action::add_action; use crate::core::module::ModuleRef; use crate::core::theme::all::THEMES; -use crate::{config, new_static_files, service, service_for_static_files, trace, LazyStatic}; +use crate::{config, service, service_for_static_files, static_files, trace, LazyStatic}; #[cfg(feature = "database")] use crate::db::*; use std::sync::RwLock; -new_static_files!(base); +static_files!(base); // MODULES ***************************************************************************************** diff --git a/pagetop/src/lib.rs b/pagetop/src/lib.rs index c6569696..27e73965 100644 --- a/pagetop/src/lib.rs +++ b/pagetop/src/lib.rs @@ -131,7 +131,7 @@ pub trait HasHandle { pub type Weight = i8; pub type HashMapResources = std::collections::HashMap<&'static str, StaticResource>; -new_static_locales!(LOCALES_PAGETOP); +static_locales!(LOCALES_PAGETOP); // ************************************************************************************************* // PUBLIC API. diff --git a/pagetop/src/locale.rs b/pagetop/src/locale.rs index 8f9be238..81520c98 100644 --- a/pagetop/src/locale.rs +++ b/pagetop/src/locale.rs @@ -70,13 +70,13 @@ //! # Cómo aplicar la localización en tu código //! //! Una vez hayas creado tu directorio de recursos FTL usa la macro -//! [`new_static_locales!`](crate::new_static_locales) para integrarlos en tu módulo o aplicación. +//! [`static_locales!`](crate::static_locales) para integrarlos en tu módulo o aplicación. //! si tus recursos se encuentran en el directorio `"src/locale"` bastará con declarar: //! //! ``` //! use pagetop::prelude::*; //! -//! new_static_locales!(LOCALES_SAMPLE); +//! static_locales!(LOCALES_SAMPLE); //! ``` //! //! Y si están en otro directorio, entonces puedes usar: @@ -84,7 +84,7 @@ //! ``` //! use pagetop::prelude::*; //! -//! new_static_locales!(LOCALES_SAMPLE in "path/to/locale"); +//! static_locales!(LOCALES_SAMPLE in "path/to/locale"); //! ``` use crate::html::{Markup, PreEscaped}; @@ -142,7 +142,7 @@ pub fn langid_for(language: impl Into) -> Result<&'static LanguageIdenti #[macro_export] /// Define un conjunto de elementos de localización y textos locales de traducción. -macro_rules! new_static_locales { +macro_rules! static_locales { ( $LOCALES:ident $(, $core_locales:literal)? ) => { $crate::locale::fluent_templates::static_loader! { static $LOCALES = { diff --git a/pagetop/src/prelude.rs b/pagetop/src/prelude.rs index bda89011..af7a5d43 100644 --- a/pagetop/src/prelude.rs +++ b/pagetop/src/prelude.rs @@ -15,9 +15,9 @@ pub use crate::{impl_handle, kv}; // crate::config pub use crate::default_settings; // crate::locale -pub use crate::new_static_locales; +pub use crate::static_locales; // crate::service -pub use crate::{new_static_files, service_for_static_files}; +pub use crate::{service_for_static_files, static_files}; // crate::core::actions pub use crate::actions; diff --git a/pagetop/src/service.rs b/pagetop/src/service.rs index 2f079616..9922e88c 100644 --- a/pagetop/src/service.rs +++ b/pagetop/src/service.rs @@ -13,7 +13,7 @@ pub use actix_web_files::Files as ActixFiles; pub use actix_web_static_files::ResourceFiles; #[macro_export] -macro_rules! new_static_files { +macro_rules! static_files { ( $bundle:ident ) => { $crate::paste! { mod [] {