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

Translations update from OSGeo Weblate #4063

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

osgeoweblate
Copy link
Contributor

Translations update from OSGeo Weblate for GRASS GIS/grasslibs.

It also includes following components:

Current translation status:

Weblate translation status

Edouard Choinière and others added 9 commits May 31, 2024 11:10
Currently translated at 20.9% (2845 of 13590 strings)

Translation: GRASS GIS/grassmods
Translate-URL: https://weblate.osgeo.org/projects/grass-gis/grassmods/fr/
Currently translated at 89.6% (3831 of 4273 strings)

Translation: GRASS GIS/grasswxpy
Translate-URL: https://weblate.osgeo.org/projects/grass-gis/grasswxpy/fr/
Currently translated at 20.9% (2850 of 13590 strings)

Translation: GRASS GIS/grassmods
Translate-URL: https://weblate.osgeo.org/projects/grass-gis/grassmods/fr/
Currently translated at 89.6% (3832 of 4273 strings)

Translation: GRASS GIS/grasswxpy
Translate-URL: https://weblate.osgeo.org/projects/grass-gis/grasswxpy/fr/
Currently translated at 21.0% (2857 of 13590 strings)

Translation: GRASS GIS/grassmods
Translate-URL: https://weblate.osgeo.org/projects/grass-gis/grassmods/fr/
@echoix
Copy link
Member

echoix commented Jul 18, 2024

Can I try to use "rebase" on the GitHub PR to update the branch, and see if it makes something different than the 4+ other tries that never fixed the problem (fixes until another PR is merged and Weblate isn't up to date with main)?

Considering that weblate locked up again a couple hours after it was unlocked this morning

@HuidaeCho
Copy link
Member

HuidaeCho commented Jul 18, 2024

Can I try to use "rebase" on the GitHub PR to update the branch, and see if it makes something different than the 4+ other tries that never fixed the problem (fixes until another PR is merged and Weblate isn't up to date with main)?

Considering that weblate locked up again a couple hours after it was unlocked this morning

I just tried "Update with rebase" and got this error:

Rebasing (1/5)
Auto-merging locale/po/grassmods_fr.po
CONFLICT (content): Merge conflict in locale/po/grassmods_fr.po
error: could not apply 6609ae8991... Translated using Weblate (French)
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 6609ae8991... Translated using Weblate (French)
 (1)

and the problem is I cannot run those suggested commands manually on Weblate :-(. Maybe, we should try options in the "Danger zone".

@echoix
Copy link
Member

echoix commented Jul 18, 2024

I can't help you with anything on the management side of weblate, as I never saw them, nor do I have or ever had a staging setup to learn about it

@echoix
Copy link
Member

echoix commented Jul 18, 2024

@HuidaeCho take a look at these docs from another project using Weblate. It's one of the first that I find different info and procedures yet. And they use squash merges. https://forgejo.org/docs/next/developer/localization-admin/

@neteler
Copy link
Member

neteler commented Jul 21, 2024

Can I try to use "rebase" on the GitHub PR to update the branch, and see if it makes something different than the 4+ other tries that never fixed the problem (fixes until another PR is merged and Weblate isn't up to date with main)?
Considering that weblate locked up again a couple hours after it was unlocked this morning

I just tried "Update with rebase" and got this error:

Rebasing (1/5)
Auto-merging locale/po/grassmods_fr.po
CONFLICT (content): Merge conflict in locale/po/grassmods_fr.po
error: could not apply 6609ae8991... Translated using Weblate (French)
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 6609ae8991... Translated using Weblate (French)
 (1)

and the problem is I cannot run those suggested commands manually on Weblate :-(. Maybe, we should try options in the "Danger zone".

Does @robe2 have an idea here?

@robe2
Copy link

robe2 commented Sep 12, 2024

Nice meeting you @HuidaeCho at FOSS4GNA.

@neteler @HuidaeCho I'm not sure what I did to fix last time.

Right now, for the Weblate translations, to unlock, the only option that worked is below which I ddi

image

So now weblate shows 0 commits missing, but it is showing 10 outgoing commits. Pushing doesn't seem to do anything perhaps because this pull request hasn't been merged yet.

So I would try merging this and see if the weblate now shows right.

For messy divergencies, you can add weblate repo as a remote, do any local rebasing, fixing

Something like

git clone https://github.com/OSGeo/grass.git
cd grass
git remote add  weblate https://weblate.osgeo.org/git/grass-gis/grasslibs
git fetch weblate
git checkout weblate/main
git checkout -b weblate-fix
git rebase weblate-fix #doing this now fails with difference in grass main and weblate
#to fix this one I would do  -- with the local/po/grassmods_fr.po, show a conflict in dates only
git diff locale/po/grassmods_fr.po #just shows issue with header
git checkout origin/main --  locale/po/grassmods_fr.po
git add locale/po/grassmods_fr.po
git rebase --continue
#once you get a clean
git push  --set-upstream robe2 weblate-fix #this would push to my local and I could do a pull request and merge this

Once you are sure you have captured all weblate changes you need, it's safe to go back to weblate grass admin panel and run this.

image

One case where I had to resort to this is when I did a force push into the postgis repository. Weblate does not like force pushes (and I admit now, that was a lousy thing to do just to destroy junk history), but I knew all changes were already captured in PostGIS, so it was safe for me to force weblate to match the postgis upstream repo.

@echoix
Copy link
Member

echoix commented Sep 12, 2024

The thing is, the commits from this PR were already merged in other weblate PRs. But since we use squash-merge, weblate doesn't update itself.

And each time weblate gets manually unlocked like what happened a couple hours ago, gets locked back up when we merge a new PR, like what just happened.

@HuidaeCho
Copy link
Member

@robe2 It was great to see you in person. I've tried all three options and none worked last time.

@echoix Does squash-merge cause this problem?

@echoix
Copy link
Member

echoix commented Sep 22, 2024

@echoix Does squash-merge cause this problem?

Yes, it's documented in their docs that they have a hard time with it.

@robe2
Copy link

robe2 commented Sep 22, 2024

The thing is, the commits from this PR were already merged in other weblate PRs. But since we use squash-merge, weblate doesn't update itself.

And each time weblate gets manually unlocked like what happened a couple hours ago, gets locked back up when we merge a new PR, like what just happened.

There is a weblate add-on that does squashing.
image

What if you just install that on your weblate project so that weblate does the squashing for at least it's own pull requests? Not sure if that would help with the non-weblate pull requests.

It also looks like you have no add-ons installed in weblate GRASS project. Might want to check them out to see which ones might be valuable for GRASS. https://weblate.osgeo.org/addons/grass-gis/grasslibs/

FWIW the ones we have enabled for postgis-workshop are:

  • Update PO files to match POT (msgmerge)
  • Contributors in comment
  • Component Discovery (this is really useful if you are constantly creating new doc files, so it will detect if there is a pattern
  • Customize gettext output - to force no line wrapping (as it caused issue with sphinx building for some reason)
  • Squash Git commits
  • Automatic translation - threshold set to 99

For PostGIS we have these ones.

  • Update PO files to match POT (msgmerge)
  • Contributors in comment
  • Automatic translation

We rarely do squashes in either project so might be why we don't run into this issue

@echoix
Copy link
Member

echoix commented Sep 22, 2024

@robe2 I have a question, how do you keep your strings to translate to be kept updated with the code as commits are made? Do you do it on the weblate side, or have CI for that?

@robe2
Copy link

robe2 commented Sep 22, 2024

@robe2 I have a question, how do you keep your strings to translate to be kept updated with the code as commits are made?
Do you do it on the weblate side, or have CI for that?

We do build of the .pot file on our commits and let weblate create and update the POS as needed.

The weblate add-on that does that is the one called Update PO files to match POT (msgmerge)

I don't think there is a way for weblate to create the POTs as well, but I could be mistaken. Probably better to have your CI do that or do it manually every so often like we do.

So here is an example:

I updated the POT file in this - https://git.osgeo.org/gitea/postgis/postgis/commit/f83f784268aac67e92fdbf0d55a007161d94ac34

and weblate did a commit after updating all our POs.

https://git.osgeo.org/gitea/postgis/postgis/commit/39f89ae61840b7587bb19cf0ae83f0870d2e89cd

@robe2
Copy link

robe2 commented Sep 22, 2024

Since all these files have been written to the repo already, how about we:

  1. Run Reset all on weblate, to bring it to the same state as the grass repo
  2. Then install the Squash commits add on on weblate to see if it helps a bit?

@echoix
Copy link
Member

echoix commented Sep 23, 2024

Please do, we are stuck with the same changes in a PR loop since June 2, #3741, and can't really have new contributions since then. I have no access to see any settings, so I rely on the two or three people that do

@echoix
Copy link
Member

echoix commented Sep 23, 2024

Does any newer release of Weblate since the 5.4.3 that we have has related improvements that would be helpful?

There seems to be a bug fix for the installation of the squash git commits plugin in 5.5.1: https://docs.weblate.org/en/latest/changes.html#weblate-5-5-1

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.

6 participants