User:Utcursch/Migrate Infobox Indian Jurisdiction to Infobox settlement/main.js: Difference between revisions

Content deleted Content added
m m
m changes suggested by Dr. Blofeld
Line 103:
*/
migrateIIJ.prepareInfoboxSettlement = function (orig_infobox_params) {
 
// state name
var state_name = orig_infobox_params["state_name"] ? orig_infobox_params["state_name"] : "";
// strip [[]], if any
state_name = state_name.replace("[[", "");
state_name = state_name.replace("]]", "");
 
// Location map
var pushpin_map = "India";
if (orig_infobox_params["state_name != ""]) {
pushpin_map = "India " + orig_infobox_params["state_name"];
}
 
Line 119 ⟶ 126:
// make list of subdivisions
var subdivisions = [];
if (orig_infobox_params["state_name != ""]) {
subdivisions["[[States and territories of India|State]]"] = orig_infobox_params"[[" + state_name + "]]";
}
if (orig_infobox_params["region"]) {
subdivisions["[[List of regions of India|Region]]"] = orig_infobox_params["region"];
}
if (orig_infobox_params["division"]) {
Line 129 ⟶ 136:
}
if (orig_infobox_params["district"]) {
subdivisions["[[List of districts of India|District]]"] = orig_infobox_params["district"];
}
if (orig_infobox_params["metro"]) {
Line 152 ⟶ 159:
languages["Official"] = orig_infobox_params["official_languages"];
} else {
var state_name = orig_infobox_params["state_name"] ? orig_infobox_params["state_name"] : "";
 
// strip [[]]
state_name = state_name.replace("[[", "");
state_name = state_name.replace("]]", "");
 
if (state_name != "") {
languages["Official"] = getOfficialLanguage(state_name);