Skip to content

Changes to support weblate workflow #2210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
45e6c25
localize reformat
ikreymer Dec 4, 2024
5730e1f
Translations update from Hosted Weblate (#2206)
weblate Dec 4, 2024
165ae91
ci: add weblate-reformat action
ikreymer Dec 4, 2024
82a79a0
fix syntax error
ikreymer Dec 4, 2024
57b92fb
add repo full name
ikreymer Dec 4, 2024
7284325
update messages
ikreymer Dec 4, 2024
3b006fe
build changes
ikreymer Dec 4, 2024
2d86f7a
also commit templates
ikreymer Dec 4, 2024
ae09d19
rename
ikreymer Dec 4, 2024
39d5355
Translated using Weblate (Spanish)
Dec 4, 2024
a5f856e
Translated using Weblate (Spanish)
Dec 4, 2024
8f91d1d
Translated using Weblate (Spanish)
Dec 4, 2024
35ab225
Translated using Weblate (Spanish)
Dec 4, 2024
ba04d5a
Translated using Weblate (Spanish)
Dec 4, 2024
f7122ca
Translated using Weblate (Spanish)
missclaraitzel Dec 4, 2024
7e896e0
Translations update from Hosted Weblate (#2207)
weblate Dec 4, 2024
c908639
Merge remote-tracking branch 'weblate/weblate' into weblate
ikreymer Dec 4, 2024
9baae09
Apply `localize:extract` changes
ikreymer Dec 4, 2024
517a191
Translated using Weblate (Spanish)
Dec 4, 2024
beb0323
wrap in html``
ikreymer Dec 5, 2024
2169326
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
4089190
Apply `localize:extract` changes
ikreymer Dec 5, 2024
1bd81f8
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
4c10fc3
update es.xlf
ikreymer Dec 5, 2024
5502e92
Merge branch 'weblate' of github.com:webrecorder/browsertrix-cloud in…
ikreymer Dec 5, 2024
419ef72
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
c01457e
convert msg() that use & to use html`` to ensure unescaping
ikreymer Dec 5, 2024
7e9819c
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
bc1c0fa
undo change
ikreymer Dec 5, 2024
7cc3f6e
update
ikreymer Dec 5, 2024
f4ff2c4
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
549b151
remove & use and
ikreymer Dec 5, 2024
517c8bc
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
b1099a2
Translations update from Hosted Weblate (#2212)
weblate Dec 5, 2024
eb6b361
Merge remote-tracking branch 'weblate/weblate' into weblate
ikreymer Dec 5, 2024
a8dc067
Apply `localize:extract` changes
ikreymer Dec 5, 2024
46b4b1e
try w/o sorting attrs, may revert, testing for conflict
ikreymer Dec 5, 2024
02b5a8c
Translated using Weblate (Spanish)
Dec 5, 2024
f1e854b
Translations update from Hosted Weblate (#2216)
weblate Dec 5, 2024
f1b2563
Merge remote-tracking branch 'origin/weblate' into weblate
weblate Dec 5, 2024
35e558d
Translations update from Hosted Weblate (#2217)
weblate Dec 5, 2024
f6a7016
Merge branch 'main' into weblate
ikreymer Dec 5, 2024
71d7744
reformat
ikreymer Dec 5, 2024
0ae2a12
Merge branch 'weblate' of github.com:webrecorder/browsertrix-cloud in…
ikreymer Dec 5, 2024
7e2614d
Translations update from Hosted Weblate (#2219)
weblate Dec 5, 2024
82a5e79
Merge branch 'main' into weblate
ikreymer Dec 8, 2024
0453db4
Merge branch 'weblate' of github.com:webrecorder/browsertrix-cloud in…
ikreymer Dec 8, 2024
039e882
rename `package` to `pkg` to fix prettier error
emma-sg Dec 8, 2024
a98a9fd
revert merge conflict resolution
SuaYoo Dec 9, 2024
b16947c
Apply `localize:extract` changes
SuaYoo Dec 9, 2024
b75ed9b
Update frontend/src/features/crawl-workflows/workflow-list.ts
SuaYoo Dec 9, 2024
e2553ba
Apply `localize:extract` changes
SuaYoo Dec 9, 2024
b8b9893
remove localize:extract from frontend build workflow
SuaYoo Dec 9, 2024
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
3 changes: 1 addition & 2 deletions .github/workflows/docs-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
DOCS_SOURCE_URL: https://app.browsertrix.com
ENABLE_ANALYTICS: true

- name: Build & Deploy Docs
- name: Build Docs
run: cd frontend/docs; mkdocs gh-deploy --force
env:
SITE_URL: https://docs.browsertrix.com
ENABLE_ANALYTICS: true
54 changes: 54 additions & 0 deletions .github/workflows/weblate-reformat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Weblate Reformat
on:
pull_request_target:
paths:
- 'frontend/xliff/**'
- '.github/workflows/weblate-reformat.yaml'

branches:
- 'weblate'

jobs:
setup-and-build:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
# Setup:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Install dependencies
working-directory: frontend
env:
HUSKY: 0
run: yarn install --frozen-lockfile

# Localize:
- name: Reformat XLIFF files
working-directory: frontend
run: yarn localize:extract

- name: Rebuild frontend templates
working-directory: frontend
run: yarn localize:build

- name: Commit changes to upstream branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Format Weblate Changes
file_pattern: '**/*.xlf **/__generated__/locales/*.ts'
skip_fetch: true
skip_checkout: true
1 change: 0 additions & 1 deletion frontend/docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
site_name: Browsertrix Docs
site_url: !ENV SITE_URL
repo_url: https://github.com/webrecorder/browsertrix-cloud/
repo_name: Browsertrix
edit_uri: edit/main/frontend/docs/docs/
Expand Down
2 changes: 1 addition & 1 deletion frontend/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
parser: "xml",
proseWrap: "never",
printWidth: Infinity,
xmlSortAttributesByKey: true,
xmlSortAttributesByKey: false,
xmlWhitespaceSensitivity: "preserve",
xmlSelfClosingSpace: false,
},
Expand Down
5 changes: 3 additions & 2 deletions frontend/scripts/get-resolved-playwright-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let file = fs.readFileSync("yarn.lock", "utf8");
let json = lockfile.parse(file);

console.log(
Object.entries(json.object).find(([package]) => package.startsWith("@playwright/test"))[1]
.version,
Object.entries(json.object).find(([pkg]) =>
pkg.startsWith("@playwright/test"),
)[1].version,
);
1,304 changes: 652 additions & 652 deletions frontend/src/__generated__/locales/es.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frontend/src/features/crawl-workflows/workflow-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class WorkflowEditor extends BtrixElement {
FormState["scheduleType"],
string
> = {
date: msg("Run on a specific date & time"),
date: msg("Run on a specific date and time"),
cron: msg("Run on a recurring basis"),
none: msg("No schedule"),
};
Expand Down Expand Up @@ -656,7 +656,7 @@ export class WorkflowEditor extends BtrixElement {
}}
>
<sl-icon slot="suffix" name="chevron-double-right"></sl-icon>
${msg("Review & Save")}
${msg(html`Review & Save`)}
</sl-button>
`;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/features/crawl-workflows/workflow-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export class WorkflowList extends LitElement {

render() {
return html` <div class="listHeader row">
<div class="col">${msg("Name & Schedule")}</div>
<div class="col">${msg(`Name & Schedule`)}</div>
<div class="col">${msg("Latest Crawl")}</div>
<div class="col">${msg("Total Size")}</div>
<div class="col">${msg("Last Modified")}</div>
Expand Down
30 changes: 13 additions & 17 deletions frontend/src/features/org/org-status-banner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localized, msg, str } from "@lit/localize";
import { differenceInHours } from "date-fns/fp";
import { differenceInDays } from "date-fns/fp";
import { html, type TemplateResult } from "lit";
import { customElement } from "lit/decorators.js";

Expand Down Expand Up @@ -62,21 +62,18 @@ export class OrgStatusBanner extends BtrixElement {
execMinutesQuotaReached,
} = this.org;

let hoursDiff = 0;
let daysDiff = 0;
let dateStr = "";
const futureCancelDate = subscription?.futureCancelDate || null;

if (futureCancelDate) {
hoursDiff = differenceInHours(new Date(), new Date(futureCancelDate));
daysDiff = Math.trunc(hoursDiff / 24);
daysDiff = differenceInDays(new Date(), new Date(futureCancelDate));

dateStr = this.localize.date(futureCancelDate, {
month: "long",
day: "numeric",
year: "numeric",
hour: "numeric",
timeZoneName: "short",
});
}

Expand All @@ -93,11 +90,12 @@ export class OrgStatusBanner extends BtrixElement {
content: () => {
return {
title:
hoursDiff < 24
? msg("Your org will be deleted within one day")
: daysDiff === 1
? msg("Your org will be deleted in one day.")
: msg(str`Your org will be deleted in ${daysDiff} days`),
daysDiff > 1
? msg(
str`Your org will be deleted in
${daysDiff} days`,
)
: `Your org will be deleted within one day`,
detail: html`
<p>
${msg(
Expand Down Expand Up @@ -126,13 +124,11 @@ export class OrgStatusBanner extends BtrixElement {
content: () => {
return {
title:
hoursDiff < 24
? msg("Your trial ends within one day")
: daysDiff === 1
? msg("You have one day left of your Browsertrix trial")
: msg(
str`You have ${daysDiff} days left of your Browsertrix trial`,
),
daysDiff > 1
? msg(
str`You have ${daysDiff} days left of your Browsertrix trial`,
)
: msg(`Your trial ends within one day`),

detail: html`
<p>
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/pages/org/archived-item-detail/ui/qa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,6 @@ export class ArchivedItemDetailQA extends BtrixElement {
<span class="text-danger">${errorCount}</span>
Failed ${pluralOf("pages", errorCount)}
`)}
${errorCount > 0
? html`—
<a
class="text-primary"
href=${`/orgs/${this.orgSlug}/workflows/${this.workflowId}/crawls/${this.crawlId}#logs`}
>${msg("View error logs")}</a
>`
: ""}
</p>
</div> `
: html`
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/org/workflow-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export class WorkflowDetail extends BtrixElement {
await this.cancel();
this.openDialogName = undefined;
}}
>${msg("Cancel & Discard Crawl")}</sl-button
>${msg(html`Cancel & Discard Crawl`)}</sl-button
>
</div>
</btrix-dialog>
Expand Down Expand Up @@ -677,7 +677,7 @@ export class WorkflowDetail extends BtrixElement {
@click=${() => (this.openDialogName = "cancel")}
>
<sl-icon name="x-octagon" slot="prefix"></sl-icon>
${msg("Cancel & Discard Crawl")}
${msg(html`Cancel & Discard Crawl`)}
</sl-menu-item>
`,
() => html`
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/org/workflows-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ export class WorkflowsList extends BtrixElement {
@click=${() => void this.cancel(workflow.lastCrawlId)}
>
<sl-icon name="x-octagon" slot="prefix"></sl-icon>
${msg("Cancel & Discard Crawl")}
${msg(html`Cancel & Discard Crawl`)}
</sl-menu-item>
`,
)}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/strings/crawl-workflows/infoText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const infoText: Partial<Record<Field, string | TemplateResult>> = {
"Adds a hard limit on the number of pages that will be crawled.",
),
crawlTimeoutMinutes: msg(
`Gracefully stop archiving after the specified amount of time has elapsed.`,
`Gracefully stop the crawler after a specified time limit.`,
),
maxCrawlSizeGB: msg(
`Gracefully stop archiving after the specified amount of data has been captured.`,
`Gracefully stop the crawler after a specified size limit.`,
),
pageLoadTimeoutSeconds: msg(
`Limits amount of time to wait for a page to load. Behaviors will run after this timeout only if the page is partially or fully loaded.`,
Expand All @@ -33,7 +33,7 @@ const infoText: Partial<Record<Field, string | TemplateResult>> = {
msg(`Choose a custom profile to make use of saved cookies and logged-in
accounts. Note that websites may log profiles out after a period of time.`),
crawlerChannel: msg(
`Choose a Browsertrix Crawler release channel. If available, other versions may provide new/experimental crawling features.`,
`Choose a Browsertrix Crawler Release Channel. If available, other versions may provide new/experimental crawling features.`,
),
blockAds: msg(
html`Blocks advertising content from being loaded. Uses
Expand Down
Loading
Loading