🔥 Elimina código para simplificar localización
This commit is contained in:
parent
778e90e8e3
commit
0c385e7080
1 changed files with 2 additions and 14 deletions
|
|
@ -4,19 +4,10 @@ use crate::core::component::*;
|
||||||
use crate::core::hook::{action_ref, run_actions};
|
use crate::core::hook::{action_ref, run_actions};
|
||||||
use crate::html::{html, AttributeValue, Classes, ClassesOp, Favicon, Markup, DOCTYPE};
|
use crate::html::{html, AttributeValue, Classes, ClassesOp, Favicon, Markup, DOCTYPE};
|
||||||
use crate::response::FatalError;
|
use crate::response::FatalError;
|
||||||
use crate::{config, fn_builder, server, trace, LazyStatic};
|
use crate::{config, fn_builder, locale, server, trace, LazyStatic};
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
static DEFAULT_LANGUAGE: LazyStatic<Option<String>> = LazyStatic::new(|| {
|
|
||||||
let language = config::SETTINGS.app.language[..2].to_lowercase();
|
|
||||||
if !language.is_empty() {
|
|
||||||
Some(language)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
static DEFAULT_DIRECTION: LazyStatic<Option<String>> = LazyStatic::new(|| {
|
static DEFAULT_DIRECTION: LazyStatic<Option<String>> = LazyStatic::new(|| {
|
||||||
let direction = config::SETTINGS.app.direction.to_lowercase();
|
let direction = config::SETTINGS.app.direction.to_lowercase();
|
||||||
match direction.as_str() {
|
match direction.as_str() {
|
||||||
|
|
@ -60,10 +51,7 @@ impl Default for Page {
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Page {
|
Page {
|
||||||
language : match &*DEFAULT_LANGUAGE {
|
language : AttributeValue::new().with_value(locale::LANGID.language.as_str()),
|
||||||
Some(language) => AttributeValue::new().with_value(language),
|
|
||||||
_ => AttributeValue::new(),
|
|
||||||
},
|
|
||||||
direction : match &*DEFAULT_DIRECTION {
|
direction : match &*DEFAULT_DIRECTION {
|
||||||
Some(direction) => AttributeValue::new().with_value(direction),
|
Some(direction) => AttributeValue::new().with_value(direction),
|
||||||
_ => AttributeValue::new(),
|
_ => AttributeValue::new(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue