Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation of directions N-E-S-W #22

Closed
rainer-geiger opened this issue Aug 16, 2020 · 7 comments · Fixed by #25
Closed

Translation of directions N-E-S-W #22

rainer-geiger opened this issue Aug 16, 2020 · 7 comments · Fixed by #25
Assignees
Labels
enhancement New feature or request

Comments

@rainer-geiger
Copy link

rainer-geiger commented Aug 16, 2020

First off I want to say that this card is amazing!

But I have a suggestion for improvement: Is it possible to introduce a translation of the "directional letters" in the configuration? I'm from Germany and in German for example "east" means "Osten". So it would be great if I could change the letters NESW according to my language.

Maybe something like this:

- compass:
          indicator: arrow_inward
          show_north: true
   direction_offset: 180
   entity: sensor.wind_bearing
   secondary_entity: sensor.wind_speed
   name: Wind
   translate:
          north: N
          east: O
          south: S
          west: W
   type: 'custom:compass-card'
@tomvanswam
Copy link
Owner

Thanks for your feedback!

I was planning on using the integrated translation in Home Assistant for translation, instead of putting translation in the yaml.

This would work for you when your Home Assistant language is set to German or to automatic and your browser sais to use German. If your configuration page is in German, your good.

I'd like to know if your Home Assistant is in German, and if you use a localized weather integration whether its string direction state has its states in German.

If you could find the time, could you help out translating the strings in this file? Then all stuff will be in German.

@dhover
Copy link

dhover commented Aug 16, 2020

I also would like to have the directions translated in Dutch. I' m using Home Assistant in English language because I like the original menu's and messages for troubleshooting.

@tomvanswam
Copy link
Owner

Ok good to know, so i would need to implement a forcing mechanism to pick a language different from the ui for the abbreviations.

@tomvanswam tomvanswam added the enhancement New feature or request label Aug 16, 2020
@tomvanswam tomvanswam self-assigned this Aug 16, 2020
@rainer-geiger
Copy link
Author

Homeassistant is set to German. My weather integration is "DWD Deutscher Wetterdienst". The integration has no string direction state, only numerical value in degrees:

temperature: 21.5
humidity: 86
pressure: 1009.6
wind_bearing: 261
wind_speed: 1.5
visibility: 10.3
attribution: Data provided by Deutscher Wetterdienst (DWD)
forecast:
  - datetime: '2020-08-17'
    condition: lightning-rainy
    temperature: 22.4
    templow: 16.6
    precipitation: 7.4
    precipitation_probability: 71
  - [...]
latest_update_utc: '2020-08-17T10:02:55.370955+00:00'
forecast_time_utc: '2020-08-17T09:00:00+00:00'
station_id: EXXX
station_name: Wetter Zuhause

I've done the German translation, can I push it to dev?

@tomvanswam
Copy link
Owner

tomvanswam commented Aug 17, 2020

Thanks a lot for the translation. Please use a pull request, instead of a direct push to dev.

I'm working on getting the abbreviation language independant from the HA language when that is done, the German language will be included in the next release.

@tomvanswam
Copy link
Owner

I've done the German translation, can I push it to dev?

If creating a pull request is to much of a hassle, you can post the translation file here too.

@rainer-geiger
Copy link
Author

Ok, cool, that's actually just easier for me ;-)

  • Corrected directions->south from "Süd" to "Süden"
  • Added strings for common and editor
{
  "common": {
    "version": "Version",
    "description": "Zeigt einen Kompass mit einem Indikator in Richtung des Entitätswertes an",
    "invalid_configuration": "Ungültige Konfiguration",
    "no_entity": "Entität nicht konfiguriert",
    "offset_not_a_number": "Richtungs-Offset ist keine Zahl",
    "invalid": "ungültig",
    "on": "An",
    "off": "Aus"
  },
  "editor": {
    "name": "Name",
    "optional": "Optional",
    "entity": "Entität",
    "required": "Benötigt",
    "primary": "Richtung",
    "secondary": "Sekundär",
    "indicator": "Indikator",
    "direction": "Richtung",
    "offset": "Offset",
    "show": "Zeige",
    "north": "Norden",
    "toggle": "Umschalten"
  },
  "directions": {
    "north": "Norden",
    "east": "Osten",
    "south": "Süden",
    "west": "Westen",
    "N": "N",
    "NNE": "NNO",
    "NE": "NO",
    "ENE": "ONO",
    "E": "O",
    "ESE": "OSO",
    "SE": "SO",
    "SSE": "SSO",
    "S": "S",
    "SSW": "SSW",
    "SW": "SW",
    "WSW": "WSW",
    "W": "W",
    "WNW": "WNW",
    "NW": "NW",
    "NNW": "NNW"
  }
}

@tomvanswam tomvanswam mentioned this issue Aug 17, 2020
@tomvanswam tomvanswam linked a pull request Aug 17, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants