cleanup of loc messages that resulted in errors in some translations (#2340)

- remove str`` where it is not needed
- resolve templates to use simple variable in str``
- combine into single str``
This commit is contained in:
Ilya Kreymer 2025-01-27 20:10:47 -08:00 committed by GitHub
parent 3c860775b9
commit 4fa3bc492f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 40 deletions

View File

@ -382,20 +382,17 @@ export class OrgsList extends BtrixElement {
<ul class="mb-3 text-neutral-600">
<li>
${msg(
html`${msg("Crawls")}:
${this.localize.bytes(org.bytesStoredCrawls)}`,
str`Crawls: ${this.localize.bytes(org.bytesStoredCrawls)}`,
)}
</li>
<li>
${msg(
html`${msg("Uploads")}:
${this.localize.bytes(org.bytesStoredUploads)}`,
str`Uploads: ${this.localize.bytes(org.bytesStoredUploads)}`,
)}
</li>
<li>
${msg(
html`${msg("Profiles")}:
${this.localize.bytes(org.bytesStoredProfiles)}`,
str`Profiles: ${this.localize.bytes(org.bytesStoredProfiles)}`,
)}
</li>
</ul>

View File

@ -115,37 +115,39 @@ export class CrawlQueue extends BtrixElement {
const getInputWidth = (v: number | string) =>
`${Math.max(v.toString().length, 3) + 2}ch`;
const fromInput = html` <btrix-inline-input
class="mx-1 inline-block"
style="width: ${Math.max(offsetValue.toString().length, 2) + 2}ch"
value="1"
inputmode="numeric"
size="small"
autocomplete="off"
@sl-input=${(e: SlInputEvent) => {
const input = e.target as SlInput;
input.style.width = getInputWidth(input.value);
}}
@sl-change=${async (e: SlChangeEvent) => {
const input = e.target as SlInput;
const int = +input.value.replace(/\D/g, "");
await this.updateComplete;
const value = Math.max(1, Math.min(int, this.queue!.total - 1));
input.value = value.toString();
this.pageOffset = value - 1;
}}
></btrix-inline-input>`;
const max = this.localize.number(countMax);
const total = this.localize.number(this.queue.total);
return html`
<div class="flex items-center text-neutral-500">
${msg(html`
Queued URLs from
<btrix-inline-input
class="mx-1 inline-block"
style="width: ${Math.max(offsetValue.toString().length, 2) + 2}ch"
value="1"
inputmode="numeric"
size="small"
autocomplete="off"
@sl-input=${(e: SlInputEvent) => {
const input = e.target as SlInput;
input.style.width = getInputWidth(input.value);
}}
@sl-change=${async (e: SlChangeEvent) => {
const input = e.target as SlInput;
const int = +input.value.replace(/\D/g, "");
await this.updateComplete;
const value = Math.max(1, Math.min(int, this.queue!.total - 1));
input.value = value.toString();
this.pageOffset = value - 1;
}}
></btrix-inline-input>
to ${this.localize.number(countMax)} of
${this.localize.number(this.queue.total)}
`)}
${msg(html`Queued URLs from ${fromInput} to ${max} of ${total}`, {
id: "h077c8fe82a78c616",
})}
</div>
`;
}

View File

@ -233,11 +233,9 @@ export class WorkflowListItem extends BtrixElement {
<div class="desc">
${this.safeRender((workflow) => {
if (workflow.schedule) {
return msg(
str`${humanizeSchedule(workflow.schedule, {
length: "short",
})}`,
);
return humanizeSchedule(workflow.schedule, {
length: "short",
});
}
if (workflow.lastStartedByName) {
return msg(str`Manual run by ${workflow.lastStartedByName}`);