Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 24 replies, has 4 voices.

Last updated by Amir 10 years, 10 months ago.

Author Posts
March 8, 2011 at 8:49 am #22097

Thomas

i made a strange discovery.
i took offline all posts - keeping all plugins as they are.
(just the slider of the theme went away as well)
and suddenly the languages appear as they should.
so there seems to be some strange interaction between:
WPML, theme arras and login-with-ajax

March 8, 2011 at 3:34 pm #22098

marcus

since lwa is localized, shouldn't wpml automatically sort this out? or should I call load_plugin_textdomain after a certain action/filter?
Thomas is also asking for a way to redirect according to language chosen, alongside user roles. The simplest solution I can think of is a placeholder within the link e.g. "site.com/%LANG%/etc/" which changes according to the language, could that work? If I remember correctly, that's how your languages are structured in urls. If so, how do I get the %LANG% variable? If a dev can post that here, getting that into the plugin will be pretty straightforward.

March 9, 2011 at 11:43 am #22099

Orit

Hi Marcus,
We're still checking on the first question. As for the second - you can use the ICL_LANGUAGE_CODE constant to get the current language.

March 9, 2011 at 1:52 pm #22100

marcus

hi Mihai, does that give me the segment you use in the URL to differentiate languages?

March 11, 2011 at 8:54 am #22101

Orit

ICL_LANGUAGE_CODE is the code of the current language as decoded from the url.

March 11, 2011 at 9:23 am #22102

Amir
Supporter

Regarding #1, we checked and made sure that as long as plugins call

load_plugin_textdomain

only after WPML had set the locale the .mo files are loaded correctly.
We didn't check the code for your plugin. Can you make sure that this order is preserved?

March 11, 2011 at 12:01 pm #22103

marcus

Awesome, that's almost everything I need to get this working, one more detail:
can you tell me when the .mo locales are meant to be loaded (i.e. the hook and priority)? I believe my plugin loads the textdomain immediately, no hooks, so that could be why we have issues atm. If this works, it could also be used to fix another plugin I maintain, Events Manager.

March 11, 2011 at 12:47 pm #22104

Orit

In the ajax login plugin the mo files are loaded when the plugin is loaded whereas this should happen after 'plugins_loaded'.

March 11, 2011 at 12:52 pm #22105

marcus

nice, thanks mihai, will update the plugin(s) asap to reflect this. I don't think it should conflict with either plugins order of initialization with that hook, as it's pretty early on.

March 11, 2011 at 2:19 pm #22106

Amir
Supporter

Great. I'm glad to hear it's working and all are happy. I'm closing this thread to keep it from going off-track. If anyone needs anything related, please open a new one.

The topic ‘[Closed] plugin login with ajax’ is closed to new replies.