mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
48 lines
1.9 KiB
YAML
48 lines
1.9 KiB
YAML
# GitHub Action to update extension translations.
|
|
# It copies the latest messages.js files from the GDevelop-extensions repository
|
|
# and opens a Pull Request with the changes on GDevelop's repository.
|
|
|
|
name: Update extension translations
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags-ignore:
|
|
- "**" # Don't run on new tags
|
|
workflow_dispatch: # Allows manual triggering from the Actions tab
|
|
|
|
jobs:
|
|
update-extension-translations:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout current repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Clone GDevelop-extensions repository
|
|
run: git clone https://github.com/GDevelopApp/GDevelop-extensions.git /tmp/GDevelop-extensions
|
|
|
|
- name: Copy and rename translation files
|
|
run: |
|
|
mkdir -p newIDE/app/src/locales
|
|
for folder in /tmp/GDevelop-extensions/.translations/*; do
|
|
if [ -d "$folder" ]; then
|
|
lang=$(basename "$folder")
|
|
mkdir -p "newIDE/app/src/locales/$lang"
|
|
cp "$folder/messages.js" "newIDE/app/src/locales/$lang/extension-messages.js"
|
|
fi
|
|
done
|
|
cp /tmp/GDevelop-extensions/.translations/LocalesMetadata.js newIDE/app/src/locales/ExtensionLocalesMetadata.js
|
|
|
|
- name: Create Pull Request with updated translations
|
|
uses: peter-evans/create-pull-request@v6
|
|
with:
|
|
commit-message: Update extension translations [skip ci]
|
|
branch: chore/update-extension-translations
|
|
delete-branch: true
|
|
title: "[Auto PR] Update extension translations"
|
|
body: |
|
|
This updates the extension translations by copying the latest messages.js files from the GDevelop-extensions repository.
|
|
Each messages.js file is renamed to extension-messages.js and placed in the corresponding language folder under `newIDE/app/src/locales`.
|
|
|
|
Please review the changes carefully before merging.
|