Skip to content

Commit

Permalink
refactor: delombok getters
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1011 committed Nov 13, 2024
1 parent b2b4969 commit af93067
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import de.ole101.i18n.api.PluginTranslationRegistry;
import de.ole101.i18n.api.configurations.TranslationConfiguration;
import de.ole101.i18n.api.services.TranslationService;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.kyori.adventure.translation.GlobalTranslator;
import net.kyori.adventure.translation.TranslationRegistry;
Expand All @@ -20,7 +19,6 @@
* This class provides methods to initialize the translation service and register resource bundles.
*/
@Slf4j
@Getter
public class TranslationServiceImpl implements TranslationService {

private TranslationRegistry translationRegistry;
Expand Down Expand Up @@ -67,4 +65,30 @@ public void registerBundle(@NotNull String namespace, @NotNull Locale locale) {
log.error("Failed to load resource bundle: {} for locale: {}", namespace, locale, exception);
}
}

/**
* Returns the current translation registry.
*
* @return the current translation configuration
*/
public TranslationRegistry getTranslationRegistry() {
if (this.translationRegistry == null) {
throw new IllegalStateException("Translation service not initialized");
}

return this.translationRegistry;
}

/**
* Returns the current translation configuration.
*
* @return the current translation configuration
*/
public TranslationConfiguration getConfiguration() {
if (this.configuration == null) {
throw new IllegalStateException("Translation service not initialized");
}

return this.configuration;
}
}

0 comments on commit af93067

Please sign in to comment.