Skip to content

Commit

Permalink
Added translations as primary dimName source (#19)
Browse files Browse the repository at this point in the history
* Added translations as primary dimName source
  • Loading branch information
AnrDaemon authored Mar 14, 2024
1 parent be9ed35 commit b226e66
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/journeymap/client/data/WorldData.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,18 @@ public static String getSafeDimensionName(WorldProvider worldProvider)

try
{
return worldProvider.getDimensionName();
String langKey = String.format("jm.common.dimension.%1$d.name", worldProvider.dimensionId);
String dimName = Constants.getString(langKey);
if (langKey.equals(dimName))
{
dimName = worldProvider.getDimensionName();
}

return dimName;
}
catch (Exception e)
{
JMLogger.logOnce(String.format("Failed to retrieve dimension %d error: ", worldProvider.dimensionId), e);
return Constants.getString("jm.common.dimension", ForgeHelper.INSTANCE.getDimension(worldProvider));
}
}
Expand Down

0 comments on commit b226e66

Please sign in to comment.