WordPress.org

Ready to get started?Download WordPress

Forums

GTS Translation Plugin
[Plugin: GTS translation] broken links in translations (22 posts)

  1. mike40033
    Member
    Posted 3 years ago #

    First of all, thanks for a great plugin - if I can get it all working, it will be **GREAT**.

    I'm using WordPress as a CMS, so I have no posts, only pages, if that makes any difference.

    I just installed the plugin and started it rolling yesterday.

    I notice that many of the internal links lead to either the English Language versions of the pages, or to 'sorry, you have requested something that does not exist'

    It's practically impossible for, say, a French speaker who speaks no English to use the site.

    Is this something I should expect to resolve itself over time, or if not, how can I fix it? The links were created using WordPress 3.1's new linking feature.

    Also, image captions don't seem to be translated, and the plugin changes tags like '[map:http://maps.google.com/]' to '[carte:http://maps.google.com]' which will break the maps embedded by the map plugin I use.

  2. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Hi there. Thanks for taking the plugin for a spin. I'm the developer that maintains the plugin. Let's see what we can do for you...

    First off, it should be no problem that you have pages and not posts. As you publish pages, they'll be translated. Can you send me a link to your blog so that I can poke around and see about the pages that don't have translated content yet?

    As for the links, that can be tricky business. If the link is generated by WordPress, then it should go to a translated page. However, when the links are in the post or page body itself, it's difficult to infer whether it should link to a translated post or to the original and we just leave it be. Unfortunately, the new feature in WP 3.1 inserts the link as HTML...it doesn't use a nifty internal function call that we can hook into.

    Shortcodes in the post are another troublesome area. We remove short codes before sending the post off for translation, but many plugins don't register their shortcodes for admin screens...and if they're not registered at the time you publish your post, we can't tell the difference between a shortcode and bracketed text. The only fix there is to modify the problem plugin.

    So, if you can send me a link to your blog, I'll see if I can turn up anything else.

    Thanks!

  3. mike40033
    Member
    Posted 3 years ago #

    Thanks for the quick response!

    The URL is http://www.big-animals.com/

    PS - is there a step-by-step guide to virtual hosts? Do I make (say) fr.big-animals.com serve pages from the same folder as www,big-animals.com, or do I somehow need a whole new wordpress install?

  4. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Hi again.

    I notice something interesting, which is that all of the permalinks are localized. If you hover over the links in the left sidebar after changing the blog language to Spanish for example, you can see that the URLs are translated.

    So I guess that means we have two questions... The first is why the text for the links is in English. How are you generating the links in the sidebar? The second is, why aren't the localized URLs working? A very common reason is that there's a plugin that's conflicting with ours...can you tell me which other plugins you have installed?

    As for the virtual hosts, a number of people have asked the same thing lately, so I'll be putting together a guide very soon. I'll let you know when I've got it put together.

    Thanks!

  5. mike40033
    Member
    Posted 3 years ago #

    Look forward to seeing the guide!

    Ok, here's my list of plugins...

    Akismet
    Google Maps (responsible for translating [map:http://bla] into a map - the word 'map' gets translated
    GTS Translation (hopefully this one is compatible with itself!)
    Hello Dolly (not activated)
    Joomla/Mambo to WP Migrator (not activated - I used this to move my site from Joomla to WordPress, then deactivated it)
    Meta SEO Pack - I tried disabling this, but it had no immediate effect
    Recently Popular - this produces the 'popular' list at the bottom of the sidebar - I also tried disabling this, but it didn't immediately help.
    WP Google Analytics
    XML Sitemap Feed
    Youtuber

    Bizarrely, in the list of 'most popular', some URLs are translated and others aren't - eg, http://www.big-animals.com/language/fr/the-worlds-biggest-mammals/ vs http://www.big-animals.com/language/fr/megalodon-le-grand-requin-la-jamais-etait/ in French. Some URLs of the form http://www.big-animals.com/language/fr/english-slug/ redirect to the French version (www.big-animals.com/language/fr/limace-anglais/ ?) with the translation, others redirect to a 404. It's bizarre.

    Thanks for trying to help me nut it out!

  6. mike40033
    Member
    Posted 3 years ago #

    Ok, I see I left one of your questions unanswered.

    There are two sets of links in the sidebar.

    The top set is generated using the 'Menu' feature in WordPress. Initially I had some trouble with this because of an incompatibility with a plugin. (Joomla/Mambo Converter, I think)

    The bottom set is generated by the 'Recently Popular' plugin and its widget.

  7. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Hi again.

    I've been digging into why the page titles aren't translating, and I was able to find why the English text is showing up for your menu pages. The menu functionality does some slightly non-standard stuff, but I found a workaround. We'll be releasing a new plugin (version 1.1.7) soon, so keep an eye out for that.

    As for the Recently Popular plugin, it's not going to be possible to translate the list that it's spitting out. Unfortunately, instead of using WP code to get at the posts, they're doing a direct select against the database, and they're not calling out to any hooks or filters afterwards. They should be at the very least invoking the filter for 'the_posts' if they want their plugin to play well with others.

    Finally, I'm still unsure why you're getting 404s... It's difficult to debug from here. My guess is that something about the way we're modifying the select statement for pages isn't working in your environment. Would you mind trying deactivating all of your plugins (including GTS) and then re-enabling only GTS? If it works, then we can start looking for conflicts. If it doesn't, then it's something internal. Also, can you check for any PHP errors in your server logs? We'll see what that turns up...

    Thanks!

  8. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Actually, I just thought of something... Do you have a permalink structure set as just the post name? If that's the case and you don't have any posts in your database, then you'll get a 404. That happens because ambiguity is introduced into the rewrite rules. If you see that your permalink is just the post name, change it to anything else, and the pages will start working.

  9. mike40033
    Member
    Posted 3 years ago #

    Yay! Your tip about permalink structure did the trick!

    I indeed have no posts, since I've done everything as pages, and my permalink structure was set to /%postname%/

    'Recently Popular' is still doing bizarre things, and big-animals.com/language/fr/english-slug still gives 404 errors, but big-animals.com/language/fr/limace-anglais is fine. Never mind, there are plenty of 'popular' plugins out there.

    Now the only issue left is the absolute URLs in the page body. Perhaps the best solution for me, if your software can't do it automatically, is to use the 'virtual hosts' feature and change all the links from "http://www.big-animals.com/english-url/" to "/english-url/"

    How does it work for other people? Or do most of your users just write blogs with no internal links?

  10. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Great! I'm glad that worked.

    The absolute URLs is a tricky one to solve. Most of our users thus far are using WP as a blog rather than a CMS, so they haven't found it to be too much of an issue...more of a nice to have if anything.

    One idea I had was to provide a shortcode tag for links, so you could add a snippet like [gts-permalink 'permalink-name'] and it would rewrite itself to whichever language is currently selected. Something to mull over with future versions of the plugin...

  11. mike40033
    Member
    Posted 3 years ago #

    yes, or have the plugin look for links on the main domain, and rewrite those that refer to translated pages...

    BTW - what happens if I modify a page that's been translated?

  12. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    I've thought about rewriting links on the main domain, but the problem there is that it's possible that a user may want the link to point back to the original text or a specific translation. That's why I was thinking about the shortcode...so the intention is clear. I really wish that WP had a good mechanism for inter-blog linking that we could extend from...the use of plain old URLs seems short sighted to me!

    And...if you modify a page, we'll run it through the translator again.

    Cheers...

  13. mike40033
    Member
    Posted 3 years ago #

    I suspect that most non-English speakers visiting a translated website would want links to stay on pages in their own language.... therefore most webmasters would want this too. But it could be an option in the admin pane..

    You may consider this a humble feature request from a very excited new user :-)

  14. mike40033
    Member
    Posted 3 years ago #

    After all, you'd still have to decide what to do in the absence of a shortcode....

  15. stevevls
    Member
    Plugin Author

    Posted 3 years ago #

    Cool man...I'll put it on the request list. An initial looks tells me that it could take some effort, so I won't be able to get to it right away.

    Just wanted to let you know that I just packaged up a new version (1.1.7) for release that should fix your problem with menus displaying in English.

    Thanks!

  16. mike40033
    Member
    Posted 3 years ago #

    Thanks!

  17. Mick Radford
    Member
    Posted 2 years ago #

    Hey there,

    First let me echo Mike's sentiment - GREAT plugin. I just took it for a spin today and it's working great so far.

    I am having one issue with custom menus and was wondering if you could share that workaround you mentioned. Basically when I use my custom menu and switch to Spanish (the only translated language I'm currently employing) the menu completely disappears.

    Unfortunately I HAVE to use a custom menu because I'm linking to external sites so any help would be appreciated

    Thanks!

    Mick

  18. stevevls
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the positive feedback! Can you send me a link to your blog so I can have a look at the menu? Also, which version of WP are you running? Thanks again...

  19. Mick Radford
    Member
    Posted 2 years ago #

    Hey Steve,

    Thanks for the quick reply. The url is http://dev1.radfordmedia.com/ (it's just a development site) and I'm running WordPress 3.2.1.

    Thanks!

  20. stevevls
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Mick.

    Thanks for the link. Unfortunately, my attempts to duplicate your problem on WP 3.2.1 have been unsuccessful, so I think I'm going to need some more help from you. Can you send me the code in your template where you're calling the function to render the menu? Also, can you check to see if there are any PHP errors in your Apache log?

    Thanks!

    Steve

  21. Mick Radford
    Member
    Posted 2 years ago #

    Hey Steve,

    First I want to thank you for your quick replies - It shows a lot of integrity on the part of a developer. Second I wanted to apologize for not getting back to you sooner - as it turns out I was able to use a standard menu (in lieu of a custom menu) on the live site so for my purposes the problem was "solved" (my priorities shift with the completion of the job!)

    Not exactly what you asked for but the theme I was using was TwentyTen (I'm not sure where the custom menu function would be off hand) and I had no PHP errors.

    This is an excellent plugin and I can foresee implementing it on future sites so at some point I will need to revisit this when I have the specific tech details - I'll keep you posted.

    Again, thank you.

  22. stevevls
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Mick.

    Thanks for the excellent feedback! I'm glad you were able to get things working with the standard menu.

    Steve

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic