forked from Icycoide/searxng
[feat] plugins: new unit converter plugin
This commit is contained in:
parent
b3b1258e4e
commit
46efb2f36d
3 changed files with 99 additions and 5 deletions
|
@ -238,7 +238,10 @@ def unit_to_str(unit):
|
|||
for prefix in WIKIDATA_PREFIX:
|
||||
if unit.startswith(prefix):
|
||||
wikidata_entity = unit[len(prefix) :]
|
||||
return WIKIDATA_UNITS.get(wikidata_entity, unit)
|
||||
real_unit = WIKIDATA_UNITS.get(wikidata_entity)
|
||||
if real_unit is None:
|
||||
return unit
|
||||
return real_unit['symbol']
|
||||
return unit
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue