LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-22-2024, 11:42 PM   #1
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Rep: Reputation: 123Reputation: 123
Enable additional language support of FFaudioConverter's GUI menu


Hello,

I'll share how did I enable Japanese localization of FFaudioConverter's GUI menu.
This procedure is quite simple and easy. So,it might be useful for other language users who want to enable their own language menu of FFaudioConverter.

OK. Following how2 is an example of Japanese language case.
Please change "ja / ja_JP" part to your own LANG.

Step-1. Get source
wget https://github.com/Bleuzen/FFaudioCo...-0.31.0.tar.gz

Step-2. Create new message data of my language (ja.ts)
1) Extract the source and pic a base *.ts data from FFaudioConverter-0.31.0/translations/ directory.
(I used de.ts as a base ts.)

2) cp FFaudioConverter-0.31.0/translations/de.ts .
mv de.ts ja.ts

3) Edit Line 3 with a text editor
<TS version="2.1" language="de_DE">
to
<TS version="2.1" language="ja_JP">

4) Tranlate ja.ts into my own language
Qt5-Linguist will be the best tool for creating TS data, but a text editor such as nano is also OK, because translation items are only '49" in case of this application.

[for example]
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ja_JP">
<context>
    <name>AboutDialog</name>
    <message>
        <location filename="../src/aboutdialog.ui" line="14"/>
        <source>About</source>
        <translation>FFaudioConverterについて</translation>
    </message>
    <message>
        <location filename="../src/aboutdialog.ui" line="26"/>
        <source>Close</source>
        <translation>閉じる</translation>
    </message>
    <message>
        <location filename="../src/aboutdialog.ui" line="105"/>
        <source>About Qt</source>
        <translation>Qtについて</translation>
    </message>
    <message>
        <location filename="../src/aboutdialog.cpp" line="39"/>
        <source>developed by</source>
        <translation>開発者</translation>
    </message>
...
...

Step-3. patches

001_FFaudioConverter_Japanese-translation.patch

Please change "ja.ts" part of the patch to your own LANG, for example "it.ts".
(You may change name of this patch as you like.)

Code:
diff -Nru a/FFaudioConverter.pro b/FFaudioConverter.pro
--- a/FFaudioConverter.pro    2024-02-12 16:10:31.403639045 +0900
+++ b/FFaudioConverter.pro    2024-02-12 16:10:08.034681049 +0900
@@ -71,6 +71,7 @@
 TRANSLATIONS += \
     translations/de.ts \
     translations/fr.ts \
+    translations/ja.ts \
     translations/tr.ts
 
 CONFIG += lrelease
diff -Nru a/com.github.Bleuzen.FFaudioConverter.desktop b/com.github.Bleuzen.FFaudioConverter.desktop
--- a/com.github.Bleuzen.FFaudioConverter.desktop    2024-02-12 16:10:43.008618177 +0900
+++ b/com.github.Bleuzen.FFaudioConverter.desktop    2024-02-12 16:09:53.024708019 +0900
@@ -1,7 +1,9 @@
 [Desktop Entry]
 Comment=DnD GUI for converting audio files
+Comment[ja]=DnD GUI オーディオファイル変換
 Exec=ffaudioconverter %F
 Name=FFaudioConverter
+Name[ja]=オーディファイル変換GUIツール
 Icon=com.github.Bleuzen.FFaudioConverter
 StartupNotify=true
 Type=Application
002_dark-status-color.patch ; This patch is not neccessary.
Code:
--- a/src/mainwindow.cpp    2024-02-12 17:51:00.868083373 +0900
+++ b/src/mainwindow.cpp    2024-02-12 17:51:16.343100355 +0900
@@ -171,19 +171,19 @@
 {
     if(status == FFmpegTask::ConvertStatus::Pending) {
         model->setData(index, tr("Pending"));
-        model->setData(index, QColor(Qt::yellow), Qt::BackgroundRole);
+        model->setData(index, QColor(Qt::darkYellow), Qt::BackgroundRole);
     } else if(status == FFmpegTask::ConvertStatus::Converting) {
         model->setData(index, tr("Converting"));
         model->setData(index, QColor(Qt::darkYellow), Qt::BackgroundRole);
     } else if(status == FFmpegTask::ConvertStatus::Done) {
         model->setData(index, tr("Done"));
-        model->setData(index, QColor(Qt::green), Qt::BackgroundRole);
+        model->setData(index, QColor(Qt::darkGreen), Qt::BackgroundRole);
     } else if(status == FFmpegTask::ConvertStatus::Failed) {
         model->setData(index, tr("Failed"));
-        model->setData(index, QColor(Qt::red), Qt::BackgroundRole);
+        model->setData(index, QColor(Qt::darkRed), Qt::BackgroundRole);
     } else if(status == FFmpegTask::ConvertStatus::Skipped) {
         model->setData(index, tr("Skipped"));
-        model->setData(index, QColor(Qt::blue), Qt::BackgroundRole);
+        model->setData(index, QColor(Qt::darkBlue), Qt::BackgroundRole);
     }
 }
Step-4. SlackBuild (Diff from SBo's original slackbuild)
Code:
--- FFaudioConverter.SlackBuild	2023-04-08 11:20:23.000000000 +0900
+++ FFaudioConverter.SlackBuild.new	2024-03-23 12:45:13.819315587 +0900
@@ -26,7 +26,7 @@
 
 PRGNAM=FFaudioConverter
 VERSION=${VERSION:-0.31.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
 TAG=${TAG:-_SBo}
 PKGTYPE=${PKGTYPE:-tgz}
 
@@ -69,6 +69,14 @@
 rm -rf $PRGNAM-$VERSION
 tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
 cd $PRGNAM-$VERSION
+
+# Apply Japanese translation fix patch
+zcat $CWD/001_FFaudioConverter_Japanese-translation.patch.gz | patch -p1 --verbose || exit 1
+cp $CWD/ja.ts translations/ja.ts
+
+# Fix status colors match to Dark theme
+zcat $CWD/002_dark-status-color.patch.gz | patch -p1 --verbose || exit 1
+
 chown -R root:root .
 find -L . \
  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
I also attached several screenshots.

Hope this would help for some FFaudioConverter's users.
Attached Thumbnails
Click image for larger version

Name:	FFAC_001.png
Views:	11
Size:	16.5 KB
ID:	42640   Click image for larger version

Name:	FFAC_002.png
Views:	13
Size:	31.5 KB
ID:	42641   Click image for larger version

Name:	FFAC_003.png
Views:	14
Size:	27.4 KB
ID:	42642   Click image for larger version

Name:	FFAC_004.png
Views:	14
Size:	67.8 KB
ID:	42643  
 
Old 03-23-2024, 04:58 AM   #2
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 959

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Great work! I really hope that the project maintainers will accept your pull request at
https://github.com/Bleuzen/FFaudioConverter/pull/16/

regards Henrik
 
Old 03-25-2024, 04:03 PM   #3
J_W
Member
 
Registered: Apr 2004
Location: Yamagata, JAPAN
Distribution: Slackware64-current
Posts: 189

Original Poster
Rep: Reputation: 123Reputation: 123
Hi, Henrik

Thanks for your comments.
I hope so too. But, upstream of FFaudioConverter git seems to be sleeping since 2 years ago.
So, I think it might be a long shot that my pull request is approved and committed by the maintainer.
That's why I shared my localization method here to other users.

Cheers,
J_W
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New install. Additional questions: how to enable autologin. how to enable crystal_hd driver Horia Georgescu 4MLinux 1 12-19-2019 06:17 PM
Additional Language Support Ironica Linux From Scratch 3 02-28-2005 03:03 PM
FC2: Adding additional language support kimchee411 Fedora 1 10-11-2004 08:18 AM
FC2: Adding additional language support kimchee411 Linux - Newbie 0 10-10-2004 02:49 PM
RH8, would it be possible to add additional language support after installation? luoluotu Linux - Newbie 3 12-20-2002 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration