Skip to content
New issue

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

mergeWith option doesn't work due to failing file_exists() check #225

Closed
ocean90 opened this issue Jan 18, 2022 · 0 comments · Fixed by #226
Closed

mergeWith option doesn't work due to failing file_exists() check #225

ocean90 opened this issue Jan 18, 2022 · 0 comments · Fixed by #226
Labels
[Component] CLI CLI commands and tooling [Type] Bug Bugs and regressions in existing functionality
Milestone

Comments

@ocean90
Copy link
Member

ocean90 commented Jan 18, 2022

Issue Overview
Traduttore has a handy mergeWith option which allows to merge an existing POT file with the default generated by Traduttore. Unfortunately this option doesn't work

To Reproduce
Steps to reproduce the behavior:

  1. Create a project with a custom POT file and the mergeWith option
  2. Let Traduttore import the project
  3. After import notice that the strings from the custom POT file are not there

Expected behavior
Strings from the custom POT file are also imported.

Additional context

traduttore/inc/Updater.php

Lines 186 to 188 in 413cff4

if ( $merge && ! file_exists( $merge ) ) {
$merge = null;
}

The file_exists() is used for a relative path while the current directory may not be the directory of the plugin, usually the root directory of WordPress itself. The fix would be to prefix the merge value with $source.

@ocean90 ocean90 added [Type] Bug Bugs and regressions in existing functionality [Component] CLI CLI commands and tooling labels Jan 18, 2022
@ocean90 ocean90 added this to the 3.2.0 milestone May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] CLI CLI commands and tooling [Type] Bug Bugs and regressions in existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant