Add translation example
This commit is contained in:
parent
f2a65e77b6
commit
0037bb63fe
@ -27,6 +27,7 @@ File | Purpose
|
|||||||
`.github/ISSUE_TEMPLATE/issue.md` | Template for issues
|
`.github/ISSUE_TEMPLATE/issue.md` | Template for issues
|
||||||
`.github/settings.yml` | Probot settings to control the repository settings.
|
`.github/settings.yml` | Probot settings to control the repository settings.
|
||||||
`.vscode/taks.json` | Tasks for the devcontainer.
|
`.vscode/taks.json` | Tasks for the devcontainer.
|
||||||
|
`custom_components/blueprint/.translations/sensor.nb.json` | [Translation files.](https://developers.home-assistant.io/docs/en/next/internationalization_custom_component_localization.html#translation-strings)
|
||||||
`custom_components/blueprint/__init__.py` | The component file for the integration.
|
`custom_components/blueprint/__init__.py` | The component file for the integration.
|
||||||
`custom_components/blueprint/binary_sensor.py` | Binary sensor platform for the integration.
|
`custom_components/blueprint/binary_sensor.py` | Binary sensor platform for the integration.
|
||||||
`custom_components/blueprint/const.py` | A file to hold shared variables/constants for the entire integration.
|
`custom_components/blueprint/const.py` | A file to hold shared variables/constants for the entire integration.
|
||||||
|
5
custom_components/blueprint/.translations/sensor.nb.json
Normal file
5
custom_components/blueprint/.translations/sensor.nb.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"state": {
|
||||||
|
"Some sample static text.": "Eksempel tekst."
|
||||||
|
}
|
||||||
|
}
|
@ -29,7 +29,7 @@ class BlueprintSensor(Entity):
|
|||||||
|
|
||||||
# Check the data and update the value.
|
# Check the data and update the value.
|
||||||
if updated.get("static") is None:
|
if updated.get("static") is None:
|
||||||
self._state = self._status
|
self._state = self._state
|
||||||
else:
|
else:
|
||||||
self._state = updated.get("static")
|
self._state = updated.get("static")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user