Unified legend

Legends on boxes and lists are currently added via CSS and as stylesheets cannot be localised, translated strings rely upon an additional inline CSS.
This commit inserts localised legends as "data-legend" attributes on proper elements, and then this attribute is shown by stylesheet rule content: attr(data-legend). No need of localisation script and more compact CSS rules.
This commit is contained in:
Andrea Rendine
2015-05-18 16:57:17 +02:00
committed by Blake Grotewold
parent 93649307f6
commit 92f7cf683e
7 changed files with 26 additions and 70 deletions
+2 -2
View File
@@ -424,10 +424,10 @@ var Outside = {
var hasPeeps;
if($SM.get('game.buildings["hut"]', true) === 0) {
hasPeeps = false;
village.addClass('noHuts');
village.attr('data-legend', _('forest'));
} else {
hasPeeps = true;
village.removeClass('noHuts');
village.attr('data-legend', _('village'));
}
if(needsAppend && village.children().length > 1) {