diff --git a/po/lyx_pot.py b/po/lyx_pot.py
index 500185fdba..a58d8bfe06 100755
--- a/po/lyx_pot.py
+++ b/po/lyx_pot.py
@@ -44,7 +44,7 @@ def writeString(outfile, infile, basefile, lineno, string):
def ui_l10n(input_files, output, base):
'''Generate pot file from lib/ui/*'''
- output = io.open(output, 'w', encoding='utf_8')
+ output = io.open(output, 'w', encoding='utf_8', newline='\n')
Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"', re.IGNORECASE)
Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
IconPalette = re.compile(r'^[^#]*IconPalette\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
@@ -166,7 +166,10 @@ def layouts_l10n(input_files, output, base, layouttranslations):
if 'wa' in languages:
languages.remove('wa')
- out = io.open(output, 'w', encoding='utf_8')
+ if layouttranslations:
+ out = io.open(output, 'w', encoding='utf_8')
+ else:
+ out = io.open(output, 'w', encoding='utf_8', newline='\n')
for src in input_files:
readingDescription = False
readingI18nPreamble = False
@@ -433,7 +436,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
def qt4_l10n(input_files, output, base):
'''Generate pot file from src/frontends/qt4/ui/*.ui'''
- output = io.open(output, 'w', encoding='utf_8')
+ output = io.open(output, 'w', encoding='utf_8', newline='\n')
pat = re.compile(r'\s*(.*)')
prop = re.compile(r'\s*