Jump to content

Archived

This topic is now archived and is closed to further replies.

radm

Translate sections (iBox) using WPML

Recommended Posts

radm    2
radm

While there are no issues with translation of the page content and some of the sections (such as Hero and Highlight), I could not find any way of setting up multi-lingual content for iBoxes in my theme. I tried to use string translation in WPML, and despite finding the iBoxes content under "Translate texts in admin screens", no matter what I tried, the translation is not visible on the page.

 

I assume it might have something to do with the way iBox is implemented, but I am not sure what is the actual problem. Worst case scenario, I'd override iBox with a custom section, but first I need to know precisely why this happens. 

 

Other similar posts simply conclude that it doesn't work, but do not provide any satisfactory alternative, so if anybody has any idea, it would be greatly appreciated.

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there, there are issues with WPML that the core team are aware of. Have you tried using Polylang? http://wordpress.org/plugins/polylang/ The developer team confirm this is 100% compatible with DMS and has been fully tested.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
radm    2
radm

Thanks, James, I'll look into it.

 

…though, I hope at some point, WPML will also be fully compatible.

Share this post


Link to post
Share on other sites
radm    2
radm

Well, a few hours later, I'm still struggling with getting polylang to translate sections created with Pagelines.

 

I might be missing something obvious, or just didn't find the right documentation on how to do this, so if you have any suggestions, it'd help me a great deal. All I need to do is get translations for tile and content of various sections I add to the template via drag'n'drop.

Share this post


Link to post
Share on other sites
radm    2
radm
Right! So, after a couple hours more digging around, I concluded the following:
 
1. with Polylang, it's possible to translate everything, but it requires creating separate pages for each translation
 That would be fine, but manually [re]creating the same template for each translation after each change was not ideal in my situation, so I gave up on Polylang and reverted to WPML.
 
2. WPML - after serious persuasion, it works; here's what I did:
 
a) duplicate whatever section you need, in your child-theme; if you already have content, copy-paste to overwrite the default implementation, otherwise, it's good to at least change the class name (NB: edit comments at top of the file accordingly)
 
B) use either _e($string, $domain) or __($string, $domain) [NB: double underscore] to register your strings (not exactly sure what actually happens here…). $string is what needs translating (doh!) and $domain is what group tit should fall under, such as 'pagelines' or 'myCustomThemeName' 
 
c) refresh the actual page in your browser (not the admin)
 
d) use WPML -> String Translation -> Save options and rescan strings
 
now, you should see your $domain under the 'Select strings within context: '  drop-down. If you don't, do not panic yet, just curse a little, take a deep breath and go to WPML -> Theme and plugins localization and spam the 'scan the theme for strings', then go back and repeat last step
 
If it still fails, you might want to create a class with fields as the string you're interested in and use it to spawn dummy objects. Not sure if this helps, but I did it this way, because I don't know exactly when the registration occurs...
 
In conclusion, I hope this will help someone else, despite it being a rather dirty solution. I'm going to settle with this until - hopefully - native Pagelines sections will do this by default. Alternatively, a hook solution would also be nice, but at least for iBox, none of the hooks share scope with the variables, so Hooker was useless for this…
 
Cheers!
  • Like 2

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there, glad you got it working, thank you for posting the solution that will definitely help others in the future.


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
erikernst    0
erikernst

I am having a lot of issues with compability between WPML and DMS, some sections don¨t translate, images in Revslider doesnt work on translated pages etc. All in all, DMS and WPML seem close to being a complete useless match imo. 

 

Hi there, there are issues with WPML that the core team are aware of.

 

 

I really hope to hear some news about this soon.

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

erikernst - I have never used the plugin. However, a lot of our users do and do not have any issues with it. As this is a premium plugin its difficult to assist you.

 

If you can provide a link to our site and also make sure that all other plugins are disabled and DMS Debug mode is active, we can take a closer look.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • JP
      By JP+
      Hello,
      We are working on a 2 languages site (https://liguecardioliga.be) with wpml, and lately the call of a category in the loops section (and all the sections requiring a category to select posts) doesn't work in the translated language. It worked well until recently so I wonder if it's because of a recent update (wordpress, wpml, pagelines, a plugin?). Anyone has the same problem? a solution?
      TIA
    • mrhinsh
      By mrhinsh
      I am trying to get WPML working on my Pagelines instance. I am interested in getting help from anyone that has tried, especially @claudedagenais who seams to have it working.
      My issues are:
      How to translate header and footer How to get the menu to show all nav even if not translated How to get non-translated posts /pages to show up when only in default language - true for Masonry, Newsfront, and other list showing items... I have zero skills in PHP and its my site for my company. 
      note: Multi-lingual is a business decision and is required. I have vetted all of the multi-lingual options and the only one fit for purpose is WPML. 
    • JP
      By JP+
      Hello,
      How can you set the translations with platform5, the parts that are not in pages or posts? Texts and images…
    • balfred1345
      By balfred1345
      Hi,
      I've got a client on a DMS ver. 1.1.9.1 site. Using WP 4.5.2.
      The site is clean from malware. And I've replicated the below problem with all plugins off except for DMS Pro Tools
      Here's the page: http://choralartsensemble.org/support/sponsors/
      When a textbox or column with textbox on the page are deleted, upon save and refresh one or more textboxes in the header and footer loses its content. This is a repeatable occurrence. 
      Can you please tell me how to fix this so it does not happen again? 
    • John Olsson
      By John Olsson+
      I have a problem with the regular textbox in pl5, in this case, the text goes in that container, but it will hide som of the text, as if the container itself won't fit?
      Is this some kind of bug or have I done something stupid, never happend before with pl5 doh, can I do something smart about it?
      Version: Version 5.0.108
      Look here: www.gastronova.co56.se

×