Less warnings & Speeeeed!!
This commit is contained in:
parent
af1088e9fb
commit
42cfada4a7
22 changed files with 312 additions and 403 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::util::file_util::{self, save_file};
|
||||
use json::{self, JsonValue};
|
||||
use crate::util::file_util::save_file;
|
||||
use json::{self, JsonError, JsonValue};
|
||||
|
||||
pub fn create_languages() {
|
||||
pub fn create_languages() -> Result<(), JsonError> {
|
||||
let mut frontend_messages = JsonValue::new_object();
|
||||
let mut omikron_messages = JsonValue::new_object();
|
||||
let mut button_texts = JsonValue::new_object();
|
||||
|
|
@ -9,40 +9,43 @@ pub fn create_languages() {
|
|||
let mut debug_messages = JsonValue::new_object();
|
||||
|
||||
// FRONTEND
|
||||
frontend_messages.insert("get_chats", "User {} is loading conversations");
|
||||
frontend_messages.insert("message_get", "User {} is loading messages");
|
||||
frontend_messages.insert("get_communities", "User {} is loading communities");
|
||||
frontend_messages.insert("client_connected", "Client {} connected");
|
||||
frontend_messages.insert("add_conversation", "User {} added {}");
|
||||
frontend_messages.insert("get_chats", "User {} is loading conversations")?;
|
||||
frontend_messages.insert("message_get", "User {} is loading messages")?;
|
||||
frontend_messages.insert("get_communities", "User {} is loading communities")?;
|
||||
frontend_messages.insert("client_connected", "Client {} connected")?;
|
||||
frontend_messages.insert("add_conversation", "User {} added {}")?;
|
||||
frontend_messages.insert("message_send", "User {} sent a message")?;
|
||||
|
||||
// OMIKRON
|
||||
omikron_messages.insert(
|
||||
"identification_response",
|
||||
"IOTA identified on Omikron, {} users!",
|
||||
);
|
||||
)?;
|
||||
omikron_messages.insert("send_message_failed", "Failed to send message to Omikron")?;
|
||||
|
||||
// BUTTONS
|
||||
button_texts.insert("exit", "Exit");
|
||||
button_texts.insert("exit", "Exit")?;
|
||||
|
||||
// GENERAL
|
||||
general_texts.insert("iota_id", "IOTA ID: {}-####-####-####-############");
|
||||
general_texts.insert("user_id", "USER ID: {}");
|
||||
general_texts.insert("user_ids", "USER IDS: {}");
|
||||
general_texts.insert("setup_completed", "Launched");
|
||||
general_texts.insert("iota_id", "IOTA ID: {}-####-####-####-############")?;
|
||||
general_texts.insert("user_id", "USER ID: {}")?;
|
||||
general_texts.insert("user_ids", "USER IDS: {}")?;
|
||||
general_texts.insert("user_load_failed", "Failed to load user data")?;
|
||||
general_texts.insert("setup_completed", "Launched")?;
|
||||
general_texts.insert(
|
||||
"community_active",
|
||||
"Communities active on ws://0.0.0.0:{}/community/...",
|
||||
);
|
||||
)?;
|
||||
general_texts.insert(
|
||||
"community_start_error",
|
||||
"Failed to start community socket on port {}!",
|
||||
);
|
||||
)?;
|
||||
general_texts.insert(
|
||||
"community_start_error_admin",
|
||||
"Failed to start community socket on port {}! Run with admin privileges",
|
||||
);
|
||||
)?;
|
||||
// DEBUG
|
||||
debug_messages.insert("", "");
|
||||
debug_messages.insert("", "")?;
|
||||
save_file(
|
||||
"languages/en_INT",
|
||||
"frontend.json",
|
||||
|
|
@ -68,4 +71,5 @@ pub fn create_languages() {
|
|||
"general.json",
|
||||
&general_texts.to_string(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue