#139 closed defect (fixed)
Not all .pot files are importable
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | general | Version: | 0.1 |
| Keywords: | has-patch | Cc: | defries, nbachiyski |
Description
Every now and then I find .pot files that I can't import into GlotPress. For instance the Gravity Forms translation file which is a .pot when selected and uploaded shows the error message: Couldn’t load translations from file!
Other .pot files, like the one for the Genesis Theme Framework load just fine.
Attachments (2)
Change History (9)
- Keywords import removed
- Owner changed from somebody to petervanderdoes
- Status changed from new to accepted
- Keywords needs-patch added
The attached file is written in Windows and has the Windows new line character.
The import checks for Unix new line only.
When reading the POT file all the Windows new lines need to be replaced with Unix ones.
- Keywords has-patch dev-feedback added; needs-patch removed
comment:5
nbachiyski — 13 months ago
- Resolution set to fixed
- Status changed from accepted to closed
(In [686]) Allow importing PO files with Windows line endings
Before, we weren't stripping the \r in the end
of each line and it broke the PO format, causing
imports to fail.
Now, we are stripping \r\n and replacing it with
\n only to make sure we have the proper line ending.
Fixes #139, props petervanderdoes.
comment:6
nbachiyski — 13 months ago
- Keywords dev-feedback removed
petervanderdoes, you patch didn't quite work, because in the end of the file $line is empty, but you always added a newline. This got us into a infinite loop. I modified it to make sure the line ended with the Windows line ending before appending a UNIX newline.
comment:7
nbachiyski — 13 months ago
- Cc nbachiyski added

Gravity Forms 1.5 beta .pot file