Opened 3 years ago

Closed 13 months ago

Last modified 13 months ago

#139 closed defect (fixed)

Not all .pot files are importable

Reported by: defries Owned by: petervanderdoes
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)

gravityforms.pot (240.2 KB) - added by defries 3 years ago.
Gravity Forms 1.5 beta .pot file
139.0.patch (347 bytes) - added by petervanderdoes 16 months ago.
Replaces Windows newline with Unix one

Download all attachments as: .zip

Change History (9)

defries3 years ago

Gravity Forms 1.5 beta .pot file

  • Milestone set to 1.0
  • 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.

Replaces Windows newline with Unix one

  • Keywords has-patch dev-feedback added; needs-patch removed
  • 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.

  • 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.

  • Cc nbachiyski added
Note: See TracTickets for help on using tickets.