Git Product home page Git Product logo

Comments (5)

nervetattoo avatar nervetattoo commented on September 13, 2024 1

Hmm. I do think the concept of overriding translations in custom cards is interesting. If I add this it will be not the most user friendly as its so hard to know what parts of the translation object the card will use with custom sensors. But supporting overriding specific keys in the HA provided localisation resources by the exact same keys could be a neat convention for custom cards in general:

translations:
  en:
    state.climate.on: Its on

It would require you as the user to gather somewhat deeper knowledge of internal data structures in HA, but then again it would allow you to pinpoint any translation field in any language just for this one card. Should be future proof. Will ponder it further πŸ€”

from simple-thermostat.

Misiu avatar Misiu commented on September 13, 2024

@nervetattoo I also stuck a bit on localizing. I always got Temperature. My quick fix was editing JS file with the correct string.
This would be a great addition :)

from simple-thermostat.

Misiu avatar Misiu commented on September 13, 2024

@nervetattoo I've just updated HA to the latest version and there is something wrong with localization:
image

Take a look at Status (State). On the label it is written heating but the button says: GRZANIE, which means heating in Polish. So the buttons are correctly localized, but the label isn't.

Ok, I think I found the issue with State:
in https://github.com/nervetattoo/simple-thermostat/blob/master/src/index.js#L264 it should be:

: this.renderInfoItem(this.localize(mode, 'state.climate.'), {

This way I got the correct label:
image

from simple-thermostat.

nervetattoo avatar nervetattoo commented on September 13, 2024

Thanks to this PR this is at least now possible to override so I'm leaving it at that solution

from simple-thermostat.

Protoncek avatar Protoncek commented on September 13, 2024

Hi!
I know this is an old thing, but, is it possible that this error reappeared?
on image below buttons are translated, while current status is in english:
image

from simple-thermostat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.