feat: add support for hidden labels when diffing Lokalise labels

This commit is contained in:
Michael Zetterberg
2025-05-22 14:00:52 +02:00
parent 14ca1775d8
commit b5b4a61c41
4 changed files with 33 additions and 10 deletions

View File

@@ -36,7 +36,6 @@ const perf = new PerformanceObserver((items) => {
}
performance.clearMeasures()
})
perf.observe({ type: "measure" })
async function waitUntilUploadDone(processId: string) {
return new Promise<void>((resolve, reject) => {
@@ -87,6 +86,8 @@ async function waitUntilUploadDone(processId: string) {
}
export async function upload(filepath: string) {
perf.observe({ type: "measure" })
try {
log(`Uploading ${filepath}...`)
@@ -143,9 +144,15 @@ export async function upload(filepath: string) {
await performanceMetrics
}
export async function download(extractPath: string) {
export async function download(extractPath: string, all: boolean = false) {
perf.observe({ type: "measure" })
try {
log("Downloading translations...")
log(
all
? "Downloading all translations..."
: "Downloading filtered translations..."
)
performance.mark("downloadStart")
@@ -158,7 +165,7 @@ export async function download(extractPath: string) {
icu_numeric: true,
bundle_structure: "%LANG_ISO%.%FORMAT%",
directory_prefix: "",
filter_data: ["translated", "nonhidden"],
filter_data: all ? [] : ["translated", "nonhidden"],
export_empty_as: "skip",
})
performance.mark("lokaliseDownloadInitEnd")