🚚 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::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_ADMIN);
|
static_locales!(LOCALES_ADMIN);
|
||||||
|
|
||||||
mod summary;
|
mod summary;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_BOOTSIER);
|
static_locales!(LOCALES_BOOTSIER);
|
||||||
|
|
||||||
new_static_files!(bootsier);
|
static_files!(bootsier);
|
||||||
|
|
||||||
pub struct Bootsier;
|
pub struct Bootsier;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
//! ```rust#ignore
|
//! ```rust#ignore
|
||||||
//! use pagetop::prelude::*;
|
//! 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:
|
//! Also you can get the bundle as a static reference to the generated HashMap resources collection:
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
//! ```rust#ignore
|
//! ```rust#ignore
|
||||||
//! use pagetop::prelude::*;
|
//! 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.
|
//! You can build more than one resources file to compile with your project.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_files!(bulmix);
|
static_files!(bulmix);
|
||||||
|
|
||||||
pub struct Bulmix;
|
pub struct Bulmix;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_HOMEDEMO);
|
static_locales!(LOCALES_HOMEDEMO);
|
||||||
|
|
||||||
new_static_files!(homedemo);
|
static_files!(homedemo);
|
||||||
|
|
||||||
pub struct HomeDemo;
|
pub struct HomeDemo;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_NODE);
|
static_locales!(LOCALES_NODE);
|
||||||
|
|
||||||
//mod entity;
|
//mod entity;
|
||||||
mod migration;
|
mod migration;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_USER);
|
static_locales!(LOCALES_USER);
|
||||||
|
|
||||||
mod migration;
|
mod migration;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
use crate::core::action::add_action;
|
use crate::core::action::add_action;
|
||||||
use crate::core::module::ModuleRef;
|
use crate::core::module::ModuleRef;
|
||||||
use crate::core::theme::all::THEMES;
|
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")]
|
#[cfg(feature = "database")]
|
||||||
use crate::db::*;
|
use crate::db::*;
|
||||||
|
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
|
|
||||||
new_static_files!(base);
|
static_files!(base);
|
||||||
|
|
||||||
// MODULES *****************************************************************************************
|
// MODULES *****************************************************************************************
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ pub trait HasHandle {
|
||||||
pub type Weight = i8;
|
pub type Weight = i8;
|
||||||
pub type HashMapResources = std::collections::HashMap<&'static str, StaticResource>;
|
pub type HashMapResources = std::collections::HashMap<&'static str, StaticResource>;
|
||||||
|
|
||||||
new_static_locales!(LOCALES_PAGETOP);
|
static_locales!(LOCALES_PAGETOP);
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// PUBLIC API.
|
// PUBLIC API.
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,13 @@
|
||||||
//! # Cómo aplicar la localización en tu código
|
//! # Cómo aplicar la localización en tu código
|
||||||
//!
|
//!
|
||||||
//! Una vez hayas creado tu directorio de recursos FTL usa la macro
|
//! 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:
|
//! si tus recursos se encuentran en el directorio `"src/locale"` bastará con declarar:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use pagetop::prelude::*;
|
//! use pagetop::prelude::*;
|
||||||
//!
|
//!
|
||||||
//! new_static_locales!(LOCALES_SAMPLE);
|
//! static_locales!(LOCALES_SAMPLE);
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! Y si están en otro directorio, entonces puedes usar:
|
//! Y si están en otro directorio, entonces puedes usar:
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! use pagetop::prelude::*;
|
//! 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};
|
use crate::html::{Markup, PreEscaped};
|
||||||
|
|
@ -142,7 +142,7 @@ pub fn langid_for(language: impl Into<String>) -> Result<&'static LanguageIdenti
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
/// Define un conjunto de elementos de localización y textos locales de traducción.
|
/// 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)? ) => {
|
( $LOCALES:ident $(, $core_locales:literal)? ) => {
|
||||||
$crate::locale::fluent_templates::static_loader! {
|
$crate::locale::fluent_templates::static_loader! {
|
||||||
static $LOCALES = {
|
static $LOCALES = {
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ pub use crate::{impl_handle, kv};
|
||||||
// crate::config
|
// crate::config
|
||||||
pub use crate::default_settings;
|
pub use crate::default_settings;
|
||||||
// crate::locale
|
// crate::locale
|
||||||
pub use crate::new_static_locales;
|
pub use crate::static_locales;
|
||||||
// crate::service
|
// crate::service
|
||||||
pub use crate::{new_static_files, service_for_static_files};
|
pub use crate::{service_for_static_files, static_files};
|
||||||
// crate::core::actions
|
// crate::core::actions
|
||||||
pub use crate::actions;
|
pub use crate::actions;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ pub use actix_web_files::Files as ActixFiles;
|
||||||
pub use actix_web_static_files::ResourceFiles;
|
pub use actix_web_static_files::ResourceFiles;
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! new_static_files {
|
macro_rules! static_files {
|
||||||
( $bundle:ident ) => {
|
( $bundle:ident ) => {
|
||||||
$crate::paste! {
|
$crate::paste! {
|
||||||
mod [<static_files_ $bundle>] {
|
mod [<static_files_ $bundle>] {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue