Improve language manager (#116)
* Clarify replacements internally to reduce the likelihood of messing up when including new ones * Fix missing keys not being written to disk for easy translation * Use a guessfile-like system where missing translation keys are inserted into a separate section for easy identification * Reduce verbosity of missing keys warning
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.lishid.openinv.internal;
|
||||
|
||||
import com.lishid.openinv.OpenInv;
|
||||
import com.lishid.openinv.util.lang.Replacement;
|
||||
import java.util.Objects;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -73,8 +74,7 @@ public class OpenInventoryView extends InventoryView {
|
||||
.getLocalizedMessage(
|
||||
player,
|
||||
titleKey,
|
||||
"%player%",
|
||||
owner.getName());
|
||||
new Replacement("%player%", owner.getName()));
|
||||
title = Objects.requireNonNullElseGet(localTitle, () -> owner.getName() + titleDefaultSuffix);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user