Changeset 31861 in osm
- Timestamp:
- 2015-12-25T21:27:09+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r31857 r31861 211 211 "&props=labels" + 212 212 "&ids=" + wikidataId + 213 "&languages=" + preferredLanguage + 214 "&languagefallback=en" + 215 "&format=xml"; 213 "&format=xml" + 214 (preferredLanguage != null ? "&languages=" + preferredLanguage + "&languagefallback=en" : ""); 216 215 Main.info("Wikipedia: GET " + url); 217 216 try (final InputStream in = Utils.openURL(new URL(url))) { 218 217 final Document xml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in); 219 218 final Node label = (Node) XPathFactory.newInstance().newXPath().compile("//label").evaluate(xml, XPathConstants.NODE); 220 if (label == null) { 219 if (label == null && preferredLanguage != null) { 220 return getLabelForWikidata(wikidataId, null); 221 } else if (label == null) { 221 222 return null; 222 223 } else {
Note:
See TracChangeset
for help on using the changeset viewer.