Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

i18n: consider real path of APP to handle symlinks

When extracting model validation messages, Reflection::getFileName is used
to obtain the the model filename. The returned value is actual physical
path and may differ to what APP is. Adding the realpath(APP) to $paths
variable allows str_replace() to correctly generate the correct value for
$occurences.
  • Loading branch information...
commit 36275129d710ea385ad5cb611feda6b75e84e4d9 1 parent 3f7e2f5
@rchavik rchavik authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/Console/Command/Task/ExtractTask.php
View
4 lib/Cake/Console/Command/Task/ExtractTask.php
@@ -463,6 +463,8 @@ protected function _processValidationRules($field, $rules, $file, $domain) {
* @return void
*/
protected function _buildFiles() {
+ $paths = $this->_paths;
+ $paths[] = realpath(APP) . DS;
foreach ($this->_translations as $domain => $translations) {
foreach ($translations as $msgid => $details) {
$plural = $details['msgid_plural'];
@@ -473,7 +475,7 @@ protected function _buildFiles() {
$occurrences[] = $file . ':' . implode(';', $lines);
}
$occurrences = implode("\n#: ", $occurrences);
- $header = '#: ' . str_replace($this->_paths, '', $occurrences) . "\n";
+ $header = '#: ' . str_replace($paths, '', $occurrences) . "\n";
if ($plural === false) {
$sentence = "msgid \"{$msgid}\"\n";
Please sign in to comment.
Something went wrong with that request. Please try again.