From 5a0983d867125db4ae2f3d2f8338b5e2291d2c20 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 6 Jan 2012 01:02:56 -0600 Subject: [PATCH] Add customization/translation for "Players" and "Map Types" UI labels --- src/main/java/org/dynmap/ClientConfigurationComponent.java | 2 ++ src/main/resources/configuration.txt | 5 +++++ web/js/map.js | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/ClientConfigurationComponent.java b/src/main/java/org/dynmap/ClientConfigurationComponent.java index ab548615..2951650f 100644 --- a/src/main/java/org/dynmap/ClientConfigurationComponent.java +++ b/src/main/java/org/dynmap/ClientConfigurationComponent.java @@ -31,6 +31,8 @@ public class ClientConfigurationComponent extends Component { if(sn.equals("Unknown Server")) sn = "Minecraft Dynamic Map"; s(t, "title", c.getString("webpage-title", sn)); + s(t, "msg-maptypes", c.getString("msg/maptypes", "Map Types")); + s(t, "msg-players", c.getString("msg/players", "Players")); DynmapWorld defaultWorld = null; String defmap = null; diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index 33ff5962..b811cf5c 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -299,6 +299,11 @@ cyrillic-support: false # If true, make persistent record of IP addresses used by player logins, to support web IP to player matching persist-ids-by-ip: true +# Messages to customize +msg: + maptypes: "Map Types" + players: "Players" + # NOTE: the 'templates' section is now found in the 'templates' directory # Templates CAN still be defined in configuration.txt, as before 0.20 templates: diff --git a/web/js/map.js b/web/js/map.js index 1b263886..553b5c7b 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -214,7 +214,7 @@ DynMap.prototype = { // Worlds var worldlist; $('
') - .append($('').text('Map Types')) + .append($('').text(me.options['msg-maptypes'])) .append(upbtn_world) .append(me.worldlist = worldlist = $('
    ').addClass('worldlist') .bind('mousewheel', function(event, delta){ @@ -279,7 +279,7 @@ DynMap.prototype = { // The Player List var playerlist; $('
    ') - .append($('').text('Players')) + .append($('').text(me.options['msg-players'])) .append(upbtn) .append(me.playerlist = playerlist = $('
      ').addClass('playerlist') .bind('mousewheel', function(event, delta){