🚚 Rename "new_static_..!" macros to "static_..!"
This commit is contained in:
parent
088ffe7272
commit
0397036d95
12 changed files with 20 additions and 20 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
new_static_locales!(LOCALES_ADMIN);
|
||||
static_locales!(LOCALES_ADMIN);
|
||||
|
||||
mod summary;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
new_static_files!(bulmix);
|
||||
static_files!(bulmix);
|
||||
|
||||
pub struct Bulmix;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
new_static_locales!(LOCALES_NODE);
|
||||
static_locales!(LOCALES_NODE);
|
||||
|
||||
//mod entity;
|
||||
mod migration;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use pagetop::prelude::*;
|
||||
|
||||
new_static_locales!(LOCALES_USER);
|
||||
static_locales!(LOCALES_USER);
|
||||
|
||||
mod migration;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 *****************************************************************************************
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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<String>) -> 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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 [<static_files_ $bundle>] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue