mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fix newline issue on i18n import
This commit is contained in:
parent
1323851bd5
commit
2d2741477b
|
@ -1046,7 +1046,10 @@ function createI18nFile(originalFilePath, messages) {
|
|||
var key = _a[_i];
|
||||
result[key] = messages[key];
|
||||
}
|
||||
var content = JSON.stringify(result, null, '\t').replace(/\r\n/g, '\n');
|
||||
var content = JSON.stringify(result, null, '\t');
|
||||
if (process.platform === 'win32') {
|
||||
content = content.replace(/\n/g, '/r/n');
|
||||
}
|
||||
return new File({
|
||||
path: path.join(originalFilePath + '.i18n.json'),
|
||||
contents: Buffer.from(content, 'utf8')
|
||||
|
|
|
@ -1171,7 +1171,10 @@ function createI18nFile(originalFilePath: string, messages: any): File {
|
|||
result[key] = messages[key];
|
||||
}
|
||||
|
||||
let content = JSON.stringify(result, null, '\t').replace(/\r\n/g, '\n');
|
||||
let content = JSON.stringify(result, null, '\t');
|
||||
if (process.platform === 'win32') {
|
||||
content = content.replace(/\n/g, '/r/n');
|
||||
}
|
||||
return new File({
|
||||
path: path.join(originalFilePath + '.i18n.json'),
|
||||
contents: Buffer.from(content, 'utf8')
|
||||
|
|
Loading…
Reference in a new issue