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

List of occurrences wrapped differently than xgettext #137

Open
gamboz opened this issue Apr 28, 2023 · 0 comments
Open

List of occurrences wrapped differently than xgettext #137

gamboz opened this issue Apr 28, 2023 · 0 comments

Comments

@gamboz
Copy link

gamboz commented Apr 28, 2023

I think that xgettext --no-wrap does not apply to the list of occurrences, so polib and xgettext will format the #: lines differently.

If you have a structure like the following:

.
├── f
│   └── c.py
├── folder_medium_length
│   └── b.py
├── folder_name_with_a_very_long_name_and_in_any_case_longer_than_seventy_eight_characters
│   └── a.py

where all the files contain the same string to translate, polib with wrapwidth=0 gives something like

#: /tmp/x/folder_name_with_a_very_long_name_and_in_any_case_longer_than_seventy_eight_characters/a.py:4 /tmp/x/folder_medium_length/b.py:4 /tmp/x/f/c.py:4

while xgettext --no-wrap something like the following (that was somewhat unexpected for me :)

#: /tmp/x/folder_name_with_a_very_long_name_and_in_any_case_longer_than_seventy_eight_characters/a.py:4
#: /tmp/x/folder_medium_length/b.py:4
#: /tmp/x/f/c.py:4

I think this can be changed by editing polib.py l.1037 from

            if wrapwidth > 0 and len(filestr) + 3 > wrapwidth:

to

            if wrapwidth > 1 and len(filestr) + 3 > wrapwidth:

I'm not yet opening a PR, because these are my first steps in the "translations" world and I might be making stupid mistakes (so please be patient 🙂 )

gamboz added a commit to sissamedialab/wjs-profile-project that referenced this issue Apr 28, 2023
- linting to ci/cd (and to all code)
- drop contexts USER FACING and SUBMISSION FLOW and unfuzzy translations
- [OT] polib/gettext differences izimobil/polib#137
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

No branches or pull requests

1 participant