question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lowercase header transformation destroys custom headers of translation software

See original GitHub issue

When parsing a pot file with this package, all header names are transformed to lowercase first, then upon saving, each letter after a dash in the name is transformed to uppercase. However, some translation software writes custom headers that are case-sensitive, like Poedit:

"X-Poedit-KeywordsList: "
"__;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,"
"2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__"
"ngettext_noop:1,2\n"
"X-Source-Language: en\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"

After handling my pot file with this package, I’m no longer able to update the translation strings from source in Poedit, because they are now written like this:

"X-Poedit-Keywordslist: "
"__;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,"
"2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__"
"ngettext_noop:1,2\n"
"X-Source-Language: en\n"
"X-Poedit-Searchpath-0: .\n"
"X-Poedit-Searchpathexcluded-0: *.min.js\n"

Could you add an option to keep the header names untouched (or it might be a good idea not transforming any custom headers starting with X- by default?)? Or is Poedit simply violating some standards regarding header naming convention in pot files?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vslavikcommented, Feb 26, 2020

Or is Poedit simply violating some standards regarding header naming convention in pot files?

Poedit developer here: GNU gettext headers are case sensitive. E.g. changing Language to language will cause all GNU gettext tools such as msgfmt to warn about missing Language header.

0reactions
smhgcommented, Feb 28, 2020

No problem! Thanks for the update!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent of converting header name into lower case
I am adding custom headers to my response and Spring boot doesn't convert headers to lowercase in my case. Have you checked response...
Read more >
Default Transform Definitions
The system offers default transform definitions for fields containing text, text numeric, and numeric values.
Read more >
RFC 3261: SIP: Session Initiation Protocol
Abstract This document describes Session Initiation Protocol (SIP), an application-layer control (signaling) protocol for creating, modifying, ...
Read more >
Wdm.h header - Windows drivers - Microsoft Learn
This header contains reference material that includes specific details about the routines, structures, and data types that you will need to ...
Read more >
GNU gettext utilities
h> standard header and some functions declared in the <string.h> and <stdlib.h> standard headers. If this is not desirable in your application (for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found