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

[DEFAULT] section of ini files is duplicated in all sections #10831

Open
2 tasks done
earl-warren opened this issue Jan 21, 2024 · 2 comments
Open
2 tasks done

[DEFAULT] section of ini files is duplicated in all sections #10831

earl-warren opened this issue Jan 21, 2024 · 2 comments
Labels
bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit

Comments

@earl-warren
Copy link

Describe the issue

When weblate pushes translated ini files that have a [DEFAULT] section, the section content is duplicated on every other sections in the ini file. See https://codeberg.org/earl-warren/forgejo/pulls/2/files for an example output.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  • Import the ini file
     [DEFAULT]
     foo = bar
     [mysection]
     frob = nitz
  • Translate nitz & push

What happens:

  • The pushed ini file contains
    [DEFAULT]
    foo = bar
    [mysection]
    foo = bar
    frob = translated

Expected behavior

The pushed ini file contains

[DEFAULT]
foo = bar
[mysection]
frob = translated

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Other

Weblate versions

https://translate.codeberg.org Weblate 5.3.1

Weblate deploy checks

No response

Additional context

https://codeberg.org/earl-warren/forgejo/pulls/2/files is an example of a pull request created by weblate 5.3.1 that exhibits the problem.

@nijel
Copy link
Member

nijel commented Jan 22, 2024

That's how Python ConfigParser behaves - [DEFAULT] section provides fallback values for other sections, see https://docs.python.org/3/library/configparser.html#fallback-values. But maybe there is a way to filter out these in the translate-toolkit.

@nijel nijel added bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit labels Jan 22, 2024
Copy link

The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable).

DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Jan 28, 2024
To keep weblate happy as it would otherwise be duplicating the content
to all sections.

See WeblateOrg/weblate#10831 for more information.
6543 pushed a commit to 6543-forks/gitea that referenced this issue Feb 26, 2024
To keep weblate happy as it would otherwise be duplicating the content
to all sections.

See WeblateOrg/weblate#10831 for more information.

(cherry picked from commit 5ffc10a00e1ceb24755894e981d3d26d654b4b7e)
(cherry picked from commit 96d10e793b72e39656cc0df02272c7dd7632964c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. translate-toolkit Issues which need to be fixed in the translate-toolkit
Projects
None yet
Development

No branches or pull requests

2 participants