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

INI file: strings prefix with 'rem' missing #10561

Closed
2 tasks done
TakWolf opened this issue Dec 7, 2023 · 5 comments · Fixed by translate/translate#5130
Closed
2 tasks done

INI file: strings prefix with 'rem' missing #10561

TakWolf opened this issue Dec 7, 2023 · 5 comments · Fixed by translate/translate#5130
Assignees
Labels
bug Something is broken.
Milestone

Comments

@TakWolf
Copy link

TakWolf commented Dec 7, 2023

Describe the issue

Project is https://hosted.weblate.org/projects/aseprite/aseprite/en/#search

The follow sentences cannot be searched, but they do exist.

https://github.com/aseprite/aseprite/blob/516a927a59d8b6dc65061da39bcbf3434965337a/data/strings/en.ini#L162-L165

https://github.com/aseprite/aseprite/blob/516a927a59d8b6dc65061da39bcbf3434965337a/data/strings/en.ini#L385-L388

[color_bar]
remap_palette = Remap Palette
remap_palette_tooltip = Matches old indexes with new indexes
remap_tiles = Remap Tiles
remap_tiles_tooltip = Matches old tiles with new tiles

[commands]
RemoveFrame = Remove Frame
RemoveFrameTag = Remove Tag
RemoveLayer = Remove Layer
RemoveSlice = Remove Slice

The statistics count are also incorrect, now is 1606 but actually it should be 1614. (Exactly 8 are missing)

They all use ‘rem’ as a prefix, and I'm not sure if it's related to this.

Raise from: aseprite/aseprite#4208

I already tried

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

Steps to reproduce the behavior

Go to https://hosted.weblate.org/projects/aseprite/aseprite/en/#search

image image

Expected behavior

No response

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

weblate.org service

Weblate versions

No response

Weblate deploy checks

No response

Additional context

No response

@TakWolf
Copy link
Author

TakWolf commented Dec 7, 2023

Supplet nearby:

image

image

image

image

@dacap
Copy link

dacap commented Dec 7, 2023

Probably related to this "allow_rem" parameter from iniparse API:

https://github.com/candlepin/python-iniparse/blob/dbfd7174ee1e9a8e25cdc1694703d59b4ab109a1/iniparse/ini.py#L188-L194

Probably these lines are being parsed as comments.

@TakWolf
Copy link
Author

TakWolf commented Dec 7, 2023

Indeed. ';' or '#' or 'rem' start line parse as a comment.

https://github.com/candlepin/python-iniparse/blob/dbfd7174ee1e9a8e25cdc1694703d59b4ab109a1/iniparse/ini.py#L198

image

But I can't find any documentation about using rem as a comment.(usually use # or ;)

@nijel nijel changed the title Some sentences cannot be searched, key prefix with 'rem' INI file: strings prefix with 'rem' missing Dec 8, 2023
nijel added a commit to nijel/translate that referenced this issue Dec 8, 2023
These are typically valid INI keys, this iniparse behavior seems weird.

Other iniparse consumers seem to do this as well (for example crudini).

Fixes WeblateOrg/weblate#10561
@nijel nijel added the bug Something is broken. label Dec 8, 2023
@nijel nijel self-assigned this Dec 8, 2023
@nijel nijel added this to the 5.3 milestone Dec 8, 2023
@nijel
Copy link
Member

nijel commented Dec 8, 2023

Apparently it is in the iniparse since the very beginning: candlepin/python-iniparse@fd4f69f

The fix might be to call change_comment_syntax(allow_rem=False), the annoying part of that API is that it changes the global state of the module. But I don't think anybody actually wants to use these as comments.

translate/translate#5130 should address this.

nijel added a commit to translate/translate that referenced this issue Dec 8, 2023
These are typically valid INI keys, this iniparse behavior seems weird.

Other iniparse consumers seem to do this as well (for example crudini).

Fixes WeblateOrg/weblate#10561
Copy link

github-actions bot commented Dec 8, 2023

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants