Support serving of backend translations (#12453)

* Add view to support backend translation fetching

* Load backend translations from component json

* Translations for season sensor

* Scripts to merge and unpack Lokalise translations

* Fix copy paste error

* Serve post-lokalise translations to frontend

* Linting

* Auto-deploy translations with Travis

* Commit post-lokalise translation files

* Split logic into more helper functions

* Fall back to English for missing keys

* Move local translation copies to `.translations`

* Linting

* Initial tests

* Remove unnecessary file check

* Convert translation helper to async/await

* Convert translation helper tests to async/await

* Use set subtraction to find missing_components

* load_translation_files use component->file mapping

* Remove duplicated resources fetching

Get to take advantage of the slick Python 3.5 dict merging here.

* Switch to live project ID
This commit is contained in:
Adam Mills authored and Paulus Schoutsen committed 2018-02-28 19:31:38 -08:00
1 parent a60712d826
commit b434ffba2d
19 files changed
+575 -6

No files matched your search

@@ -0,0 +1,6 @@
{
"state": {
"string1": "German Value 1",
"string2": "German Value 2"
}
}
@@ -0,0 +1,6 @@
{
"state": {
"string1": "Value 1",
"string2": "Value 2"
}
}
@@ -0,0 +1,5 @@
{
"state": {
"string1": "Spanish Value 1"
}
}
@@ -0,0 +1,7 @@
"""Provide a mock package component."""
DOMAIN = 'test_package'
def setup(hass, config):
"""Mock a successful setup."""
return True
@@ -0,0 +1,7 @@
"""Provide a mock standalone component."""
DOMAIN = 'test_standalone'
def setup(hass, config):
"""Mock a successful setup."""
return True