Add a localization string to default Fabric API resource pack ()

* Update FabricModResourcePack.java

* Update en_us.json

* Update et_ee.json

* Use the newer method

* Fallback as a variable
This commit is contained in:
Madis Otenurm 2023-02-22 14:54:59 +02:00 committed by GitHub
parent ae0966baae
commit 711cde8a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions
fabric-resource-loader-v0/src/main
java/net/fabricmc/fabric/impl/resource/loader
resources/assets/fabric-resource-loader-v0/lang

View file

@ -47,8 +47,9 @@ public class FabricModResourcePack extends GroupResourcePack {
String fileName = String.join("/", pathSegments);
if ("pack.mcmeta".equals(fileName)) {
String description = "Mod resources.";
String pack = String.format("{\"pack\":{\"pack_format\":" + SharedConstants.getGameVersion().getResourceVersion(type) + ",\"description\":\"%s\"}}", description);
String description = "pack.description.modResources";
String fallback = "Mod resources.";
String pack = String.format("{\"pack\":{\"pack_format\":" + SharedConstants.getGameVersion().getResourceVersion(type) + ",\"description\":{\"translate\":\"%s\",\"fallback\":\"%s.\"}}}", description, fallback);
return () -> IOUtils.toInputStream(pack, Charsets.UTF_8);
} else if ("pack.png".equals(fileName)) {
return FabricLoader.getInstance().getModContainer("fabric-resource-loader-v0")

View file

@ -1,4 +1,5 @@
{
"pack.description.modResources": "Mod resources.",
"pack.source.fabricmod": "Fabric mod",
"pack.source.builtinMod": "built-in: %s",
"pack.name.fabricMod": "Fabric Mod \"%s\"",

View file

@ -1,4 +1,5 @@
{
"pack.description.modResources": "Modide ressursid.",
"pack.source.fabricmod": "Fabricu mod",
"pack.source.builtinMod": "sisseeh.: %s"
}