diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java index b25d7b9c9..8c220ae6d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java @@ -399,7 +399,7 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP protected void updateControl(RemoteMod dataItem, boolean empty) { if (empty) return; ModTranslations.Mod mod = ModTranslations.getTranslationsByRepositoryType(getSkinnable().repository.getType()).getModByCurseForgeId(dataItem.getSlug()); - content.setTitle(mod != null ? mod.getDisplayName() : dataItem.getTitle()); + content.setTitle(mod != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA ? mod.getDisplayName() : dataItem.getTitle()); content.setSubtitle(dataItem.getDescription()); content.getTags().setAll(dataItem.getCategories().stream() .map(category -> getSkinnable().getLocalizedCategory(category)) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java index cc15e8898..24d993f3e 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java @@ -51,6 +51,7 @@ import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; import org.jackhuang.hmcl.util.SimpleMultimap; import org.jackhuang.hmcl.util.StringUtils; +import org.jackhuang.hmcl.util.i18n.I18n; import org.jackhuang.hmcl.util.io.NetworkUtils; import org.jackhuang.hmcl.util.versioning.VersionNumber; import org.jetbrains.annotations.Nullable; @@ -246,7 +247,7 @@ public class DownloadPage extends Control implements DecoratorPage { TwoLineListItem content = new TwoLineListItem(); HBox.setHgrow(content, Priority.ALWAYS); ModTranslations.Mod mod = getSkinnable().translations.getModByCurseForgeId(getSkinnable().addon.getSlug()); - content.setTitle(mod != null ? mod.getDisplayName() : getSkinnable().addon.getTitle()); + content.setTitle(mod != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA ? mod.getDisplayName() : getSkinnable().addon.getTitle()); content.setSubtitle(getSkinnable().addon.getDescription()); content.getTags().setAll(getSkinnable().addon.getCategories().stream() .map(category -> getSkinnable().page.getLocalizedCategory(category)) @@ -351,7 +352,7 @@ public class DownloadPage extends Control implements DecoratorPage { getChildren().setAll(container); ModTranslations.Mod mod = ModTranslations.getTranslationsByRepositoryType(page.repository.getType()).getModByCurseForgeId(addon.getSlug()); - content.setTitle(mod != null ? mod.getDisplayName() : addon.getTitle()); + content.setTitle(mod != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA ? mod.getDisplayName() : addon.getTitle()); content.setSubtitle(addon.getDescription()); content.getTags().setAll(addon.getCategories().stream() .map(page::getLocalizedCategory) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModUpdatesPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModUpdatesPage.java index 5f21966d5..2e55f22d1 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModUpdatesPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModUpdatesPage.java @@ -39,11 +39,13 @@ import org.jackhuang.hmcl.ui.Controllers; import org.jackhuang.hmcl.ui.construct.*; import org.jackhuang.hmcl.ui.decorator.DecoratorPage; import org.jackhuang.hmcl.util.Pair; +import org.jackhuang.hmcl.util.i18n.I18n; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Locale; import java.util.function.Function; import java.util.stream.Collectors; @@ -166,7 +168,7 @@ public class ModUpdatesPage extends BorderPane implements DecoratorPage { protected void updateControl(LocalModFile.ModUpdate item, boolean empty) { if (empty) return; ModTranslations.Mod mod = ModTranslations.MOD.getModById(item.getLocalMod().getId()); - content.setTitle(mod != null ? mod.getDisplayName() : item.getCurrentVersion().getName()); + content.setTitle(mod != null && I18n.getCurrentLocale().getLocale() == Locale.CHINA ? mod.getDisplayName() : item.getCurrentVersion().getName()); content.setSubtitle(item.getLocalMod().getFileName()); content.getTags().setAll();