Unverified Commit 96576a95 authored by Licho's avatar Licho Committed by GitHub

explicit set locale default value (#2376)

* refactor: explicit set default locale * fix: task information changed function * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent b4b18f73
......@@ -34,7 +34,10 @@ public final class I18n {
private static final Logger logger = LoggerFactory.getLogger(I18n.class);
private static final String MESSAGES_BASE = "i18n.messages";
private static ResourceBundle bundle;
static {
Locale.setDefault(Locale.US);
}
private I18n() {}
......@@ -52,7 +55,7 @@ public final class I18n {
}
public static String getMessage(String key) {
bundle = ResourceBundle.getBundle(MESSAGES_BASE);
ResourceBundle bundle = ResourceBundle.getBundle(MESSAGES_BASE);
String message = bundle.getString(key);
if (!JDK_ABOVE_1_8) {
message = new String(message.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
......
......@@ -150,7 +150,6 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => {
form.setFieldValue('tokenValue', tokenValue);
};
return (
<>
<ModalForm<SysToken>
......@@ -165,7 +164,7 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => {
initialValues={{ ...value }}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
onCancel: () => handleCancel()
}}
>
<TokenForm expireType={expireType} buildToken={handleBuildToken} />
......
......@@ -183,6 +183,7 @@ const DataStudio = (props: any) => {
console.log('changed', key, info[key], params.taskData[key]);
return true;
}
return false;
});
if (changed) {
......
......@@ -149,7 +149,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
submitter={{ render: () => [...renderFooter()] }}
modalProps={{
destroyOnClose: true,
onCancel: () => handleModalVisible(false),
onCancel: () => handleModalVisible(false)
}}
>
{renderAlertGroupForm()}
......
......@@ -111,7 +111,7 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => {
initialValues={values}
modalProps={{
destroyOnClose: true,
onCancel: () => handleCancel(),
onCancel: () => handleCancel()
}}
>
<ProjectForm values={values} form={form} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment