Skip to content
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

Add Localisation Support #92

Merged
merged 22 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
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
48 changes: 48 additions & 0 deletions .github/workflows/crowdin-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Instructions for Using the Translation Workflow:
# Detailed guidelines for utilizing the translation workflow can be found in Section 5.12
# of our documentation: [How We Work](https://newfold-labs.github.io/how-we-work/).

name: Crowdin Download Action

on:
workflow_dispatch:
inputs:
base_branch:
description: 'Base branch for the pull request'
required: false
default: 'main'

permissions:
contents: write
pull-requests: write

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
auto_approve_imported: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: ${{ inputs.base_branch || 'main' }}

env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}

# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/crowdin-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Instructions for Using the Translation Workflow:
# Detailed guidelines for utilizing the translation workflow can be found in Section 5.12
# of our documentation: [How We Work](https://newfold-labs.github.io/how-we-work/).

name: Crowdin Upload Action

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: true
download_translations: false
# localization_branch_name: l10n_crowdin_translations
# create_pull_request: true
# auto_approve_imported: true
# pull_request_title: 'New Crowdin Translations'
# pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
# pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_PROJECT_ID }}

# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '7.3'
coverage: none
tools: composer, cs2pr

Expand Down
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'f032c348783b7743b18d');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '1506d30cd20535172ad5');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
}
],
"require-dev": {
"newfold-labs/wp-php-standards": "@stable"
"newfold-labs/wp-php-standards": "@stable",
"wp-cli/i18n-command": "^2.6.3"
},
"require": {
"newfold-labs/wp-module-ai": "^1.1.13",
Expand All @@ -43,5 +44,19 @@
"platform": {
"php": "7.3"
}
},
"scripts": {
"fix": "vendor/bin/phpcbf --standard=phpcs.xml .",
"i18n-pot": "vendor/bin/wp i18n make-pot . ./languages/wp-module-help-center.pot --headers='{\"Report-Msgid-Bugs-To\":\"https://github.com/newfold-labs/wp-module-help-center/issues\",\"POT-Creation-Date\":\"2025-02-13T09:55:55+00:00\"}' --exclude=tests,src",
"i18n-po": "vendor/bin/wp i18n update-po ./languages/wp-module-help-center.pot ./languages",
"i18n-php": "vendor/bin/wp i18n make-php ./languages",
"i18n-json": "rm -f languages/*.json && vendor/bin/wp i18n make-json ./languages --no-purge --pretty-print",
"i18n": [
"@i18n-pot",
"@i18n-po",
"@i18n-php",
"@i18n-json"
],
"lint": "vendor/bin/phpcs --standard=phpcs.xml -s ."
}
}
Loading
Loading