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

多言語のReadMeの自動翻訳actionsの修正 #31

Merged
merged 18 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 17 additions & 5 deletions .github/scripts/translate_readme.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import openai
from openai import OpenAI
import os

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

def translate_text(text, target_language):
openai.api_key = os.environ["OPENAI_API_KEY"]
completion = openai.ChatCompletion.create(
model="gpt-4o-mini",
completion = client.chat.completions.create(
model="gpt-4o-mini", # 使用するモデルの指定
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": f"Translate the following text to {target_language}: {text}"}
]
)
return completion.choices[0].message['content']
# メッセージのコンテンツに直接アクセスする
return completion.choices[0].message.content

def main():
# Read the original README
Expand All @@ -27,5 +29,15 @@ def main():
with open('README_CN.md', 'w', encoding='utf-8') as file:
file.write(translated_cn)

# Translate to Spanish
translated_es = translate_text(original_text, 'Spanish')
with open('README_ES.md', 'w', encoding='utf-8') as file:
file.write(translated_es)

# Translate to French
translated_fr = translate_text(original_text, 'French')
with open('README_FR.md', 'w', encoding='utf-8') as file:
file.write(translated_fr)

if __name__ == "__main__":
main()
70 changes: 47 additions & 23 deletions .github/workflows/translate_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,57 @@ name: Translate README

on:
pull_request:
branches:
- develop
paths:
- README.md

jobs:
translate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install OpenAI library
run: pip install openai

- name: Run translation script
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python .github/scripts/translate_readme.py

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README_EN.md README_CN.md
git commit -m "Update translations" || echo "No changes to commit"
git push
- name: Checkout repository
uses: actions/[email protected]

- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.11'

- name: Install OpenAI library
run: pip install openai

- name: Run translation script
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python .github/scripts/translate_readme.py

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

# 変更をステージしてコミット
git add README_EN.md README_CN.md README_ES.md README_FR.md
if git commit -m "Update translations"; then
echo "Changes committed successfully."

# Pullでリモートの最新の変更を取り込み、リベース
if git pull --rebase origin ${{ github.head_ref }}; then
echo "Successfully rebased."
else
echo "Rebase failed. Please review the errors."
exit 1 # エラーが発生した場合、処理を中止
fi

# スタッシュが必要かを確認
if git stash list | grep -q "stash@{0}"; then
# スタッシュが存在する場合はポップする
git stash pop
fi

# 最後にプッシュ
git push origin HEAD:${{ github.head_ref }}
else
echo "No changes to commit"
fi
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
[![Unity Version](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![Releases](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)

日本語 | [English](README_EN.md) | [中文](README_CN.md)
日本語 | [English](README_EN.md) | [中文](README_CN.md) | [Español](README_ES.md) | [Français](README_FR.md)

**注意**: 上記の言語(English、中文、Español、Français)は、GPT-4o-miniによる自動翻訳で生成されています。翻訳の精度やニュアンスに関しては、原文(日本語)をご参照ください。

## 概要

「uDesktopMascot」は、デスクトップ上にキャラクターを表示し、ユーザーのインタラクションに応じた反応や音声を再生するオープンソースのプロジェクトです。このプロジェクトは、Unityを用いて開発されており、VRM形式のキャラクターをサポートしていますので、自分の好きなキャラクターを簡単にデスクトップ上で楽しむことができます。

デスクトップマスコットのOpen Projectです。

## Features
* StreamingAssetsに配置した任意VRMファイルを読み込んで表示します。複数ある場合は、検索の先頭にあるものを読み込みます。
* SteamingAssets/Voice/以下に配置した音声ファイルを読み込んで再生します。複数ある場合は、ランダムで再生します。
* クリック時に再生される音声は、StreamingAssets/Voice/Click/に配置した音声ファイルを読み込んで再生します。
* SteamingAssets/BGM/以下に配置した音楽ファイルを読み込んで再生します。複数ある場合は、ランダムで再生します。
* キャラクターのデフォルトのボイスの追加
* デフォルトのボイスは、[COEIROINK:つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan)の音声を使用しています。
* アプリ起動時、アプリ終了時、クリック時に再生されます。

# requirements
* Unity 6000.0.31f1(IL2CPP)
Expand Down
37 changes: 22 additions & 15 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# uDesktopMascot

[![Unity Version](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![Releases](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)
[![Unity 版本](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![版本发布](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)

[日本語](README.md) | 中文 | [English](README_EN.md)
日本語 | [English](README_EN.md) | [中文](README_CN.md) | [Español](README_ES.md) | [Français](README_FR.md)

这是一个桌面吉祥物的开放项目
**注意**: 上述语言(English、中文、Español、Français)是由GPT-4o-mini自动翻译生成的。关于翻译的准确性和语气,请参阅原文(日本语)

## 功能
* 加载并显示放置在 StreamingAssets 文件夹中的任意 VRM 文件。如果有多个文件,将加载第一个找到的文件。
* 加载并播放放置在 `StreamingAssets/Voice/` 文件夹中的音频文件。如果有多个文件,将随机播放一个。
* 点击时播放的音频从 `StreamingAssets/Voice/Click/` 中的文件加载。
* 加载并播放 `StreamingAssets/BGM/` 文件夹中的音乐文件。如果有多个文件,将随机播放一个。
## 概述

# 要求
* Unity 6000.0.31f1
“uDesktopMascot”是一个开源项目,它可以在桌面上显示角色,根据用户的互动做出反应并播放声音。该项目是使用Unity开发的,支持VRM格式的角色,因此您可以轻松在桌面上享受自己喜欢的角色。

## 特性
* 可以读取并显示放置在StreamingAssets中的任意VRM文件。如果有多个,则读取搜索到的第一个。
* 可以读取并播放放置在StreamingAssets/Voice/中的音频文件。如果有多个,则随机播放。
* 在点击时播放的声音,从StreamingAssets/Voice/Click/中读取并播放音频文件。
* 可以读取并播放放置在StreamingAssets/BGM/中的音乐文件。如果有多个,则随机播放。
* 角色的默认声音添加
* 默认声音使用[COEIROINK:つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan)的音频。
* 在应用程序启动时、退出时和点击时播放。

# 需求
* Unity 6000.0.31f1(IL2CPP)

# 关于素材
* 默认角色动画是使用 [Unity Muse Animate](https://muse.unity.com/ja-jp/explore) 创建的
* 默认背景音乐 (BGM) 是在 MidraLab 内部创建的素材
* 使用的字体是 [Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan)。根据 [SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan) 进行再发行。字体的版权属于原作者(Google)。
* 默认语音来自 [COEIROINK: 月读酱](https://coeiroink.com/character/audio-character/tsukuyomi-chan)。关于使用的事宜已事先获得 COEIROINK 的确认
* 默认的角色动画是通过[Unity Muse Animate](https://muse.unity.com/ja-jp/explore)制作的
* 默认的背景音乐是MidraLab内创建的资产
* 字体使用[Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan)。根据[SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan)重新分发Noto Sans JP字体。字体的版权归原作者(Google)所有
* 默认声音使用[COEIROINK:つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan)的音频。使用方法已事先与COEIROINK确认
29 changes: 18 additions & 11 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@
[![Unity Version](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![Releases](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)

[日本語](README.md) | English | [中文](README_CN.md)
Japanese | [English](README_EN.md) | [中文](README_CN.md) | [Español](README_ES.md) | [Français](README_FR.md)

This is an open project for a desktop mascot.
**Note**: The above languages (English, 中文, Español, Français) were generated by automatic translation using GPT-4o-mini. Please refer to the original text (Japanese) for accuracy and nuances of the translation.

## Overview

"uDesktopMascot" is an open-source project that displays characters on the desktop and plays reactions and sounds based on user interactions. This project is developed using Unity and supports VRM format characters, allowing you to easily enjoy your favorite characters on your desktop.

## Features
* Loads and displays any VRM file placed in the StreamingAssets folder. If there are multiple files, it loads the first one found.
* Loads and plays audio files placed in the `StreamingAssets/Voice/` folder. If there are multiple files, it plays one randomly.
* The audio played upon clicking is loaded from the files placed in `StreamingAssets/Voice/Click/`.
* Loads and plays music files from the `StreamingAssets/BGM/` folder. If there are multiple files, it plays one randomly.
* Loads and displays any VRM files placed in StreamingAssets. If there are multiple files, it loads the one at the top of the search.
* Loads and plays sound files placed under SteamingAssets/Voice/. If there are multiple files, it plays them randomly.
* The sounds played on click are loaded and played from the audio files placed in StreamingAssets/Voice/Click/.
* Loads and plays music files placed under SteamingAssets/BGM/. If there are multiple files, it plays them randomly.
* Addition of a default voice for the character
* The default voice uses sounds from [COEIROINK: Tsukuyomi-chan](https://coeiroink.com/character/audio-character/tsukuyomi-chan).
* Sounds will play when the app starts, ends, and on clicks.

# Requirements
* Unity 6000.0.31f1
* Unity 6000.0.31f1 (IL2CPP)

# About the Assets
# Regarding Materials
* The default character animations are created using [Unity Muse Animate](https://muse.unity.com/ja-jp/explore).
* The default background music (BGM) is an asset created within MidraLab.
* The font used is [Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan). It is redistributed under the [SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan). The copyright of the font belongs to the original author (Google).
* The default voice is from [COEIROINK: Tsukuyomi-chan](https://coeiroink.com/character/audio-character/tsukuyomi-chan). Prior confirmation regarding usage has been obtained from COEIROINK.
* The default background music is an asset created within MidraLab.
* The font used is [Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan). It is redistributed based on the [SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan). The copyright for the font is owned by the original creator (Google).
* The default voice uses sounds from [COEIROINK: Tsukuyomi-chan](https://coeiroink.com/character/audio-character/tsukuyomi-chan). Usage has been confirmed with COEIROINK in advance.
32 changes: 32 additions & 0 deletions README_ES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Sure! Here is the translation of the provided text into Spanish:

# uDesktopMascot

[![Versión de Unity](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![Publicaciones](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)

日本語 | [English](README_EN.md) | [中文](README_CN.md) | [Español](README_ES.md) | [Français](README_FR.md)

**Nota**: Los idiomas mencionados anteriormente (English, 中文, Español, Français) han sido generados mediante traducción automática por GPT-4o-mini. Para la precisión y matices de la traducción, consulte el texto original (日本語).

## Resumen

"uDesktopMascot" es un proyecto de código abierto que muestra un personaje en el escritorio y reproduce reacciones y sonidos en función de la interacción del usuario. Este proyecto se ha desarrollado utilizando Unity y admite personajes en formato VRM, por lo que puedes disfrutar fácilmente de tu personaje favorito en el escritorio.

## Características
* Lee y muestra cualquier archivo VRM colocado en StreamingAssets. Si hay varios, se carga el que se encuentra primero en la búsqueda.
* Lee y reproduce archivos de audio colocados en StreamingAssets/Voice/. Si hay varios, se reproducen de forma aleatoria.
* Los sonidos que se reproducen al hacer clic se cargan desde los archivos de audio colocados en StreamingAssets/Voice/Click/.
* Lee y reproduce archivos de música colocados en StreamingAssets/BGM/. Si hay varios, se reproducen de forma aleatoria.
* Adición de la voz predeterminada del personaje.
* La voz predeterminada utiliza audio de [COEIROINK: つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan).
* Se reproduce al iniciar la aplicación, al cerrarla y al hacer clic.

# Requisitos
* Unity 6000.0.31f1(IL2CPP)

# Sobre los materiales
* La animación predeterminada del personaje se ha creado utilizando [Unity Muse Animate](https://muse.unity.com/ja-jp/explore).
* La BGM predeterminada es un asset creado dentro de MidraLab.
* La fuente es [Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan). Se redistribuye la fuente Noto Sans JP de acuerdo con la [SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan). Los derechos de autor de la fuente pertenecen al autor original (Google).
* La voz predeterminada utiliza audio de [COEIROINK: つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan). El uso ha sido verificado previamente con COEIROINK.
30 changes: 30 additions & 0 deletions README_FR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# uDesktopMascot

[![Version de Unity](https://img.shields.io/badge/Unity-6000.0%2B-blueviolet?logo=unity)](https://unity.com/releases/editor/archive)
[![Releases](https://img.shields.io/github/release/MidraLab/uDesktopMascot.svg)](https://github.com/MidraLab/uDesktopMascot/releases)

日本語 | [English](README_EN.md) | [中文](README_CN.md) | [Español](README_ES.md) | [Français](README_FR.md)

**Remarque** : Les langues ci-dessus (English, 中文, Español, Français) ont été générées par traduction automatique avec GPT-4o-mini. Pour la précision et les nuances de la traduction, veuillez vous référer au texte original (日本語).

## Aperçu

« uDesktopMascot » est un projet open source qui affiche des personnages sur le bureau et joue des réactions et des voix en fonction des interactions de l'utilisateur. Ce projet est développé en utilisant Unity et prend en charge les personnages au format VRM, ce qui permet de profiter facilement de vos personnages préférés sur votre bureau.

## Caractéristiques
* Charge et affiche n'importe quel fichier VRM placé dans le dossier StreamingAssets. En cas de plusieurs fichiers, il charge le premier trouvé.
* Charge et joue des fichiers audio placés dans le dossier SteamingAssets/Voice. En cas de plusieurs fichiers, ils sont joués aléatoirement.
* Les audio jouées au moment des clics proviennent de fichiers audio placés dans StreamingAssets/Voice/Click/.
* Charge et joue des fichiers de musique placés dans le dossier SteamingAssets/BGM. En cas de plusieurs fichiers, ils sont joués aléatoirement.
* Ajout d'une voix par défaut au personnage
* La voix par défaut utilise l'audio de [COEIROINK:つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan).
* Elle est jouée au démarrage de l'application, à la fermeture de l'application et au moment des clics.

# Exigences
* Unity 6000.0.31f1 (IL2CPP)

# À propos des ressources
* Les animations par défaut des personnages sont créées à l'aide de [Unity Muse Animate](https://muse.unity.com/ja-jp/explore).
* La musique de fond par défaut a été créée comme un asset au sein de MidraLab.
* La police utilisée est [Noto Sans Japanese](https://fonts.google.com/noto/specimen/Noto+Sans+JP?lang=ja_Jpan). Nous répartissons la police Noto Sans JP selon la [SIL OPEN FONT LICENSE Version 1.1](https://fonts.google.com/noto/specimen/Noto+Sans+JP/license?lang=ja_Jpan). Les droits d'auteur de la police appartiennent à l'auteur original (Google).
* La voix par défaut utilise l'audio de [COEIROINK:つくよみちゃん](https://coeiroink.com/character/audio-character/tsukuyomi-chan). Nous avons préalablement vérifié avec COEIROINK pour les modalités d'utilisation.