mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
GettextTranslationHelper: Ensure that file source locations are relative
fixes #2684
This commit is contained in:
parent
2f8d4739b8
commit
91a315764c
@ -280,6 +280,7 @@ class GettextTranslationHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->updateHeader($this->tablePath);
|
$this->updateHeader($this->tablePath);
|
||||||
|
$this->fixSourceLocations($this->tablePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -400,12 +401,28 @@ class GettextTranslationHelper
|
|||||||
'"Content-Type: text/plain; charset=' . $headerInfo['charset'] . '\n"',
|
'"Content-Type: text/plain; charset=' . $headerInfo['charset'] . '\n"',
|
||||||
'"Content-Transfer-Encoding: 8bit\n"',
|
'"Content-Transfer-Encoding: 8bit\n"',
|
||||||
'"Plural-Forms: nplurals=2; plural=(n != 1);\n"',
|
'"Plural-Forms: nplurals=2; plural=(n != 1);\n"',
|
||||||
|
'"X-Poedit-Basepath: .\n"',
|
||||||
|
'"X-Poedit-SearchPath-0: .\n"',
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
) . PHP_EOL . substr($content, strpos($content, '#: '))
|
) . PHP_EOL . substr($content, strpos($content, '#: '))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adjust all absolute source file paths so that they're all relative to the catalog's location
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
*/
|
||||||
|
protected function fixSourceLocations($path)
|
||||||
|
{
|
||||||
|
shell_exec(sprintf(
|
||||||
|
"sed -i 's;%s;../../../..;g' %s",
|
||||||
|
dirname($this->appDir),
|
||||||
|
$path
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the file catalog
|
* Create the file catalog
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user