-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #623 from cheeaun/main
Update from main
- Loading branch information
Showing
121 changed files
with
111,662 additions
and
2,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: i18n PR auto-merge | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-and-merge: | ||
if: contains(github.event.pull_request.labels.*.name, 'i18n') && | ||
github.event.pull_request.base.ref == 'main' && | ||
github.event.pull_request.head.ref == 'l10n_main' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: sleep 15 | ||
|
||
- name: Check if the branch is dirty | ||
run: | | ||
git fetch origin ${{ github.event.pull_request.head.ref }} | ||
if [ $(git rev-parse HEAD) != $(git rev-parse origin/${{ github.event.pull_request.head.ref }}) ]; then | ||
echo "Branch is dirty. Exiting..." | ||
exit 0 | ||
fi | ||
- name: Check auto-merge conditions | ||
run: | | ||
BASE_SHA="${{ github.event.pull_request.base.sha }}" | ||
HEAD_SHA="${{ github.event.pull_request.head.sha }}" | ||
# Debug: Show the base and head SHA | ||
echo "Base SHA: $BASE_SHA" | ||
echo "Head SHA: $HEAD_SHA" | ||
# Check if the commits exist | ||
if ! git cat-file -e $BASE_SHA || ! git cat-file -e $HEAD_SHA; then | ||
echo "ERROR: One or both of the commits are not available." | ||
exit 1 | ||
fi | ||
# Calculate the total number of lines changed (added, removed, or modified) | ||
LINES_CHANGED=$(git diff --shortstat $BASE_SHA $HEAD_SHA | awk '{print $4 + $6 + $8}') | ||
if [ -z "$LINES_CHANGED" ]; then | ||
LINES_CHANGED=0 | ||
fi | ||
echo "Total lines changed: $LINES_CHANGED" | ||
# Check if the number of lines changed is more than 50 | ||
if [ "$LINES_CHANGED" -le 50 ]; then | ||
exit 0 | ||
else | ||
echo "More than 50 lines have been changed. Merging pull request." | ||
PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) | ||
gh pr merge $PR_NUMBER --auto --squash || true | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Update Catalogs | ||
|
||
on: | ||
push: | ||
branches: | ||
- l10n_main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-catalogs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: l10n_main | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: npm ci | ||
- name: Update catalogs.json | ||
run: | | ||
node scripts/catalogs.js | ||
if git diff --quiet src/data/catalogs.json; then | ||
echo "No changes to catalogs.json" | ||
else | ||
echo "Changes to catalogs.json" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git add src/data/catalogs.json | ||
git commit -m "Update catalogs.json" | ||
git push origin HEAD:l10n_main || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pull_request_labels: | ||
- i18n | ||
commit_message: New translations (%language%) | ||
append_commit_message: false | ||
files: | ||
- source: /src/locales/en.po | ||
translation: /src/locales/%locale%.po |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ALL_LOCALES } from './src/locales'; | ||
|
||
const config = { | ||
locales: ALL_LOCALES, | ||
sourceLocale: 'en', | ||
pseudoLocale: 'pseudo-LOCALE', | ||
fallbackLocales: { | ||
default: 'en', | ||
}, | ||
catalogs: [ | ||
{ | ||
path: '<rootDir>/src/locales/{locale}', | ||
include: ['src'], | ||
}, | ||
], | ||
// compileNamespace: 'es', | ||
orderBy: 'origin', | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.