InvoiceGenerator icon indicating copy to clipboard operation
InvoiceGenerator copied to clipboard

How to change DIČ and IČ to VAT and TIN?

Open mihalt opened this issue 5 years ago • 3 comments

Hi! How to change DIČ and IČ to VAT and TIN? The os.environ["INVOICE_LANG"] = "en" doesn't help.

mihalt avatar Sep 05 '19 15:09 mihalt

I ran into the same problem. A quick look at the source code reveals that the right way to achieve this is to create a pull request to locale directory and add gettext localization there, since the PROJECT_ROOT resolves to the library directory.

The code is ugly and I prefer to use ReportLab directly though.

LeeiFrankJaw avatar May 12 '20 10:05 LeeiFrankJaw

Papersize is locked in this line of code, which is much worse. We are locked into US letter size paper if we use this library. No simple or easy way to work around this.

LeeiFrankJaw avatar May 15 '20 12:05 LeeiFrankJaw

@mihalt There's something wrong with the translation files causing this. All the strings in the source code are in English, but this particular line, for some reason, is getting translated into Czech:

>>> os.environ["INVOICE_LANG"]
'en'
>>> _(u"Vat in: %s")
'DIČ: %s'

If I delete the translation files, the line is correctly not translated and is returned as "Vat in: %s". So if you don't need localization, you can just delete those babel files in the locale directory.

(Mostly posting this in case someone tries to use this library in 2023+ as I did and has the same question)

dephekt avatar Apr 17 '23 17:04 dephekt