Show label even if it is not English
Most articles in Japan have only a Japanese label in Wikidata. Fortunately, most wikishootme in Japan happen to understand at least a bit of Japanese.
PROBLEM: wikishootme does not show the Japanese label
SOLUTION: If there is no English label, or no label in the visitor's language, just show a label in another language, in any case it is much more user-friendly than a Q code.
Comments (3)
-
-
reporter Thanks for V3, it is wonderful, like a dream come true!
In your blog you mentioned that the label service is too slow. Here is a query example that shows a label in English OR in another language if no English is available, WITHOUT using the label service:
SELECT ?item (SAMPLE(COALESCE(?en_label, ?item_label)) as ?label) (SAMPLE(?location) as ?location) WHERE { ?item wdt:P31 wd:Q811979 . ?item wdt:P625 ?location . MINUS {?item wdt:P18 ?image} OPTIONAL {?item rdfs:label ?en_label . FILTER(LANG(?en_label) = "en")} OPTIONAL {?item rdfs:label ?item_label} } GROUP BY ?item
I hope you can use the same trick for WSM.
-
reporter If the label service is too slow, how about having the popup first display what it has, then dynamically load non-QID label when the need arises?
Self-memo:
- Popup is created at https://bitbucket.org/magnusmanske/wikishootme/src/757d905aca6ae3ee3b043c33476858b0ecd2c0e0/public_html/index.html?at=master&fileviewer=file-view-default#index.html-311
- Current implementation of label loading using only the user's language: https://bitbucket.org/magnusmanske/wikishootme/src/757d905aca6ae3ee3b043c33476858b0ecd2c0e0/public_html/index.html?at=master&fileviewer=file-view-default#index.html-872
- Log in to comment
Language fallback would be great, also with the current language as main language.