Skip to content

Commit

Permalink
removed the config from input params
Browse files Browse the repository at this point in the history
  • Loading branch information
asodugf12 committed Nov 30, 2024
1 parent 98b800d commit 48bbd3b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pumpkin/src/server/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
path::PathBuf,
};

use pumpkin_config::TranslationConfig;
use pumpkin_config::ADVANCED_CONFIG;
use pumpkin_core::text::{style::Style, TextComponent, TextContent};
use serde_json::Value;
use thiserror::Error;
Expand All @@ -23,10 +23,8 @@ pub enum TranslationError {
JsonParse,
}

pub fn translate<'a>(
config: &TranslationConfig,
message: &'a str,
) -> Result<TextComponent<'a>, TranslationError> {
pub fn translate(message: &'_ str) -> Result<TextComponent<'_>, TranslationError> {
let config = &ADVANCED_CONFIG.translation;
if !config.enabled {
let path = "assets/lang/en_us/en_us.json";
let translations = get_translations(path, message)?;
Expand Down

0 comments on commit 48bbd3b

Please sign in to comment.