Skip to content

Apple strings files: Weblate is constantly fighting with BartyCrouch over the existence of non-comments #18241

@tladesignz

Description

@tladesignz

Describe the problem

I'm using https://github.com/FlineDev/BartyCrouch in my iOS and macOS projects to discover new strings in the source code (typically calls like NSLocalizedString("Hello World!", comment: "blabla").

It automatically extracts them, adds them to the strings files, also adds the comment above the string, if any, and sorts and formats the strings files. This is run on build.

Unfortunately, its development is not continued anymore, since Apple recently came around with a completely new way of handling translations in projects - the "String Catalogs" (xcstrings).

With that change also came Xcdoe IDE integrated tooling to take care of this discovery process.

We weren't able to switch to that, yet, however, and Weblate isn't supporting that, anyway AFAIU.

My problem now is: Both BartyCrouch and Weblate have unique ideas about how strings files should be formatted:

  • BartyCrouch always adds comments to it, even a useless one like /* No comment provided by engineer. */.

  • And it always adds a new line between each string and its comment.

  • Weblate on the other hand removes these non-comments

  • and also removes newlines.

This ends up in Weblate Pull Requests deleting things BartyCrouch will add again later.

My current solution to that is editing Weblate Pull Requests. Which of course destroys Weblate's capability of merging back in the latest changes. Which makes me reset Weblate's state.

Here's an example of such a PR:
OnionBrowser/OnionBrowser#556
(Look at each commit.)

Solution brainstorm

Since I like very much what BartyCrouch does, my preferred solution to this problem would be, that I can configure Weblate, that it keeps these non-comments, and also keeps the line breaks.

Describe alternatives you have considered

No response

Screenshots

No response

Additional context

I created this issue after a conversation I had with @orangesunny.

Metadata

Metadata

Assignees

Labels

Blocked by upstreamThe solution to this issue depends on a third-party project and needs to be addressed there first.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions