We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There seems to be a bug in Merge::mergeTranslations:
public static function mergeTranslations(Translations $from, Translations $to, $options = self::DEFAULTS) { if ($options & self::REMOVE) { $filtered = []; foreach ($to as $entry) { if ($from->find($entry)) { $filtered[$entry->getId()] = $entry; } } $to->exchangeArray($filtered); } foreach ($from as $entry) { if (($existing = $to->find($entry))) { $existing->mergeWith($entry); // <--- does not pass on $options } elseif ($options & self::ADD) { $to[] = $entry; } } }
$options is not passed on to the single translation mergeWith() operations:
$options
mergeWith()
$existing->mergeWith($entry);
Therefore, overwriting translations does not work properly:
// Does not actually overwrite translations $translations->mergeWith($otherTranslations, Merge::ADD | MERGE::HEADERS_ADD | MERGE::HEADERS_OVERRIDE | Merge::TRANSLATION_OVERRIDE);
An easy fix would be to pass on $options in Merge.php:162:
$existing->mergeWith($entry, $options);
The text was updated successfully, but these errors were encountered:
Ok, good catch. Do you mind to create a pull request to fix this? Thank you!
Sorry, something went wrong.
Here you go: Pull request #150
Please note that the PHPUnit tests seem to be broken (and have been before my pull request).
👍 thanks!
No branches or pull requests
There seems to be a bug in Merge::mergeTranslations:
$options
is not passed on to the single translationmergeWith()
operations:Therefore, overwriting translations does not work properly:
An easy fix would be to pass on
$options
in Merge.php:162:The text was updated successfully, but these errors were encountered: