Title: Path resolving
Last modified: August 21, 2016

---

# Path resolving

 *  Resolved [moreyummystuff](https://wordpress.org/support/users/moreyummystuff/)
 * (@moreyummystuff)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/path-resolving/)
 * Hi there,
 * It seems that the resolve_path function in loco-admin.php is somehow not managing
   to resolve the paths to .po files correctly when I click on a .po file to edit:
 * Error: Bad file path ‘E:\\WPTest\\www.2/wp-content/E:\\WPTest\\www.2\\wp-content\\
   themes\\bonestheme/library/translation/default.po’
 * When debugging that function I see that the first time it is called with a $path
   of “themes/bonestheme” it is ok, however the next call that asks for “E:\WPTest\
   wp-content\themes\bonestheme/library/translation/default.po” fails as it returns
   the $realpath as seen above in the error message.
 * Obviously this is run localhost on a Windows machine (PHP ver 5.3.24).
 * Thanks for your time.
 * [http://wordpress.org/plugins/loco-translate/](http://wordpress.org/plugins/loco-translate/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/path-resolving/#post-4066744)
 * Thanks for spotting this, but I don’t have a Windows development environment 
   so can’t support Windows. Feel free to submit a patch and I’ll happily give you
   credit.
 *  [seayko](https://wordpress.org/support/users/seayko/)
 * (@seayko)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/path-resolving/#post-4066846)
 * I had same error in Win-Env while saving PO-Files.
 *  Fixed it with:
 *  loco-translate/php/loco-posave.php
 *  replace (Line 14-16):
 *  if( ‘/’ !== $path{0}){
    $path = WP_CONTENT_DIR.’/’.$path; }
 *  with
 *  if( ‘/’ !== $path{0} && ‘:\\’ !== $path{1}.$path{2}){
    $path = WP_CONTENT_DIR.’/’.
   $path; }
 *  // if “*:\” is in path, there is no need to prepend WP_CONTENT_DIR in Windows.
   Cause $path contains full path. 😉
 *  Tested in Linux AND Windows. Works fine!
 * EDIT: ATTENTION! Path of “Gettext msgfmt” should be working in Windows, otherwise
   content of translation-file will be cleared.
    Magic-Quotes should be disabled,
   too.
 *  [seayko](https://wordpress.org/support/users/seayko/)
 * (@seayko)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/path-resolving/#post-4066847)
 * Since Version 1.4 it’s running without my reported modification.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Path resolving’ is closed to new replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [seayko](https://wordpress.org/support/users/seayko/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/path-resolving/#post-4066847)
 * Status: resolved