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

Added scripts to create translators_*.info #141

Closed
wants to merge 5 commits into from

Conversation

ito32bit
Copy link
Contributor

@ito32bit ito32bit commented Apr 26, 2020

Fixes #113

The Bash script creates translators_*.info from *_*.ts.
Changes of translators_*.info will be committed to new branch "translators-action" and a pull request created.
This will done automatically 1 times a day by Github actions.

Steps:

Please see https://github.com/ito32bit/lxqt-about/blob/patch3-translators/.github/workflows/create_translators_pr.yml

  1. git clone lxqt/lxqt.git
  2. git submodule
  3. copy /translators/.mailmap to all repositories
  4. git log *_*.ts
  5. make *.info
  6. copy *.info to directory /traslatorsinfo
  7. make a PR

Excluding the commits of the following :

  • Email address included in "developers.list" (excluding specified language)
  • Updating two or more languages
  • Updating files other than *_*.ts, *.desktop and *.desktop.in

Sample:

The Bash script creates `translators_*.info` from `*_*.ts`.
Changes of `translators_*.info` will be committed to new branch "translators-action" and a pull request created.
This will done automatically 1 times a day by Github actions
@ito32bit ito32bit marked this pull request as draft May 17, 2020 00:01
@ito32bit ito32bit marked this pull request as ready for review July 7, 2020 05:20
@tsujan
Copy link
Member

tsujan commented Jul 7, 2020

@yan12125 or @luis-pereira, would you please review it? I'm not good at this -- as you may already know ;)

@yan12125 yan12125 self-requested a review July 8, 2020 01:40
@yan12125 yan12125 self-assigned this Jul 18, 2020
Copy link
Member

@yan12125 yan12125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with shell scripts, so I didn't review the scripts but just guess the intention from the scripts. The overall idea looks great. Thanks for this PR!

However, I'm a little worried about using shell scripts. Is there an LXQt developer good at shell scripts? If not, those scripts may get stale sooner or later, and we might go back to maintaining translators' info manually then.

outdir=$base/../list

cd $base
ts=`find . -name *_*$1.ts`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will also add code for desktop files.

@shlyakpavel
Copy link
Member

However, I'm a little worried about using shell scripts. Is there an LXQt developer good at shell scripts?

I'm always here. Just don't forget to assign or tag me.

@yan12125
Copy link
Member

I'm always here. Just don't forget to assign or tag me.

Great! Do you mind to check if those shell scripts look good, too?

@shlyakpavel
Copy link
Member

Yeah, I like them

@tsujan
Copy link
Member

tsujan commented Nov 3, 2020

This is checked and implicitly approved. It's not merged only because an explicit approval is missing.

Since I don't have enough knowledge in this area, I can't merge it for 0.16.0. Please consider it for the next release!

@stefonarch
Copy link
Member

It looks quite nice as logic, parsing git log for "*_.desktop.yaml" would include the former .desktop files.
Just for your information: weblate can produce json or txt files #97 (comment)

cd $dir
echo "gitlog: $fn"
echo -e "\nF:$fn" >> $outp
git log --use-mailmap --no-merges --pretty=format:"%H" $fn | xargs -n1 git log -1 --numstat --shortstat --pretty=format:"H:%H%ns:%s%nA:%aN %aE%na:%an %ae%nD:%ai" >> $outp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recently, git-log can't get the translator's name and email.

qps $ git log -1 --numstat --shortstat --pretty=format:"H:%H%ns:%s%nA:%aN %aE%na:%an %ae%nD:%ai" 89a914dde31aa4249e10d136d4943fc0ba9b9b45
H:89a914dde31aa4249e10d136d4943fc0ba9b9b45
s:Weblate commits (#255)
A:LXQtBot [email protected]
a:LXQtBot [email protected]
D:2020-10-30 15:24:34 +0800
3       3       src/translations/qps_ja.ts
 1 file changed, 3 insertions(+), 3 deletions(-)
qps $ 

I'll think of another way.
I see #97 (comment).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because they are "co-authored by" in default?

I see no automatic way to generate reports in json in weblate atm
https://docs.weblate.org/en/weblate-4.2.1/devel/reporting.html#translation-progress-reporting

And as I edited those "enter" shortkey translations I'm cited for many languages. Last 30 days:

[{"Portuguese": [["[email protected]", "S\u00e9rgio Marques", 2], ["[email protected]", "Hugo Carvalho", 1615]]}, {"Chinese (Simplified)": [["[email protected]", "Kaijie Chen", 349]]}, {"Danish": [["[email protected]", "Standreas", 1], ["[email protected]", "scootergrisen", 111]]}, {"Finnish": [["[email protected]", "Teemu Sirvi\u00f6", 181]]}, {"Italian": [["[email protected]", "Saverio Brancaccio", 5], ["[email protected]", "Standreas", 145]]}, {"Japanese": [["[email protected]", "Masamichi Ito", 222]]}, {"German": [["[email protected]", "Standreas", 5], ["[email protected]", "Ettore Atalan", 44]]}, {"Russian": [["[email protected]", "Golubev Alexander", 1], ["[email protected]", "Dmitry Astankov", 49]]}, {"Lithuanian": [["[email protected]", "Moo", 36]]}, {"Swedish": [["[email protected]", "Standreas", 1]]}, {"Spanish": [["[email protected]", "Standreas", 1], ["[email protected]", "jogama", 4]]}, {"Portuguese (Brazil)": [["[email protected]", "Standreas", 1], ["[email protected]", "EltonFF", 44]]}, {"Turkish": [["[email protected]", "Dr. Ayhan YAL\u00c7INSOY", 11], ["[email protected]", "Mehmet Akif", 108]]}, {"Hungarian": [["[email protected]", "Standreas", 1], ["[email protected]", "zoli111", 213]]}, {"Czech": [["[email protected]", "Standreas", 1], ["[email protected]", "p-bo", 145]]}, {"Greek": [["[email protected]", "Dimitrios Glentadakis", 3]]}, {"Bulgarian": [["[email protected]", "Standreas", 2], ["[email protected]", "Viliyan Yordanov", 21], ["[email protected]", "Mincho Kondarev", 89], ["[email protected]", "Mincho Kondarev", 3204]]}, {"Basque": [["[email protected]", "Bittor Poza", 84]]}, {"Hebrew": [["[email protected]", "Yaron Shahrabani", 97]]}, {"Dutch": [["[email protected]", "Standreas", 1]]}, {"Chinese (Traditional)": [["[email protected]", "Kaijie Chen", 1], ["[email protected]", "Chih-Hsuan Yen", 3]]}]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about "co-authored by".
However, I think that "Squash and merge" is related.

I don't seem to have permission:
Weblate-permission_screen-2020-12-23_13-05-38

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a permission for you, not sure if it works.
If not you could have admin rights.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: thinking about this new rule is about "downloading translation reports", probably it will not work for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have permission yet. But I don't need permission now.

If a command can get "Translation reports" without admin rights, I use it in the shell script.
Command: curl or wlc or wget...

@ito32bit
Copy link
Contributor Author

For 1 year I've been testing the scripts in my repository. I found it difficult to make a complete list of all the translators with the scripts.
Therefore, we will continue to maintain translator's information manually.
I close this PR.

@yan12125 yan12125 removed their assignment Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There isn't all translators in translator dialog
5 participants