Mercurial > projects > mde
comparison mde/content/Translation.d @ 156:36df0ffe34d2
Fix to reload translations.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 18 Apr 2009 21:51:03 +0200 |
parents | 0520cc00c0cc |
children | 24d77c52243f |
comparison
equal
deleted
inserted
replaced
155:4e8819b65882 | 156:36df0ffe34d2 |
---|---|
73 logger = Log.lookup ("mde.lookup.Translation"); | 73 logger = Log.lookup ("mde.lookup.Translation"); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 private void load (char[] l10n) { | 77 private void load (char[] l10n) { |
78 entries = null; // clear, then re-read | |
78 char[][] files = [loadedL10n]; // initial locale plus dependencies | 79 char[][] files = [loadedL10n]; // initial locale plus dependencies |
79 size_t read = 0; // index in files of next file to read | 80 size_t read = 0; // index in files of next file to read |
80 while (read < files.length) { | 81 while (read < files.length) { |
81 try { | 82 try { |
82 MTTagReader reader = dataDir.makeMTTagReader ("L10n/"~files[read], PRIORITY.HIGH_LOW); | 83 MTTagReader reader = dataDir.makeMTTagReader ("L10n/"~files[read], PRIORITY.HIGH_LOW); |
96 } | 97 } |
97 } | 98 } |
98 char[] symPrefix; | 99 char[] symPrefix; |
99 do { | 100 do { |
100 if (isSecTag) { | 101 if (isSecTag) { |
101 if (reader.section.length == 0) { | 102 if (reader.section.length == 0) |
102 symPrefix = ""; | 103 symPrefix = ""; |
103 continue; | 104 else |
104 } | 105 symPrefix = reader.section ~ '.'; |
105 symPrefix = reader.section ~ '.'; | |
106 } else { | 106 } else { |
107 if (reader.tagType == "entry") { | 107 if (reader.tagType == "entry") { |
108 char[] sym = symPrefix ~ reader.tagID; | 108 char[] sym = symPrefix ~ reader.tagID; |
109 // If the tag already exists, don't replace it | 109 // If the tag already exists, don't replace it |
110 if (sym in entries) continue; | 110 if (sym in entries) continue; |