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:
parent
3c860775b9
commit
4fa3bc492f
@ -382,20 +382,17 @@ export class OrgsList extends BtrixElement {
|
|||||||
<ul class="mb-3 text-neutral-600">
|
<ul class="mb-3 text-neutral-600">
|
||||||
<li>
|
<li>
|
||||||
${msg(
|
${msg(
|
||||||
html`${msg("Crawls")}:
|
str`Crawls: ${this.localize.bytes(org.bytesStoredCrawls)}`,
|
||||||
${this.localize.bytes(org.bytesStoredCrawls)}`,
|
|
||||||
)}
|
)}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
${msg(
|
${msg(
|
||||||
html`${msg("Uploads")}:
|
str`Uploads: ${this.localize.bytes(org.bytesStoredUploads)}`,
|
||||||
${this.localize.bytes(org.bytesStoredUploads)}`,
|
|
||||||
)}
|
)}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
${msg(
|
${msg(
|
||||||
html`${msg("Profiles")}:
|
str`Profiles: ${this.localize.bytes(org.bytesStoredProfiles)}`,
|
||||||
${this.localize.bytes(org.bytesStoredProfiles)}`,
|
|
||||||
)}
|
)}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -115,37 +115,39 @@ export class CrawlQueue extends BtrixElement {
|
|||||||
const getInputWidth = (v: number | string) =>
|
const getInputWidth = (v: number | string) =>
|
||||||
`${Math.max(v.toString().length, 3) + 2}ch`;
|
`${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`
|
return html`
|
||||||
<div class="flex items-center text-neutral-500">
|
<div class="flex items-center text-neutral-500">
|
||||||
${msg(html`
|
${msg(html`Queued URLs from ${fromInput} to ${max} of ${total}`, {
|
||||||
Queued URLs from
|
id: "h077c8fe82a78c616",
|
||||||
<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)}
|
|
||||||
`)}
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -233,11 +233,9 @@ export class WorkflowListItem extends BtrixElement {
|
|||||||
<div class="desc">
|
<div class="desc">
|
||||||
${this.safeRender((workflow) => {
|
${this.safeRender((workflow) => {
|
||||||
if (workflow.schedule) {
|
if (workflow.schedule) {
|
||||||
return msg(
|
return humanizeSchedule(workflow.schedule, {
|
||||||
str`${humanizeSchedule(workflow.schedule, {
|
length: "short",
|
||||||
length: "short",
|
});
|
||||||
})}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (workflow.lastStartedByName) {
|
if (workflow.lastStartedByName) {
|
||||||
return msg(str`Manual run by ${workflow.lastStartedByName}`);
|
return msg(str`Manual run by ${workflow.lastStartedByName}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user