0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Chatgptで、日本語のパワポを英訳する試み。<未完成/試行錯誤中>

Last updated at Posted at 2025-03-19

ChatgptとPythonモジュール(python‑pptx)を使って、日本語のパワーポイントを英訳する試みを実行中です。

<スタート> 下記のサンプル日本語パワポを英訳します。
名称未設定9a.png
名称未設定9b.png

<現状>
名称未設定9c.png

<説明>
Pythonでコードを組んで、pythonを走らせて変換しました。
尚、手順は下記。
----
1)Chatgptに対して、翻訳元となる日本語パワポを添付して、英訳しろと指示!
2) Chatgptは、Pythonのコードを吐き出す。
3) Pythonコードをコピペして、ローカルPCで実行。(当然、ローカルPCには、Python実行環境が必要。)
-----

元日本語を拾って、精確に英訳はしているけど、レイアウトが崩れたと言うか、消えた。現在、試行錯誤中。
これが出来れば、俺の仕事は凄くラクになるから、頑張ります!🫡

尚、下記マニュアルは、Chatgptに書かせました。英語です。ご容赦を!


Simple Manual: Converting a Japanese PPT to an English Single-Slide PPT

Overview
This manual explains how to convert a Japanese PowerPoint file (using sample7.ppt as an example) into an English version by creating a new PowerPoint file with one slide that contains all the translated text. The process uses Python and the python‑pptx library.

2.
Prerequisites
Python 3.x must be installed.
pip (the Python package installer) should be installed.
The python‑pptx library is required.

3.
Installation
3.1 Installing pip (if not already installed)
Open your Terminal.
Verify Python 3 is installed:

terminal
python3 --version

Install pip using ensurepip:

terminal
python3 -m ensurepip --upgrade

Alternatively, download and run get‑pip.py:

terminal
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

Verify the pip installation:

terminal
python3 -m pip --version

3.2 Installing python‑pptx
Run this command in your Terminal:

terminal
python3 -m pip install python-pptx

4.
The Conversion Script
Create a new Python script (for example, convert_sample7.py) and paste the code below. This script creates a new PowerPoint file with one slide that contains the English translation of the content from sample7.ppt. (This English PPT can be created instantly using AI translator tools such as DeepL and Chatgpt.)

python: convert_sample7.py
from pptx import Presentation
from pptx.util import Inches

def build_sample7_single_slide():
    # Create a new presentation with a blank slide layout
    prs = Presentation()
    blank_slide_layout = prs.slide_layouts[6]  # Layout 6: Blank slide
    slide = prs.slides.add_slide(blank_slide_layout)
    
    # Add a title textbox
    title_box = slide.shapes.add_textbox(Inches(0.5), Inches(0.3), Inches(9), Inches(1))
    title_box.text_frame.text = "Slide 1: Overview"
    
    # Add a content textbox for the full translated text
    content_box = slide.shapes.add_textbox(Inches(0.5), Inches(1.3), Inches(9), Inches(5))
    content_frame = content_box.text_frame

    # Combined English translation of the source content:
    full_text = (
        "Topics Covered in This Section:\n"
        "  (1) In the society we live in, we are often surrounded by accounting information without even noticing. "
        "Let’s consider the role and significance of accounting information in our society.\n"
        "  (2) Accounting and accounting information are often called the common language of business. "
        "We will learn the reasons behind this designation.\n"
        "  (3) To study accounting effectively, it is important to link it with management issues. "
        "Embrace the idea that ‘accounting is management’ and put the 'Nikkei Memo Note' into practice.\n\n"
        "Occupations That Require Accounting:\n"
        "  • Certified Public Accountant (CPA): An accounting specialist exclusively authorized to audit and verify the appropriateness of a company’s financial statements. "
        "CPAs also work in finance, taxation, and management consulting (including M&A strategies).\n"
        "  • Tax Accountant: A professional who uses expertise in tax law and accounting to provide tax-related services.\n"
        "  • National Tax Agency Specialist: A public servant working in tax bureaus or offices, handling national tax matters.\n"
        "  • Small and Medium Enterprise Management Consultant: A specialist in business consulting who conducts management diagnoses for SMEs under the SME Law.\n"
        "  • Securities Analyst: A professional who analyzes various information and evaluates investment values, offering investment advice and managing investments.\n"
        "  • Financial Planning Practitioner: A professional providing comprehensive advice on personal asset management and finance.\n"
    )

    # Insert the full text into the content textbox
    p = content_frame.add_paragraph()
    p.text = full_text

    # Save the presentation as an English version PPTX file
    prs.save("sample7_English_single_slide.pptx")

if __name__ == "__main__":
    build_sample7_single_slide()
    print("sample7_English_single_slide.pptx has been created successfully!")

5.
Running the Script
Save the Script:
Save the above code as convert_sample7.py.

Run the Script:

Open your Terminal.
Navigate to the directory where convert_sample7.py is saved.
Execute the script by running:

terminal
python3 convert_sample7.py

This creates a new PowerPoint file named sample7_English_single_slide.pptx in the same directory.
Review and Customize:
Open the generated file in Microsoft PowerPoint and adjust the formatting (fonts, sizes, layout) as needed.

6.
Conclusion
This manual shows you how to convert a Japanese PowerPoint file (using sample7.ppt as an example) into an English single-slide version using Python and the python‑pptx library. You can share this manual with your colleagues to help streamline the translation process for presentations.

ーーーーーーー

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?