kilowatt_hour doesn’t get formatted correctly
Minimal reproducible example:
```python
ureg = UnitRegistry(locale="fr_FR")
ureg.formatter.format_babel(ureg.Unit("kWh"))
```
Result:
```
kilowatt_hour
```
Expected result:
```
kilowatt-heure
```
It seems to come from `compound_unit_helpers.localize_unit_name`, which should probably look up the name `kilowatt_hour` in `babel_names._babel_units`, but doesn’t, (and `_find_unit_pattern` just returns None…)
关闭于 2025-09-23 3 条评论