default Override text and textArgs
This commit is contained in:
@ -4,6 +4,8 @@ import com.imyeyu.java.bean.Language;
|
||||
import com.imyeyu.java.bean.LanguageMapping;
|
||||
import com.imyeyu.utils.StringInterpolator;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 夜雨
|
||||
* @version 2024-04-01 16:25
|
||||
@ -27,4 +29,15 @@ public abstract class AbstractLanguageMapper implements LanguageMapping {
|
||||
public void setDebugging(boolean debugging) {
|
||||
isDebugging = debugging;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String text(String key, String def) {
|
||||
String result = text(key);
|
||||
return result.equals(key) ? def : result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String textArgs(String key, Map<String, Object> args) {
|
||||
return INTERPOLATOR.inject(text(key), args);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user