Skip to content

Commit 103ddb0

Browse files
authored
tweak how and when the 'v' prefix is applied by the update checker (#965)
* fix: non-numeric update versions getting v prefix * chore: update lang files for update checker change - Fix non-numeric update versions getting v prefix (thanks JustPyrrha)
1 parent 0ee953c commit 103ddb0

153 files changed

Lines changed: 162 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/com/terraformersmc/modmenu/util/mod/ModrinthUpdateInfo.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ public boolean isUpdateAvailable() {
1515
return true;
1616
}
1717

18-
@Override
19-
public @NotNull Component getUpdateMessage() {
20-
return Component.translatable("modmenu.updateText", VersionUtil.stripPrefix(this.versionNumber), MODRINTH_TEXT);
21-
}
18+
@Override
19+
public @NotNull Component getUpdateMessage() {
20+
String versionNoPrefix = VersionUtil.stripPrefix(this.versionNumber);
21+
String key = "modmenu.updateText";
22+
if (!Character.isDigit(versionNoPrefix.charAt(0))) {
23+
key += ".nonNumerical";
24+
}
25+
return Component.translatable(key, versionNoPrefix, MODRINTH_TEXT);
26+
}
2227

2328
@Override
2429
public String getDownloadLink() {

src/main/resources/assets/modmenu/lang/af_za.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumeric": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/an-ES.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/ar_sa.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "اشترِ لي كوب قهوة",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/ast_es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/az_az.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/ba_ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/bak.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Buy Me a Coffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/bar.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"modmenu.hasUpdate": "An update is available:",
5555
"modmenu.childHasUpdate": "A child of this mod has an update available.",
5656
"modmenu.updateText": "v%s on %s",
57+
"modmenu.updateText.nonNumerical": "%s on %s",
5758
"modmenu.buymeacoffee": "Kauf mir einen Kaffee",
5859
"modmenu.coindrop": "Coindrop",
5960
"modmenu.crowdin": "Crowdin",

src/main/resources/assets/modmenu/lang/be_by.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"modmenu.experimental": "(Праверка абнаўленняў у Mod Menu з'яўляецца эксперыментам!)",
6464
"modmenu.childHasUpdate": "Абнаўленне дзіцячага мода даступна.",
6565
"modmenu.updateText": "v%s на %s",
66+
"modmenu.updateText.nonNumerical": "%s на %s",
6667
"modmenu.install_version": "Усталяваць версію %s",
6768
"modmenu.downloadLink": "Спампаваць",
6869

0 commit comments

Comments
 (0)