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

[CHORE] Unwrap Babel translations files #4767

Merged
merged 6 commits into from
Nov 23, 2023
Merged

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Nov 16, 2023

Description

A while ago we opened #4501 to add an add-on to Weblate so it wouldn't wrap files, we also changed the documentation to specify a --no-wrap option when extracting the labels. However, we are still running into problems where it seems like the files are actually wrapped.

Looking into the git blame for the files, it seems like some lines haven't been changed in months, so maybe we actually need to change them manually by unwrapping all of them, and then send them to Weblate and see what happens?

@Felienne
Copy link
Member

Hi @jpelay!

I am looking into the addons in Weblate, and it seems we only have no-wrapping for yamls!

image

As far as I can see, there is no addon for po files outputting?

@Mark-Giesen
Copy link
Collaborator

@Felienne, you're looking at Adventures, which is a YAML component. Text is the PO component and this one does have a PO add-on set to no-wrapping. I'm not sure if unwrapping is triggered and if so when. We could try changing anything in a file and see if the complete file is unwrapped. If not, we could change all wrapped files by deleting one /n and see if Weblate does the rest.

image

@Felienne
Copy link
Member

@Felienne, you're looking at Adventures, which is a YAML component. Text is the PO component and this one does have a PO add-on set to no-wrapping. I'm not sure if unwrapping is triggered and if so when. We could try changing anything in a file and see if the complete file is unwrapped. If not, we could change all wrapped files by deleting one /n and see if Weblate does the rest.

image

Ah thanks @Mark-Giesen!! So it is really weird that the lines are now not wrapped in main.

Could it be that pre-commit does that? I am not sure whether that only works on py files?

@Mark-Giesen
Copy link
Collaborator

The PO add-on is set to no-wrapping, but I seem to remember I set it to "wrap on new-lines". This is the --no-wrap behaviour. Maybe someone changed it, or I remember incorrectly.

@Mark-Giesen
Copy link
Collaborator

Ah thanks @Mark-Giesen!! So it is really weird that the lines are now not wrapped in main.

They ARE wrapped, as I understand @jpelay. Lines that are old (not changed recently) are still wrapped. I assume these were wrapped in the passed and will only be unwrapped on a change.

@Felienne
Copy link
Member

Ah thanks @Mark-Giesen!! So it is really weird that the lines are now not wrapped in main.

They ARE wrapped, as I understand @jpelay. Lines that are old (not changed recently) are still wrapped. I assume these were wrapped in the passed and will only be unwrapped on a change.

Ah yeah sorry I meant weird that they are wrapped. So probably this PR will fix the issues (but we might want to wait until @Annelein's change is merged?)

@Felienne
Copy link
Member

Hi @jpelay!

I have merged all weblate PR's so we can do this again now (assuming you did it with a script and not manually haha)

@jpelay
Copy link
Member Author

jpelay commented Nov 23, 2023

Hi @jpelay!

I have merged all weblate PR's so we can do this again now (assuming you did it with a script and not manually haha)

Done!

Copy link
Member

@Felienne Felienne left a comment

Choose a reason for hiding this comment

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

Hail mary that this will work and not break things 🤞!

Copy link
Contributor

mergify bot commented Nov 23, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 4b0f7f7 into hedyorg:main Nov 23, 2023
9 checks passed
mergify bot pushed a commit that referenced this pull request Dec 19, 2023
In #4767 we have unwrapped all po files hoping to never ever again have annoying issues. It went well for a while, but.... for reasons I can't understand, #4878 again wrapped the po files :( 

<img width="1470" alt="image" src="https://github.com/hedyorg/hedy/assets/1003685/e7375971-a41f-4746-ba94-b230a6d524ae">

This unwraps everything

Additionally, @rix0rrr created #4930 which adds a test to test for accidental unwrapping. That will not solve the issue but will 1) prevent issues and 2) might help us to understand when it goes wrong and with that why.
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.

3 participants