Skip to content

Commit fc57a0c

Browse files
committed
+dict
1 parent e631acf commit fc57a0c

6 files changed

Lines changed: 331 additions & 162 deletions

File tree

application/locale/resources/i18n/pt-br.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"@metadata": {
33
"authors": [
44
"Andrekowacs",
5+
"EGobi",
56
"Felipe L. Ewald",
67
"Lc97",
78
"Mellogabi03",
@@ -1284,7 +1285,7 @@
12841285
"automatically-replace-the-display-text-of-links-$1→$2": "Substituir automaticamente o texto de exibição dos links: %1→%2",
12851286
"get-list-of-$1-from-$2": "Obter lista de %1 from %2.",
12861287
"list-types-$1": "Tipos de lista: %1.",
1287-
"namespaces-$1": "Namespaces: %1.",
1288+
"namespaces-$1": "Espaços nominais: %1.",
12881289
"convert-$1-to-wikilink": "Converter %1 em wikilink",
12891290
"hi-maybe-you-can-change-the-format-of-your-signature": "Olá, talvez você possa alterar o formato de sua assinatura"
12901291
}

application/net/wiki/parser/misc.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,8 @@ function module_code(library_namespace) {
12061206
// target_template_token, source_template_token
12071207
function merge_template_parameters(to_template_token, from_template_token,
12081208
options) {
1209+
// assert: 整個過程不動到 from_template_token。
1210+
12091211
if (!Array.isArray(to_template_token)
12101212
|| to_template_token.type !== 'transclusion'
12111213
|| !Array.isArray(from_template_token)
@@ -1215,8 +1217,11 @@ function module_code(library_namespace) {
12151217
return;
12161218
}
12171219

1220+
options = library_namespace.setup_options(options);
1221+
12181222
// assert: 不動到 from_template_token。
1219-
var normalize_parameter = options && options.normalize_parameter;
1223+
// 用來比較兩個參數值是否相同,而非把參數改成正規化的值。
1224+
var normalize_parameter = options.normalize_parameter;
12201225

12211226
// 紀錄有衝突的 parameter_name
12221227
var conflict_parameters = [], parameters_to_copy = [];
@@ -1237,7 +1242,7 @@ function module_code(library_namespace) {
12371242
from_value = normalize_parameter(from_value, parameter_name);
12381243
to_value = normalize_parameter(to_value, parameter_name);
12391244
}
1240-
if (from_value.toString() === to_value.toString()) {
1245+
if (String(from_value) === String(to_value)) {
12411246
// Skip the same values.
12421247
continue;
12431248
}
@@ -1246,8 +1251,10 @@ function module_code(library_namespace) {
12461251
}
12471252

12481253
// console.trace(conflict_parameters, parameters_to_copy);
1249-
if (conflict_parameters.length > 0)
1254+
if (conflict_parameters.length > 0) {
1255+
// 既然有衝突,不能完全合併,就兩個都別動。
12501256
return conflict_parameters;
1257+
}
12511258

12521259
// assert: 在這之前都不動到 to_template_token。
12531260

@@ -1269,6 +1276,8 @@ function module_code(library_namespace) {
12691276
= from_template_token.parameters[parameter_name];
12701277
});
12711278
// console.trace(to_template_token, to_template_token.length);
1279+
1280+
// wiki_API.inplace_reparse_element(to_template_token, options);
12721281
}
12731282

12741283
// ------------------------------------------------------------------------

data/Convert_Pairs.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ function module_code(library_namespace) {
132132
text = String(text);
133133

134134
if (type === '#') {
135-
//console.log([ text, type ]);
135+
// console.log([ text, type ]);
136136
text = text
137137
//
138138
.replace(/#.*/g, '');
139-
//console.log([ text, type ]);
139+
// console.log([ text, type ]);
140140
return text;
141141
}
142142

@@ -211,11 +211,13 @@ function module_code(library_namespace) {
211211
var dictionary_path = this.path;
212212
var original_value = pair_Map.get(key);
213213
if (value === original_value) {
214-
library_namespace.info('set_pair_Map_value: 重複設定相同的 '
215-
//
216-
+ JSON.stringify(key) + ' → ' + JSON.stringify(value)
217-
//
218-
+ (dictionary_path ? ' (' + dictionary_path + ')' : ''));
214+
if (options.show_debug_messages) {
215+
library_namespace.info('set_pair_Map_value: ' + '重複設定相同的 '
216+
//
217+
+ JSON.stringify(key) + ' → ' + JSON.stringify(value)
218+
//
219+
+ (dictionary_path ? ' (' + dictionary_path + ')' : ''));
220+
}
219221
return false;
220222
}
221223

extension/zh_conversion.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ function module_code(library_namespace) {
245245
// 在 convert_text() 開始轉換之後就不會再修改辭典檔,因此可移除 .pair_Map。
246246
may_remove_pair_Map : !options
247247
// @see convert_text(text, options)
248-
|| !options.mode
248+
|| !options.mode,
249+
250+
// @sww CeL.data.Convert_Pairs
251+
show_debug_messages : options && options.show_debug_messages
249252
};
250253

251254
var new_tailored_key_Set = new Set;

0 commit comments

Comments
 (0)