Home › Forums › Community Forum › pro login widget
This topic contains 27 replies, has 3 voices. Last updated by boudewijn lutgerink 4 years ago.
Topic Author | Topic |
---|---|
Posted: Monday Dec 3rd, 2012 at 5:21 am #33280 | |
|
|
I have been playing around wwith the pro login widget. Just one Q arises. The site I have is international, based on a userfield determining the language I would like to display/hide certain possibilities on the site.
|
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Monday Dec 3rd, 2012 at 1:55 pm #33332 | |
![]() |
|
Hi Boudewijn, There is no built-in way to alter the text for the login widget, other than the WordPress I18N translations, which is supported by s2Member. If you internationalized your plugin using I18N, you could change the text. I18N: — Otherwise, if you’d like a quick-and-dirty solution, you could create an edited /includes/classes/login-widget.inc.php file, and put it into a Must Use plugin file by creating a .php file within /wp-content/mu-plugins/ on your server (create the directory if you don’t have it). You should be able to simply CTRL + F and find where s2Member echos the data you’d like to change. |
|
Posted: Monday Dec 3rd, 2012 at 4:14 pm #33366 | |
|
|
Hmmm, this is not what I am looking for. Based on that I want to show them content in their own language. |
|
Posted: Monday Dec 3rd, 2012 at 4:41 pm #33369 | |
![]() |
|
Hi Boudewijn, You’ll need to filter the translation with
|
|
Posted: Thursday Dec 6th, 2012 at 3:00 am #33672 | |
|
|
Hi Bruce, Thanks for the code. I tried it and it seems to work … nearly
For some reason it is not working even though, as far as I can see, the code only fires AFTER logging in. |
|
Posted: Thursday Dec 6th, 2012 at 1:41 pm #33720 | |
![]() |
|
For logged-in users, your code will work fine. This is because you’re using
This sets the default language to ‘EN’, or English. If you’d rather set this to something else, or use another method to find the correct language for users that are NOT logged-in, you can set
|
|
Posted: Thursday Dec 6th, 2012 at 4:02 pm #33761 | |
|
|
I get a 500 error… |
|
Posted: Thursday Dec 6th, 2012 at 4:22 pm #33767 | |
![]() |
|
Try this instead:
|
|
Posted: Thursday Dec 6th, 2012 at 4:39 pm #33778 | |
|
|
doesn’t seem to work. All I get is the English version, no matter how I set the user language. (add the options for those texts to the $options array) BL
|
|
Posted: Thursday Dec 6th, 2012 at 4:44 pm #33782 | |
![]() |
|
If you find editing the file easier, that should work fine as well. |
|
Posted: Sunday Dec 9th, 2012 at 3:40 am #34042 | |
|
|
What I notice is that the title of the loginbox does change after logging in. (My Profile / Mijn Profiel) |
|
Posted: Sunday Dec 9th, 2012 at 4:47 pm #34077 | |
|
|
Where do I find info on the $translated, $original, $content and $domain variables? |
|
Posted: Monday Dec 10th, 2012 at 7:20 am #34122 | |
|
|
Posted: Tuesday Dec 11th, 2012 at 1:05 am #34207 | |
|
|
I am totally lost now on the use of MU plugins. |
|
Posted: Tuesday Dec 11th, 2012 at 1:58 pm #34279 | |
![]() |
|
Posted: Tuesday Dec 11th, 2012 at 6:35 pm #34305 | |
|
|
that hangs the site completely. |
|
Posted: Wednesday Dec 12th, 2012 at 2:44 pm #34401 | |
![]() |
|
Boudewijn, Are you saying it gives you a parse error? What exactly happens? |
|
Posted: Wednesday Dec 12th, 2012 at 4:54 pm #34423 | |
|
|
It might be a parse error. What happens is that the site doesn’t show up at all. The longer I work on this the more I am convinced that my suggestion to add all these options in the $options array is the simplest one. Still the $original, $domain, $context and $translated variables are as clear as thick fog to me.
|
|
Posted: Friday Dec 14th, 2012 at 2:32 pm #34689 | |
![]() |
|
Boudewijn, I updated the code snippet that was in my post that you said affected your site this way. Can you try the new code? Also, I would advise against using this code in your theme’s functions.php file, as it might not load in time for the data to be filtered. |
|
Posted: Monday Dec 17th, 2012 at 1:32 am #34809 | |
|
|
what do you mean with “It might not load in time”? This is the scenario: |
|
Posted: Monday Dec 17th, 2012 at 1:35 am #34811 | |
|
|
What you mean with …it might not load in time…? Is that function loaded once at startup and cannot be called? Once more, I need a function to translate text dynamically based on the language of the user that logs in (and that might NOT be the language the system uses) |
|
Posted: Monday Dec 17th, 2012 at 1:36 am #34812 | |
|
|
sorry for the double reply. somehow the connection failed for a moment and it looked like my comment was not saved… (duuuhhh) |
|
Posted: Tuesday Dec 18th, 2012 at 2:03 pm #34960 | |
![]() |
|
The translation functionality needs to be fired before the text is created in the workspace. In other words, if WordPress includes the file that is creating the translation after the text is created, it won’t change it. |
|
Posted: Friday Dec 21st, 2012 at 12:30 am #35204 | |
|
|
So this mu-plugin is useless then. |
|
Posted: Saturday Dec 22nd, 2012 at 2:24 pm #35343 | |
![]() |
|
This is not the case. You’ll want to use the gettext_with_context filter here. The reason that the code is not working properly is because of either a small error in the code, or because of an error with the way that you’re attempting to get the user’s language. |
|
Posted: Sunday Dec 23rd, 2012 at 2:42 am #35401 | |
|
|
I will definetely come back to this. For now I have to fight the ugly beast called WordPress 3.5. That mean son of a B**ch completely screwed up my site and I am pretty much out of options except for ompletely rebuilding it. If only I could have version 3.4.2 back on that server. |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.