• Hello, I just installed the plugin but I can’t open any of the language files for editing. When I go to Tools > Manage Translations, I get the list of all available translation files. But when I click on any of the files, the browser simply reloads the same page. The file permissions are all OK. I’m using WP 3.8.1, theme is Twenty Thirteen, plugin version is 1.4.1 installed manually. Would be grateful for any suggestions. Thanks.

    https://wordpress.org/plugins/loco-translate/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tim W

    (@timwhitlock)

    The page should only reload the listing again if the file path cannot be resolved, but then you will see a “Bad file path” error at the top of the screen just below the Loco navigation tabs. Do you see an error like this?

    What path are the Twenty Thirteen PO files under on your disk? Is anything symlinked?

    Thread Starter sualokin

    (@sualokin)

    Thanks for the fast reaction. I don’t get any error message, just a page reload. The PO files I’m trying to edit are under /wp-content/languages/themes/ but on a remote web server, not a local WP installation. Is that a problem?

    Here is something I found out in the meantime. When I’m on the listing page and I click on the file I want to edit, the page reloads but the URL in the browser address bar changes to this:

    …/wp-admin/tools.php?page=loco-translate&name=twentythirteen&type=theme&poedit=languages%2Fthemes%2Ftwentythirteen-de_DE.po

    Now when I replace the two occurrences of “& a m p ;” with “&” and hit reload, I finally get to the editing page. Does this get us anywhere?

    Thread Starter sualokin

    (@sualokin)

    oops, the editor changed the URL. It should read like this:

    http://mainzer7.de/blogm7/wp-admin/tools.php?page=loco-translate&name=twentythirteen&type=theme&poedit=languages%2Fthemes%2Ftwentythirteen-de_DE.po

    Thread Starter sualokin

    (@sualokin)

    OK the forum text editor changes the URL so my point isn’t clear. In the original URL I posted above there are two places where instead of an & there is the html code for that, i.e. the sequence & a m p ;

    Like this:

    …/wp-admin/tools.php?page=loco-translate&name=twentythirteen & a m p ; type=theme & a m p ; poedit=languages%2Fthemes%2Ftwentythirteen-de_DE.po

    Plugin Author Tim W

    (@timwhitlock)

    I don’t know why you’d get double-escape URLs. I can’t reproduce that error.

    The plugin calls http_build_query to generate those “&” symbols and the fact the first one is intact proves that it’s not the escaping of the whole URL string that’s the problem.

    What version of PHP are you running and on what platform?

    What do you get if you echo out something like this?:
    echo http_build_query( array('a'=>'b','c'=>'d') );

    Thread Starter sualokin

    (@sualokin)

    I’m running PHP 5.3.28 on an Apache/Linux platform. Your test code echoes a=b&c=d with the “&” symbol displayed correctly so the problem seems to lie elsewhere.

    For now I’m happy to use the workaround of manually editing the URL as I’m not going to use this plugin very often and I seem to be the only one having this issue. When I can spare some time I may look into the matter more deeply. Thanks anyway for your quick response and suggestions.

    Plugin Author Tim W

    (@timwhitlock)

    It’s certainly a strange one. Did you run the test code within the WordPress environment?

    I’m wondering if other plugins are interfering, although they shouldn’t as I’m applying no filters to those links.

    You could try adding the double_encode argument to the central call to htmlspecialchars in loco-boot.php line 93. This should stop double encoding, although doesn’t actually solve the root problem. If the problem still occurs then I might be out of ideas.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘can't open language files’ is closed to new replies.