Added everything

This commit is contained in:
ElBe
2023-09-14 07:33:47 +02:00
parent db56f981ed
commit 4fca364541
35 changed files with 1155 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
use localizer_rs;
fn main() {
let config: localizer_rs::Config = localizer_rs::Config::new("translations", "en");
println!("{:}", config.t("error", vec![("details", "Something went wrong when trying to do stuff")]));
println!("{:}", config.t("success", vec![("balance", "$10"), ("user", "John Doe")]));
println!("{:}", config.t("all", vec![]));
}
+7
View File
@@ -0,0 +1,7 @@
{
"test": "Something that can be translated.",
"error": "{{color.red}}{{bold}}Error:{{end}} {{details}}",
"success": "{{color.green}}{{bold}}Success:{{end}} Successfully transferred {{balance}} to {{user}}",
"all": "{{bold}}{{underline}}Formatting options:{{end}}\n\n{{bold}}Bold text{{end}}\n{{italic}}Italic text{{end}}\n{{underline}}Underlined text{{end}}\n{{overline}}Overlined text{{end}}\n\n{{bold}}{{underline}}Colored text:{{end}}\n\n{{back.white}}{{color.black}}Black text{{end}}\n{{color.red}}Red text{{end}}\n{{color.green}}Green text{{end}}\n{{color.yellow}}Yellow text{{end}}\n{{color.blue}}Blue text{{end}}\n{{color.magenta}}Magenta text{{end}}\n{{color.cyan}}Cyan text{{end}}\n{{color.white}}White text{{end}}\n\n{{bold}}{{underline}}Bright colored text:{{end}}\n\n{{color.bright_black}}Bright black text{{end}}\n{{color.bright_red}}Bright red text{{end}}\n{{color.bright_green}}Bright green text{{end}}\n{{color.bright_yellow}}Bright yellow text{{end}}\n{{color.bright_blue}}Bright blue text{{end}}\n{{color.bright_magenta}}Bright magenta text{{end}}\n{{color.bright_cyan}}Bright cyan text{{end}}\n{{color.bright_white}}Bright white text{{end}}\n\n{{bold}}{{underline}}Colored background:{{end}}\n\n{{back.black}}Black background{{end}}\n{{back.red}}Red background{{end}}\n{{back.green}}Green text (background:{{end}}\n{{back.yellow}}Yellow background{{end}}\n{{back.blue}}Blue background{{end}}\n{{back.magenta}}Magenta background{{end}}\n{{back.cyan}}Cyan background{{end}}\n{{color.black}}{{back.white}}White background{{end}}\n{{back.bright_black}}Bright black background{{end}}\n{{back.bright_red}}Bright red background{{end}}\n{{back.bright_green}}Bright green background{{end}}\n{{back.bright_yellow}}Bright yellow background{{end}}\n{{back.bright_blue}}Bright blue background{{end}}\n{{back.bright_magenta}}Bright magenta background{{end}}\n{{back.bright_cyan}}Bright cyan background{{end}}\n{{back.bright_white}}Bright white background{{end}}"
}