Skip to content

Commit 33b791f

Browse files
authored
更新日期时间格式 (#3610)
* Revert "improv(i18n): refine time formats on ui (#3608)" This reverts commit 741f65d. * update
1 parent de01946 commit 33b791f

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
import org.jetbrains.annotations.Nullable;
5656

5757
import java.io.File;
58-
import java.time.ZoneId;
59-
import java.time.format.DateTimeFormatter;
60-
import java.time.format.FormatStyle;
6158
import java.util.*;
6259
import java.util.stream.Collectors;
6360
import java.util.stream.Stream;
@@ -388,7 +385,7 @@ private static final class ModItem extends StackPane {
388385
TwoLineListItem content = new TwoLineListItem();
389386
HBox.setHgrow(content, Priority.ALWAYS);
390387
content.setTitle(dataItem.getName());
391-
content.setSubtitle(FORMATTER.format(dataItem.getDatePublished()));
388+
content.setSubtitle(I18n.formatDateTime(dataItem.getDatePublished()));
392389

393390
switch (dataItem.getVersionType()) {
394391
case Alpha:
@@ -528,8 +525,6 @@ private void loadDependencies(RemoteMod.Version version, DownloadPage selfPage,
528525
}
529526
}
530527

531-
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()).withZone(ZoneId.systemDefault());
532-
533528
public interface DownloadCallback {
534529
void download(Profile profile, @Nullable String version, RemoteMod.Version file);
535530
}

HMCL/src/main/java/org/jackhuang/hmcl/util/i18n/I18n.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.time.Instant;
2323
import java.time.ZoneId;
2424
import java.time.format.DateTimeFormatter;
25-
import java.time.format.FormatStyle;
2625
import java.util.*;
2726

2827
import static org.jackhuang.hmcl.util.logging.Logger.LOG;
@@ -78,7 +77,7 @@ public static String i18n(String key) {
7877
public static String formatDateTime(Instant instant) {
7978
DateTimeFormatter formatter = dateTimeFormatter;
8079
if (formatter == null) {
81-
formatter = dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).withLocale(Locale.getDefault()).withZone(ZoneId.systemDefault());
80+
formatter = dateTimeFormatter = DateTimeFormatter.ofPattern(getResourceBundle().getString("world.time")).withZone(ZoneId.systemDefault());
8281
}
8382

8483
return formatter.format(instant);

HMCL/src/main/java/org/jackhuang/hmcl/util/i18n/Locales.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private Locales() {
3737
/**
3838
* English
3939
*/
40-
public static final SupportedLocale EN = new SupportedLocale(Locale.US);
40+
public static final SupportedLocale EN = new SupportedLocale(Locale.ENGLISH);
4141

4242
/**
4343
* Spanish

HMCL/src/main/resources/assets/lang/I18N.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ world.name=World Name
10881088
world.name.enter=Enter the world name
10891089
world.reveal=Reveal in Explorer
10901090
world.show_all=Show All
1091+
world.time=h\:mm\:ss a, EEE, MMM d yyyy
10911092

10921093
profile=Game Directories
10931094
profile.already_exists=This name already exists. Please use a different name.

HMCL/src/main/resources/assets/lang/I18N_es.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ world.name=Nombre del mundo
10351035
world.name.enter=Introducir el nombre del mundo
10361036
world.reveal=Abrir en el Explorador
10371037
world.show_all=Mostrar todo
1038+
world.time=EEE, MMM d, yyyy HH\:mm\:ss
10381039

10391040
profile=Directorios del juego
10401041
profile.already_exists=Este nombre ya existe, por favor, utilice un nombre diferente.

HMCL/src/main/resources/assets/lang/I18N_ja.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ world.name=マップ名
717717
world.name.enter=マップ名を入力してください
718718
world.reveal=フォルダを表示
719719
world.show_all=すべて表示
720+
world.time=EEE、MMM d、yyyy HH:mm:ss
720721

721722
profile=ゲームディレクトリ
722723
profile.already_exists=この名前はすでに存在します。別の名前を使用してください。

HMCL/src/main/resources/assets/lang/I18N_ru.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ world.name=Название мира
776776
world.name.enter=Введите название мира
777777
world.reveal=Показать в проводнике
778778
world.show_all=Показать все
779+
world.time=EEE, MMM d, yyyy HH\:mm\:ss
779780

780781
profile=Папки с играми
781782
profile.already_exists=Имя уже существует, используйте другое имя.

HMCL/src/main/resources/assets/lang/I18N_zh.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,7 @@ world.name=世界名稱
892892
world.name.enter=輸入世界名稱
893893
world.reveal=開啟目錄
894894
world.show_all=全部顯示
895+
world.time=yyyy 年 MM 月 dd 日 HH:mm:ss
895896

896897
profile=遊戲目錄
897898
profile.already_exists=該名稱已存在

HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ world.name=世界名称
903903
world.name.enter=输入世界名称
904904
world.reveal=打开文件夹
905905
world.show_all=显示全部
906+
world.time=yyyy 年 MM 月 dd 日 HH:mm:ss
906907

907908
profile=游戏文件夹
908909
profile.already_exists=该名称已存在

0 commit comments

Comments
 (0)