alexankitty / FancyTasks

Make your plasma task manager widget pretty.
GNU General Public License v3.0
133 stars 7 forks source link

Add i18n support and zh_CN translate #31

Closed zetako closed 1 year ago

zetako commented 1 year ago

This MR add i18n related scripts from Zren/plasma-applet-lib, with some tweaks. I am totally new to KDE community, so I can't comfirm those changes are correct.

How to

Others

I also add a zh_CN translation as an example.

zetako commented 1 year ago

So I just explore some other repos and realize that the content/locale should be generate when packaging instead of just store in the repo. But it seems that this repo dont have a build/packaging script. No sure how to do it automatically now.

alexankitty commented 1 year ago

Sorry I've been away from this for a while. Maintaining the project was super stressful and I've just not had access to a linux install as my daily driver. Can you catch me up to speed on what exactly I need to do on my end before I merge this?

zetako commented 1 year ago

Welcome back and thanks for your awesome project.

Can you catch me up to speed on what exactly I need to do on my end before I merge this?

Basic

I found this script in other plasma plugin and the original author seems to be the KDE developer. Check this link.

It work like this:

  1. Developer of plugin wrap string needed i18n using i18n() (Already done in your code)
  2. Generate a template using merge script
  3. Translators implement their .po file as translate
  4. Use build to generate .mo file as i18n asset, the readme file showing translate progress will also updated
  5. Put .mo file in content/locale, the KDE framework will automatically use it

The Submit

I do some change on the script.

There's still a problem with the submit, that I added the generated .mo file. It's a binary file so it can cause security issue and also diffcult to manage during version changing. I think we should only accept and store the .po file and generate .mo files everytime a new release is packaged.

alexankitty commented 1 year ago

Yeah I think that's a good idea. I'll add it to my list to implement build-time translations so that double duty isn't required to manage translations. Though you'll have to forgive me on this one, since it's not something I've implemented before.

alexankitty commented 1 year ago

This looks to be for an older version of Plasmoids using a metadata.desktop file. They use JSON now for this. I'll need to research the implementation of this further.

alexankitty commented 1 year ago

Manually merged in, feel free to update zh_CN.po as needed.