po icon indicating copy to clipboard operation
po copied to clipboard

Wrap line at 80 char ; whereas Weblate wrap at 77 char

Open nk54 opened this issue 3 months ago • 2 comments

Hi, first let me thank you for this nice package.

I don't use to add 3rd party dependency but when I do, it's for an awesome one ;)

I have a feature request : private const int MaxLineLength = 80; should be possible to change with a property in POGeneratorSettings and use that value and only fallback to your 80 limit.

I use Weblate and it breaks lines above 77chars so the PoFile generated with this awesome package is fully updated once translated inside Weblate. And when i add new strings with your package, it updates again everything. The latest edit wins... ;D

I would like to contribute to your repo and implement that if you are ok with that.

Thank you !

nk54 avatar Sep 23 '25 12:09 nk54

Fix suggested :

POGenerator.cs: after public bool IgnoreLongLines { get; set; } Add public int MaxLineLength { get; set; } = 80;

And constructor:

public POGenerator(POGeneratorSettings settings)
{
    if (settings == null)
        throw new ArgumentNullException(nameof(settings));

    _maxLineLength = settings.MaxLineLength;
[...]

And change the const to be a private readonly field

nk54 avatar Sep 23 '25 13:09 nk54

Hi, @nk54

Thanks for the kind words and for the contribution. I'll take a look at your PR shortly.

adams85 avatar Oct 04 '25 11:10 adams85