veloren/voxygen/i18n/src/raw.rs

37 lines
914 B
Rust
Raw Normal View History

use crate::{Fonts, LanguageMetadata};
use serde::{Deserialize, Serialize};
2021-07-23 11:32:00 +00:00
use std::str::FromStr;
/// Localization metadata from manifest file
2021-07-23 11:32:00 +00:00
/// See `Language` for more info on each attributes
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub(crate) struct Manifest {
2021-07-23 11:32:00 +00:00
pub(crate) convert_utf8_to_ascii: bool,
pub(crate) fonts: Fonts,
pub(crate) metadata: LanguageMetadata,
}
impl crate::assets::Asset for Manifest {
type Loader = crate::assets::RonLoader;
const EXTENSION: &'static str = "ron";
2021-07-23 11:32:00 +00:00
}
#[derive(Clone)]
pub(crate) struct Resource {
pub(crate) src: String,
2021-07-23 11:32:00 +00:00
}
impl FromStr for Resource {
type Err = std::convert::Infallible;
2021-07-23 11:32:00 +00:00
fn from_str(s: &str) -> Result<Self, Self::Err> { Ok(Self { src: s.to_owned() }) }
2021-07-23 11:32:00 +00:00
}
impl crate::assets::Asset for Resource {
type Loader = crate::assets::loader::ParseLoader;
2021-07-23 11:32:00 +00:00
const EXTENSION: &'static str = "ftl";
}