lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.71k stars 260 forks source link

Multi Language Support #445

Closed Teknoist closed 1 year ago

Teknoist commented 1 year ago

Checklist

Write your feature request here

Can we add language support.

ScrubN commented 1 year ago

Looking into adding support for this. We would need 2 translation file though; one for the GUI (UI elements) and one for Core (status messages). Though the help text in CLI may be limited to English only without rewriting the entire argument handler.

Also Translations would obviously have to be community submitted though so it will take time

ScrubN commented 1 year ago

Good news, it should be possible to fully localize the CLI help text. I'll get around to adding localization after finishing the GUI frontend for the new chatupdate mode

Teknoist commented 1 year ago

I will be happy to help you translate into Turkish.

viduxsh commented 1 year ago

I can help for italian

ScrubN commented 1 year ago

I'm taking a small break from programming while I wait for lay to review my open PRs, since 2 of them are pretty big changes. Once those have been merged, I'll continue working on translation support and I'll post here when it's ready for the actual translations.

When the time comes, it would be ideal for you guys submit PRs to my fork so the first few translations are bundled with my PR that adds translation support.

ScrubN commented 1 year ago

Apologies for the delay. I'll probably have initial language support up in a few days if not today. I'll do my best to translate the app to french so you guys can see how to do it.

ScrubN commented 1 year ago

Initial support for the GUI is completed, though there are some outstanding GUI changes that will add more strings to be translated. I created an initial French translation as well specifically in its own commit (53245be1fe55768d525905e81cc2cd0c12469b03) so you guys can see the 3 steps needed to add a new language.

I recommend you use an editor like VSCode instead of full Visual Studio because VSCode does not auto generate designer.cs files and you can see when a key has a trailing space for the tooltip.

I will try to add translations to Core for the status/error messages but no guarantees that will work. I'm not really sure if translating the CLI will be super worth it to be honest. Translating the help text is a very different process than translating the GUI and Core and it's just a pain.

You can either wait for the PR to be merged to start working or you can submit a PR on my fork to the localization branch and it will be merged into the initial support PR.

Teknoist commented 1 year ago

There are still some English words in the French file, is it a necessity or a preference? Did we have Strings.en.resx file little hard for me to France to Turkish.

image

ScrubN commented 1 year ago

The remaining English words are because I haven't read/spoken French since my first year of high school and am very rusty so I translated only the necessities. The only strings you can not translate have comments noting that they should not be translated.

Strings.resx is the English translation, I probably should have clarified that because it is not included in the French commit.

ScrubN commented 1 year ago

Also if you want to make sure your translation looks correct in practice you will need to publish the application using Visual Studio or by following the CLI build instructions because for whatever reason it does not work in debug/release builds.

Teknoist commented 1 year ago

image I translated all of them except the theme options.

Teknoist commented 1 year ago

Can you help me send the files? Github confuses me a bit.

ScrubN commented 1 year ago

Of course.

I would like you to create a new branch on your fork Teknoist/TwitchDownloader and commit everything you currently have locally to that branch.

Next you will need to go to my fork ScrubN/TwitchDownloader and click create a new pull request. From there you will see 2 dropdown menus with an arrow pointing from your fork to my fork. Select your branch with the changes and then select my branch named "localization support". From there I will be able merge your files into #508.

If you ever realize your need to make a change, you can simply make more commits to the same branch and it will automatically add those changes to your pull request. I will purposely wait to merge your pull request because of outstanding GUI changes that will add more text to be localized, which should let you practice committing after a pull request has been made.

Also I think you missed the update button ;)

ScrubN commented 1 year ago

Also the theme names cannot be localized because they pull from the file names of the themes and the literal word "System" is specifically checked for to determine automatic theming, making it possible to have the theme name be "System" in French but the theme service is checking for "System" in Turkish causing confusion and disabling auto-theming.

Teknoist commented 1 year ago

I tried to create a new branch, but there are no folders such as "AvailableCultures" file "Translations" in the branch

ScrubN commented 1 year ago

I assume what happened is you made the branch and your changes were automatically stashed. I don't use github desktop but I know Visual Studio 2022 has a stash explorer and I believe Visual Studio Code does too

Teknoist commented 1 year ago

https://github.com/lay295/TwitchDownloader/tree/master/TwitchDownloaderWPF no folders such as "Translations"

ScrubN commented 1 year ago

Also I just realized I should add a tooltip to the ffmpeg and file template parameters so there can be a localized explanation of what they do

ScrubN commented 1 year ago

https://github.com/lay295/TwitchDownloader/tree/master/TwitchDownloaderWPF no folders such as "Translations"

Ah, you need to make the pull request on MY fork, not the master one. Don't worry, you will still be credited.

I understand it's a bit hard the first time you do it but once you figure it out it makes sense. Otherwise if you can't figure it out I can make the pull request for you and it will still update automatically when you push to the turkish translation branch.

Teknoist commented 1 year ago

https://github.com/ScrubN/TwitchDownloader/pull/1

I'm sorry to bother you, I'm a little sick today, I realize some things little late :P

ScrubN commented 1 year ago

It's all good.

Like I said I will not merge your changes until the other GUI changes are merged so you may update your translation to include those

Congrats on figuring out the cross-fork pull request creator. It's a little unintuitive on your first go, I struggled with it too for a bit.

Teknoist commented 1 year ago

If you don't mind, I added a joke to the translation, instead of buy me coffe, I added buy me kebab.

ScrubN commented 1 year ago

That's fine by me, I see no harm in jokes as long as the original intent is still there

ScrubN commented 1 year ago

Just an update on the multi language support. It no longer requires a restart to apply the language and it also now works in debugging modes. Still waiting on the additional GUI changes and then I will expand the string list.

Teknoist commented 1 year ago

Can we use websites like Poeditor?

For some people, it is difficult to translate with github, so I think they are afraid to translate it so that it will be a more comfortable translation.

https://poeditor.com/projects/

ScrubN commented 1 year ago

Can we use websites like Poeditor?

For some people, it is difficult to translate with github, so I think they are afraid to translate it so that it will be a more comfortable translation.

https://poeditor.com/projects/

Not a bad idea but due to the extremely limited free plan we would absolutely need to apply for an open source license, which the prerequisites are not explained without making an account. 1,000 strings would only get us full translation in 3 languages - WPF is currently at 181 and if we support CLI & Core down the road that'll push us over 250 guaranteed.

Another option would be to use a different service like https://crowdin.com/ which would allow us to get probably 10 or more full languages out of the free plan, though its open source license terms would more than likely not accept this project if we needed to apply for it down the road.

My main question is why are all these translation services so expensive? Storing 1000 strings isn't even that expensive. It could honestly be more worthwhile to just make a github.io app that acts as a fancy wrapper for making commits. Then we would get unlimited strings + history + visual mockups all for free instead of $150USD/mo. Yes they charge $150/mo for visual mockups.

Another free alternative is to just have a translator project that runs locally and recompiles the real application when they want to preview their changes, but also at that point just use the ResX editor VS plugin or localization manager in rider.

All of the hoops I had you jump through was because I didn't know either of those editors existed and I wanted to include your translation in the initial support PR instead of separating it. Translating should and will be much easier for future translators, so I'm not super sure if it's worth signing up for one of these services or creating a github webapp to provide the experience for free.

Teknoist commented 1 year ago

https://tolgee.io/pricing/self-hosted self hosted version maybe help ?

ScrubN commented 1 year ago

https://tolgee.io/pricing/self-hosted self hosted version maybe help ?

That application honestly looks really nice to work with. Unfortunately I can't currently afford to rent a public facing VPS for this, but if I did it would be hundreds of times cheaper than any of the paid plans the other services offer, assuming nobody tries to DDOS it. Maybe in the future we can use tolgee.

Teknoist commented 1 year ago

I recall correctly ResX editor VS plugin support excel import function. We can use google spreadsheet with autotranslate.

Teknoist commented 1 year ago

A help-to-translation-style text under the language select menu menu would be very useful.

ScrubN commented 1 year ago

A help-to-translation-style text under the language select menu menu would be very useful.

Not sure why I didn't do this earlier given the theme selector has a tooltip already. I'll definitely be adding this.

I recall correctly ResX editor VS plugin support excel import function. We can use google spreadsheet with autotranslate.

Auto-translate isn't an issue. I could register for a DeepL API token and translate WPF to all 28 of DeepL's languages off the free plan alone using the VS ResX plugin's native DeepL API support. However after using DeepL to assist with my rusty French I do not trust blindly translating. Some strings, like the embed images tooltip, required 10 minutes of rephrasing until it was able to translate back into English while retaining the original meaning

ScrubN commented 1 year ago

Initial localization support is now live! Thank you so much for the initial Turkish translation @Teknoist! CLI and Core (status/error message) translations are on the roadmap (see #575) but for now I would like to rewrite the task queue to address some user feedback & add CLI task queue support.