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 { ...@@ -34,7 +34,10 @@ public final class I18n {
private static final Logger logger = LoggerFactory.getLogger(I18n.class); private static final Logger logger = LoggerFactory.getLogger(I18n.class);
private static final String MESSAGES_BASE = "i18n.messages"; private static final String MESSAGES_BASE = "i18n.messages";
private static ResourceBundle bundle;
static {
Locale.setDefault(Locale.US);
}
private I18n() {} private I18n() {}
...@@ -52,7 +55,7 @@ public final class I18n { ...@@ -52,7 +55,7 @@ public final class I18n {
} }
public static String getMessage(String key) { public static String getMessage(String key) {
bundle = ResourceBundle.getBundle(MESSAGES_BASE); ResourceBundle bundle = ResourceBundle.getBundle(MESSAGES_BASE);
String message = bundle.getString(key); String message = bundle.getString(key);
if (!JDK_ABOVE_1_8) { if (!JDK_ABOVE_1_8) {
message = new String(message.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); message = new String(message.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
......
...@@ -150,7 +150,6 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => { ...@@ -150,7 +150,6 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => {
form.setFieldValue('tokenValue', tokenValue); form.setFieldValue('tokenValue', tokenValue);
}; };
return ( return (
<> <>
<ModalForm<SysToken> <ModalForm<SysToken>
...@@ -165,7 +164,7 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => { ...@@ -165,7 +164,7 @@ const TokenModalForm: React.FC<TokenModalFormProps & connect> = (props) => {
initialValues={{ ...value }} initialValues={{ ...value }}
modalProps={{ modalProps={{
destroyOnClose: true, destroyOnClose: true,
onCancel: () => handleCancel(), onCancel: () => handleCancel()
}} }}
> >
<TokenForm expireType={expireType} buildToken={handleBuildToken} /> <TokenForm expireType={expireType} buildToken={handleBuildToken} />
......
...@@ -183,6 +183,7 @@ const DataStudio = (props: any) => { ...@@ -183,6 +183,7 @@ const DataStudio = (props: any) => {
console.log('changed', key, info[key], params.taskData[key]); console.log('changed', key, info[key], params.taskData[key]);
return true; return true;
} }
return false;
}); });
if (changed) { if (changed) {
......
...@@ -149,7 +149,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => { ...@@ -149,7 +149,7 @@ const AlertGroupForm: React.FC<AlertGroupFormProps> = (props) => {
submitter={{ render: () => [...renderFooter()] }} submitter={{ render: () => [...renderFooter()] }}
modalProps={{ modalProps={{
destroyOnClose: true, destroyOnClose: true,
onCancel: () => handleModalVisible(false), onCancel: () => handleModalVisible(false)
}} }}
> >
{renderAlertGroupForm()} {renderAlertGroupForm()}
......
...@@ -111,7 +111,7 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => { ...@@ -111,7 +111,7 @@ const ProjectModal: React.FC<ProjectModalProps> = (props) => {
initialValues={values} initialValues={values}
modalProps={{ modalProps={{
destroyOnClose: true, destroyOnClose: true,
onCancel: () => handleCancel(), onCancel: () => handleCancel()
}} }}
> >
<ProjectForm values={values} form={form} /> <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