chore: clean up a bit
This commit is contained in:
parent
fa4fa75944
commit
6ede586866
@ -19,13 +19,6 @@ public class Translater {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
private static final TransformingMap map = new TransformingMap(new CachingTransformer(new TranslatingTransformer<>(TranslateService.getConfigured())));
|
||||
|
||||
public static boolean progressUIEnabled() {
|
||||
return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Gui;
|
||||
}
|
||||
public static boolean progressLogsEnabled() {
|
||||
return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Console;
|
||||
}
|
||||
|
||||
public static @NotNull TransformingMap getMap(@Nullable Map<String, String> base) {
|
||||
if (base != null) map.updateBacker(base);
|
||||
return map;
|
||||
|
@ -1,9 +1,8 @@
|
||||
package io.gitlab.jfronny.translater.transformer;
|
||||
|
||||
import io.gitlab.jfronny.translater.Cfg;
|
||||
import io.gitlab.jfronny.translater.RenderScheduler;
|
||||
import io.gitlab.jfronny.translater.Translater;
|
||||
import io.gitlab.jfronny.translater.mixin.MinecraftClientAccessor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
@ -69,10 +69,8 @@ public class TranslatingTransformer<T extends Language> implements Transformer {
|
||||
} else {
|
||||
return translateMultiple(str);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
Translater.LOGGER.warn("Failed to transform: \"{}\" ({} characters)", str, str.length());
|
||||
Translater.LOGGER.warn("Please report this bug with the mod containing the lang file");
|
||||
} catch (Exception e) {
|
||||
Translater.LOGGER.warn("Failed to transform: \"{}\" ({} characters)! Please report this bug with the mod containing the lang file! ({})", str, str.length(), e.getLocalizedMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -109,7 +107,8 @@ public class TranslatingTransformer<T extends Language> implements Transformer {
|
||||
if (Cfg.detailedProgress) Translater.LOGGER.info("Transformed: \"{}\" to: \"{}\"", str, currentState);
|
||||
return currentState;
|
||||
} catch (Exception e) {
|
||||
Translater.LOGGER.warn("Failed to break: \"{}\" ({} characters). Is your API key valid?", m.group(2), m.group(2).length());
|
||||
String s = m.group(2);
|
||||
Translater.LOGGER.warn("Failed to break: \"{}\" ({} characters). Is your API key valid? ({})", s, s.length(), e.getLocalizedMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user