Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1b9f224
[ci skip] Translation update
homeassistant Apr 15, 2020
8383caf
Add ability to see Zigbee information for a device (#5445)
dmulcahey Apr 15, 2020
4f81085
Add entity row that displays static text (#5516)
balloob Apr 15, 2020
ed54a18
Remove srcset from brands (#5517)
balloob Apr 15, 2020
4c3069e
Add missing imports (#5547)
ludeeus Apr 15, 2020
fc7771e
Remove npm (#5548)
ludeeus Apr 15, 2020
ba0cba1
Update where we load integration titles from (#5546)
balloob Apr 15, 2020
ff81536
Add loading for initial state on graph (#5448)
timmo001 Apr 15, 2020
66f33ad
Use manfiests to render doc urls (#5549)
balloob Apr 15, 2020
492e4d2
[ci skip] Translation update
homeassistant Apr 16, 2020
5c941e0
Remove initial value explanation
bramkragten Apr 16, 2020
0ccc788
[ci skip] Translation update
homeassistant Apr 17, 2020
b516f10
Bump https-proxy-agent from 2.2.1 to 2.2.4 (#5559)
dependabot[bot] Apr 17, 2020
97c454a
Update domain translation string (#5558)
balloob Apr 17, 2020
f577542
Add Search to Card Picker (#5497)
timmo001 Apr 17, 2020
f91b46e
[ci skip] Translation update
homeassistant Apr 18, 2020
d45a674
Ask specific translations (#5560)
balloob Apr 19, 2020
e355c81
Bumped version to 20200418.0
balloob Apr 19, 2020
91eabf3
[ci skip] Translation update
homeassistant Apr 19, 2020
659da7b
Update translations
balloob Apr 19, 2020
8812340
Remove iba language
balloob Apr 19, 2020
ecd967a
[ci skip] Translation update
homeassistant Apr 20, 2020
b4b90ca
[ci skip] Translation update
homeassistant Apr 21, 2020
d27a17c
Get state translations from backend (#5581)
balloob Apr 21, 2020
8786302
Add up/down movement icons to shutter (#5579)
nagyrobi Apr 21, 2020
82442bb
Fix cast translations (#5582)
balloob Apr 21, 2020
ae90397
[ci skip] Translation update
homeassistant Apr 22, 2020
24a844d
update translations
balloob Apr 22, 2020
c72bb5b
Add secondary option for cover entities (#5556)
cdce8p Apr 22, 2020
a49c840
Mark titles in config flows optional (#5584)
balloob Apr 22, 2020
2b76b38
Add device automation translations to add automation device dia… (#5573)
bramkragten Apr 22, 2020
1c1f9a6
Graph Footer: Cache State History (#5499)
zsarnett Apr 22, 2020
1dfb632
New layout for integration config (#5580)
bramkragten Apr 22, 2020
9a00078
Display MQTT debug info (#5375)
emontnemery Apr 22, 2020
fdf7b51
Weather Card: Beautify (#5387)
zsarnett Apr 22, 2020
a9d9275
Bumped version to 20200422.0
bramkragten Apr 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build-scripts/gulp/cast.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gulp.task(
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "development";
process.env.IS_CAST = "true";
},
"clean-cast",
gulp.parallel(
Expand Down
58 changes: 41 additions & 17 deletions build-scripts/gulp/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const fullDir = workDir + "/full";
const coreDir = workDir + "/core";
const outDir = workDir + "/output";

String.prototype.rsplit = function(sep, maxsplit) {
String.prototype.rsplit = function (sep, maxsplit) {
var split = this.split(sep);
return maxsplit
? [split.slice(0, -maxsplit).join(sep)].concat(split.slice(-maxsplit))
Expand All @@ -45,7 +45,7 @@ const TRANSLATION_FRAGMENTS = [

function recursiveFlatten(prefix, data) {
let output = {};
Object.keys(data).forEach(function(key) {
Object.keys(data).forEach(function (key) {
if (typeof data[key] === "object") {
output = {
...output,
Expand Down Expand Up @@ -107,7 +107,12 @@ function lokaliseTransform(data, original, file) {
output[key] = lokaliseTransform(value, original, file);
} else {
output[key] = value.replace(re_key_reference, (match, key) => {
const replace = key.split("::").reduce((tr, k) => tr[k], original);
const replace = key.split("::").reduce((tr, k) => {
if (!tr) {
throw Error(`Invalid key placeholder ${key} in ${file.path}`);
}
return tr[k];
}, original);
if (typeof replace !== "string") {
throw Error(`Invalid key placeholder ${key} in ${file.path}`);
}
Expand All @@ -118,7 +123,7 @@ function lokaliseTransform(data, original, file) {
return output;
}

gulp.task("clean-translations", function() {
gulp.task("clean-translations", function () {
return del([workDir]);
});

Expand All @@ -129,7 +134,7 @@ gulp.task("ensure-translations-build-dir", (done) => {
done();
});

gulp.task("create-test-metadata", function(cb) {
gulp.task("create-test-metadata", function (cb) {
fs.writeFile(
workDir + "/testMetadata.json",
JSON.stringify({
Expand All @@ -147,7 +152,7 @@ gulp.task(
return gulp
.src(path.join(paths.translations_src, "en.json"))
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return recursiveEmpty(data);
})
)
Expand All @@ -165,28 +170,28 @@ gulp.task(
* project is buildable immediately after merging new translation keys, since
* the Lokalise update to translations/en.json will not happen immediately.
*/
gulp.task("build-master-translation", function() {
gulp.task("build-master-translation", function () {
return gulp
.src(path.join(paths.translations_src, "en.json"))
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(rename("translationMaster.json"))
.pipe(gulp.dest(workDir));
});

gulp.task("build-merged-translations", function() {
gulp.task("build-merged-translations", function () {
return gulp
.src([inDir + "/*.json", workDir + "/test.json"], { allowEmpty: true })
.pipe(
transform(function(data, file) {
transform(function (data, file) {
return lokaliseTransform(data, data, file);
})
)
.pipe(
foreach(function(stream, file) {
foreach(function (stream, file) {
// For each language generate a merged json file. It begins with the master
// translation as a failsafe for untranslated strings, and merges all parent
// tags into one file for each specific subtag
Expand Down Expand Up @@ -223,7 +228,7 @@ var taskName;
const splitTasks = [];
TRANSLATION_FRAGMENTS.forEach((fragment) => {
taskName = "build-translation-fragment-" + fragment;
gulp.task(taskName, function() {
gulp.task(taskName, function () {
// Return only the translations for this fragment.
return gulp
.src(fullDir + "/*.json")
Expand All @@ -242,12 +247,31 @@ TRANSLATION_FRAGMENTS.forEach((fragment) => {
});

taskName = "build-translation-core";
gulp.task(taskName, function() {
gulp.task(taskName, function () {
// Remove the fragment translations from the core translation.
return gulp
.src(fullDir + "/*.json")
.pipe(
transform((data) => {
transform((data, file) => {
// HACK to pull in old state translations for cast
if (process.env.IS_CAST) {
const legacyTranslationsPath = path.join(
"cast/src/translations",
file.relative
);
if (fs.existsSync(legacyTranslationsPath)) {
const legacyStrings = JSON.parse(
fs.readFileSync(legacyTranslationsPath, "utf-8")
);
// These 2 translations still exist today.
if (legacyStrings.state && "default" in legacyStrings.state) {
legacyStrings.default.unknown = data.state.default.unknown;
legacyStrings.default.unavailable =
data.state.default.unavailable;
}
data.state = legacyStrings.state;
}
}
TRANSLATION_FRAGMENTS.forEach((fragment) => {
delete data.ui.panel[fragment];
});
Expand All @@ -259,7 +283,7 @@ gulp.task(taskName, function() {

splitTasks.push(taskName);

gulp.task("build-flattened-translations", function() {
gulp.task("build-flattened-translations", function () {
// Flatten the split versions of our translations, and move them into outDir
return gulp
.src(
Expand All @@ -269,7 +293,7 @@ gulp.task("build-flattened-translations", function() {
{ base: workDir }
)
.pipe(
transform(function(data) {
transform(function (data) {
// Polymer.AppLocalizeBehavior requires flattened json
return flatten(data);
})
Expand Down Expand Up @@ -351,7 +375,7 @@ gulp.task(
)
.pipe(merge({}))
.pipe(
transform(function(data) {
transform(function (data) {
const newData = {};
Object.entries(data).forEach(([key, value]) => {
// Filter out translations without native name.
Expand Down
4 changes: 4 additions & 0 deletions build-scripts/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const createWebpackConfig = ({
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
__VERSION__: JSON.stringify(version),
__DEMO__: false,
__BACKWARDS_COMPAT__: false,
__STATIC_PATH__: "/static/",
"process.env.NODE_ENV": JSON.stringify(
isProdBuild ? "production" : "development"
Expand Down Expand Up @@ -221,6 +222,9 @@ const createCastConfig = ({ isProdBuild, latestBuild }) => {
outputRoot: paths.cast_root,
isProdBuild,
latestBuild,
defineOverlay: {
__BACKWARDS_COMPAT__: true,
},
});
};

Expand Down
Loading