diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-10-20 18:32:34 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-10-20 18:32:34 (GMT) |
commit | 1933ab8d2fabdc4391536abb652f49b0894db419 (patch) | |
tree | 0c0496afabfcb4154193dfc75003fe6d6e6fed1d | |
parent | 7b9bde78effa1afdf41a59c91d4c993e6d511353 (diff) |
use labels instead of block names to take advantage of i18n
-rw-r--r-- | TurtleArt/tawindow.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 649e83e..6faf1ff 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -1309,8 +1309,10 @@ class TurtleArtWindow(): newblk.connections[i + 1] = argblk self.drag_group = find_group(newblk) self.block_operation = 'new' - if newblk.name not in self.used_block_list: - self.used_block_list.append(newblk.name + ' ') + if newblk.spr.labels[0] is not None and \ + newblk.name not in ['', 'number', 'string']: + if newblk.spr.labels[0] not in self.used_block_list: + self.used_block_list.append(newblk.spr.labels[0] + ' ') def _new_macro(self, name, x, y): """ Create a "macro" (predefined stack of blocks). """ @@ -2762,8 +2764,10 @@ class TurtleArtWindow(): blk.spr.set_layer(BLOCK_LAYER) if check_dock: blk.connections = 'check' - if blk.name not in self.used_block_list: - self.used_block_list.append(blk.name + ' ') + if blk.spr.labels[0] is not None and \ + blk.name not in ['', 'number', 'string']: + if blk.spr.labels[0] not in self.used_block_list: + self.used_block_list.append(blk.spr.labels[0] + ' ') return blk def load_start(self, ta_file=None): |