Changes to support weblate workflow (#2210)
This PR syncs the weblate branch back to main, and adds: - New Spanish translations contributed in weblate! - New GH action which reformats weblate commits with `localize:extract`, ensuring strings are not changed, and also runs `localize:build` to extract templates (as tested in PR: #2207) - Reformats existing XLIFF files to match `localize:extract`, including adding self-closing tags. - Update on generated templates - Prettier: disable alpha sorting XML attributes to hopefully minimize conflcits - Strings: change some strings that use `&` to be wrapped in html`` to ensure proper unencoding, or just switch to 'and' where that's not possible. --------- Co-authored-by: Weblate (bot) <hosted@weblate.org> Co-authored-by: Webrecorder Dev <dev@webrecorder.org> Co-authored-by: Kamborio <Kamborio15@users.noreply.hosted.weblate.org> Co-authored-by: Clara Itzel <missclaraitzel@gmail.com> Co-authored-by: weblate <weblate@users.noreply.github.com> Co-authored-by: emma <hi@emma.cafe> Co-authored-by: sua yoo <sua@webrecorder.org>
This commit is contained in:
		
							parent
							
								
									b741de0232
								
							
						
					
					
						commit
						b041baf5df
					
				
							
								
								
									
										3
									
								
								.github/workflows/docs-publish.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/docs-publish.yaml
									
									
									
									
										vendored
									
									
								
							| @ -27,8 +27,7 @@ jobs: | |||||||
|           DOCS_SOURCE_URL: https://app.browsertrix.com |           DOCS_SOURCE_URL: https://app.browsertrix.com | ||||||
|           ENABLE_ANALYTICS: true |           ENABLE_ANALYTICS: true | ||||||
| 
 | 
 | ||||||
|       - name: Build & Deploy Docs |       - name: Build Docs | ||||||
|         run: cd frontend/docs; mkdocs gh-deploy --force |         run: cd frontend/docs; mkdocs gh-deploy --force | ||||||
|         env: |         env: | ||||||
|           SITE_URL: https://docs.browsertrix.com |  | ||||||
|           ENABLE_ANALYTICS: true |           ENABLE_ANALYTICS: true | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								.github/workflows/frontend-build-prepare.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/frontend-build-prepare.yaml
									
									
									
									
										vendored
									
									
								
							| @ -10,10 +10,6 @@ on: | |||||||
| jobs: | jobs: | ||||||
|   setup-and-build: |   setup-and-build: | ||||||
|     runs-on: ubuntu-latest |     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: |     steps: | ||||||
|       # Setup: |       # Setup: | ||||||
| @ -78,17 +74,7 @@ jobs: | |||||||
|         run: yarn lint:check |         run: yarn lint:check | ||||||
| 
 | 
 | ||||||
|       # Localize: |       # Localize: | ||||||
|       - name: Extract strings |       - name: Localization build dry run | ||||||
|         working-directory: frontend |  | ||||||
|         run: yarn localize:extract |  | ||||||
|       - name: Commit extracted strings |  | ||||||
|         uses: stefanzweifel/git-auto-commit-action@v5 |  | ||||||
|         with: |  | ||||||
|           commit_message: Apply `localize:extract` changes |  | ||||||
|           file_pattern: '**/*.xlf' |  | ||||||
|           skip_fetch: true |  | ||||||
|           skip_checkout: true |  | ||||||
|       - name: Check localization build |  | ||||||
|         working-directory: frontend |         working-directory: frontend | ||||||
|         run: yarn localize:build |         run: yarn localize:build | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										54
									
								
								.github/workflows/weblate-reformat.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								.github/workflows/weblate-reformat.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -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,5 +1,4 @@ | |||||||
| site_name: Browsertrix Docs | site_name: Browsertrix Docs | ||||||
| site_url: !ENV SITE_URL |  | ||||||
| repo_url: https://github.com/webrecorder/browsertrix-cloud/ | repo_url: https://github.com/webrecorder/browsertrix-cloud/ | ||||||
| repo_name: Browsertrix | repo_name: Browsertrix | ||||||
| edit_uri: edit/main/frontend/docs/docs/ | edit_uri: edit/main/frontend/docs/docs/ | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ module.exports = { | |||||||
|         parser: "xml", |         parser: "xml", | ||||||
|         proseWrap: "never", |         proseWrap: "never", | ||||||
|         printWidth: Infinity, |         printWidth: Infinity, | ||||||
|         xmlSortAttributesByKey: true, |         xmlSortAttributesByKey: false, | ||||||
|         xmlWhitespaceSensitivity: "preserve", |         xmlWhitespaceSensitivity: "preserve", | ||||||
|         xmlSelfClosingSpace: false, |         xmlSelfClosingSpace: false, | ||||||
|       }, |       }, | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ let file = fs.readFileSync("yarn.lock", "utf8"); | |||||||
| let json = lockfile.parse(file); | let json = lockfile.parse(file); | ||||||
| 
 | 
 | ||||||
| console.log( | console.log( | ||||||
|   Object.entries(json.object).find(([package]) => package.startsWith("@playwright/test"))[1] |   Object.entries(json.object).find(([pkg]) => | ||||||
|     .version, |     pkg.startsWith("@playwright/test"), | ||||||
|  |   )[1].version, | ||||||
| ); | ); | ||||||
|  | |||||||
							
								
								
									
										1304
									
								
								frontend/src/__generated__/locales/es.ts
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1304
									
								
								frontend/src/__generated__/locales/es.ts
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -257,7 +257,7 @@ export class WorkflowEditor extends BtrixElement { | |||||||
|     FormState["scheduleType"], |     FormState["scheduleType"], | ||||||
|     string |     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"), |     cron: msg("Run on a recurring basis"), | ||||||
|     none: msg("No schedule"), |     none: msg("No schedule"), | ||||||
|   }; |   }; | ||||||
| @ -656,7 +656,7 @@ export class WorkflowEditor extends BtrixElement { | |||||||
|         }} |         }} | ||||||
|       > |       > | ||||||
|         <sl-icon slot="suffix" name="chevron-double-right"></sl-icon> |         <sl-icon slot="suffix" name="chevron-double-right"></sl-icon> | ||||||
|         ${msg("Review & Save")} |         ${msg(html`Review & Save`)} | ||||||
|       </sl-button> |       </sl-button> | ||||||
|     `;
 |     `;
 | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -461,7 +461,7 @@ export class WorkflowList extends LitElement { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     return html` <div class="listHeader row">
 |     return html` <div class="listHeader row">
 | ||||||
|         <div class="col">${msg("Name & Schedule")}</div> |         <div class="col">${msg(html`Name & Schedule`)}</div> | ||||||
|         <div class="col">${msg("Latest Crawl")}</div> |         <div class="col">${msg("Latest Crawl")}</div> | ||||||
|         <div class="col">${msg("Total Size")}</div> |         <div class="col">${msg("Total Size")}</div> | ||||||
|         <div class="col">${msg("Last Modified")}</div> |         <div class="col">${msg("Last Modified")}</div> | ||||||
|  | |||||||
| @ -348,7 +348,7 @@ export class WorkflowDetail extends BtrixElement { | |||||||
|               await this.cancel(); |               await this.cancel(); | ||||||
|               this.openDialogName = undefined; |               this.openDialogName = undefined; | ||||||
|             }} |             }} | ||||||
|             >${msg("Cancel & Discard Crawl")}</sl-button |             >${msg(html`Cancel & Discard Crawl`)}</sl-button | ||||||
|           > |           > | ||||||
|         </div> |         </div> | ||||||
|       </btrix-dialog> |       </btrix-dialog> | ||||||
| @ -677,7 +677,7 @@ export class WorkflowDetail extends BtrixElement { | |||||||
|                 @click=${() => (this.openDialogName = "cancel")} |                 @click=${() => (this.openDialogName = "cancel")} | ||||||
|               > |               > | ||||||
|                 <sl-icon name="x-octagon" slot="prefix"></sl-icon> |                 <sl-icon name="x-octagon" slot="prefix"></sl-icon> | ||||||
|                 ${msg("Cancel & Discard Crawl")} |                 ${msg(html`Cancel & Discard Crawl`)} | ||||||
|               </sl-menu-item> |               </sl-menu-item> | ||||||
|             `,
 |             `,
 | ||||||
|             () => html` |             () => html` | ||||||
|  | |||||||
| @ -508,7 +508,7 @@ export class WorkflowsList extends BtrixElement { | |||||||
|             @click=${() => void this.cancel(workflow.lastCrawlId)} |             @click=${() => void this.cancel(workflow.lastCrawlId)} | ||||||
|           > |           > | ||||||
|             <sl-icon name="x-octagon" slot="prefix"></sl-icon> |             <sl-icon name="x-octagon" slot="prefix"></sl-icon> | ||||||
|             ${msg("Cancel & Discard Crawl")} |             ${msg(html`Cancel & Discard Crawl`)} | ||||||
|           </sl-menu-item> |           </sl-menu-item> | ||||||
|         `,
 |         `,
 | ||||||
|       )} |       )} | ||||||
|  | |||||||
| @ -12,10 +12,10 @@ const infoText: Partial<Record<Field, string | TemplateResult>> = { | |||||||
|     "Adds a hard limit on the number of pages that will be crawled.", |     "Adds a hard limit on the number of pages that will be crawled.", | ||||||
|   ), |   ), | ||||||
|   crawlTimeoutMinutes: msg( |   crawlTimeoutMinutes: msg( | ||||||
|     `Gracefully stop archiving after the specified amount of time has elapsed.`, |     `Gracefully stop the crawler after a specified time limit.`, | ||||||
|   ), |   ), | ||||||
|   maxCrawlSizeGB: msg( |   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( |   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.`, |     `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.`, | ||||||
| @ -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
 |     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.`),
 |   accounts. Note that websites may log profiles out after a period of time.`),
 | ||||||
|   crawlerChannel: msg( |   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( |   blockAds: msg( | ||||||
|     html`Blocks advertising content from being loaded. Uses
 |     html`Blocks advertising content from being loaded. Uses
 | ||||||
|  | |||||||
							
								
								
									
										2989
									
								
								frontend/xliff/es.xlf
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2989
									
								
								frontend/xliff/es.xlf
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user