Posted: January 30, 2015 at 10:05 am
|
There are a few words integral to Event Espresso that are not integral to CPR-Twin Cities. For instance, we don’t sell “tickets,” we sell “registrations.” We don’t have “events,” we have “classes.” So I’ve taken to making word substitutions through Quick Localisation:
Well all of this substituting seems to be slowing down the loading of Event Espresso pages. So I’m wondering if these changes can be made through My Custom CSS, instead of Quick Localisation, if that would speed up the loading process any. I’m also wondering if there might be a way for EE4 to someday have a place to make changes like these within the plugin itself. |
Hi John, It turns out that My Custom CSS and Quick Localisation serve two different purposes: My Custom CSS allows for changing CSS, which controls the layout and colors of your website. Quick Localization allows for changing text strings by means of translation functions. My Custom CSS does not have the ability to change text strings by means of translation functions. Two other options (use poedit or use a custom function) that may be more performant than using the Quick Localization plugin are outlined in this guide: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/ |
|
|
Thank you, Josh. Quick Localization certainly looks easier for making changes in wording than POedit. I don’t recognize the word “performant.” Are you saying that POedit outperforms, and, therefore, will load faster than Quick Localization? I guess the next question is, does POedit outperform Quick Localization sufficiently to make it worthwhile in making the extra editing effort? No sense in doing it unless my website visitors will notice a difference. |
The difference will likely be minimal. However, the more time you put into the small improvements, the bigger the overall improvement on your site will be. If you are going to use PO/MO files, I do have another suggestion although it is similar to POEdit. There is a plugin called Loco Translate which builds the PO/MO files for you, but also allows you to edit translations within the dashboard, so you get the best of both worlds. |
|
|
Thank you, Tony. I just downloaded and installed Loco Translate. When I chose Event Espresso, I got this message:
While I do have the core EE4 installed, I also have Events Table View Template (EE4.4.9+) installed and activated, and I have Event Espresso – Calendar (EE 4.3+) installed, but not activated. I’m guessing that it is seeing that as three separate versions of Event Espresso.
I can totally appreciate what you’re saying here. But I’m trying to shave off seconds from load times. So, to be clear, are we just talking milliseconds when we’re talking about how much time it takes a plugin like Quick Localisation to replace a handful of words? If so, maybe I should be looking at more productive ways to produce that effect. |
Hmm, I’m not entirely sure just how much of an improvement it would be, I do not think it would be significant. So likely milliseconds, but I could be wrong. You could try using something like P3 Profiler and running it with Quick Localization enabled and disabled, then compare. If the difference is significant then it would be worth trying the other method, although again, you may not notice a difference, its hard to say. I would like to note it is easy to get, for lack of a better word, addicted to these kinds of tools. Spending hours upon hours trying to get everything as optimized as possible, only to find that your again, shaving milliseconds. So take note of the results, but be aware that lots of things can effect performance, the type of server you are using, the load that server is under from others (shared hosting especially), the location of your server relative to your visitor etc. I’m investigating the error you mentioned above. |
|
|
Excellent analysis and perspective on this subject. “Addicted” is a good choice of words. So is “obsessed.” I just know that many people are so impatient, they’re likely to bail out of a website if they have to wait a couple of seconds for a page to load. It’s amazing how impatient people have gotten! Funny, I was just running P3 Profiler when your message came in. I don’t know if these numbers will mean much, but here’s what I got (which changes slightly every time I run it):
The pie chart looks like Event Espresso is accounting for 65% of the plugin run time (or 1.0859 seconds). Quick Localisation is accounting for 30% (or 0.5042 seconds). And “other” is accounting for 5% (or 0.0848 seconds). I don’t know what would be considered normal. Does any of this help in determining if I’m quibbling about something insignificant?
Thank you. |
Event Espresso does a so much more than most plugins, there is a huge amount of information within EE, so its expected that it will show as taking longer than other plugins. What kind of hosting are you using? |
|
|
I’m on a shared server at Bluehost. Yes, I expected that EE would account for a majority of the loading time. As an experiment, I just deactivated Quick Localisation, and here are the results:
EE is now accounting for 91% of the load time (0.7447 seconds), and other is 9% of load time (0.0781 seconds). Am I interpreting this correctly, is it twice as fast without QL installed? If so, maybe I just live with the inappropriate words (“tickets” instead of “registrations,” “events” instead of “classes,” and so forth). There are several wording differences in my QL list, that really make the registration process simpler and clearer for a business like mine, that holds classes, not concerts and such. Sure wish there wasn’t a time tradeoff. Sure wish some effort could go into making EE4 more flexible in such wording changes within the plugin itself (changes that would survive a version update). |
How would you prefer we do this other than allowing translations? We do spend a lot of time/effort in making sure the strings within EE can all be translated to allow for this. If there are strings that can not be done just let us know where they are and we will include those. From your results I ran a few tests on one of me test sites and it does appear that the Quick Localization plugin increases the load time dramatically. So I switched languages on that site (EE automatically sideloads the MO file for that language when you do) and re-ran the tests. This resulted in slightly longer loading times than without translations, but not as dramatic as QL, so if you do want to change the strings, I would recommend using the PO/MO file method. I have created a ticket for us to investigate this further. |
|
|
Sorry if I offended you. Certainly didn’t mean to do so. I have no idea how complicated it is to create, without utilizing supplemental plugins. But this is the one area that I’d love to see that ability to change the wording listed in my original post (see the top of this discussion). Most, if not all, of the substitutions make it more understandable for my potential customers to understand what they need to do to sign up for a class. If they get a bit confused, a bit scared, I lose them. So I try to incorporate what I’ve learned about spoon-feeding them what they need to do to get registered. Again, Tony, I certainly didn’t mean to offend you. You’ve been a great resource for me! In the meantime, I’ll see if I can figure out how to use the PO/MO file method. |
Apologies John, I took no offence and I’m sorry if it come across that way. It took me re-reading my reply a few times but I can see how you could think I did, just poor choice of phrasing on my part. What I meant was I’m unsure how else we could provide a way of changing the phrasing to suit multiple use cases other than allowing translations? We could have (for example) a ‘ticket mode’ and a ‘class mode’ but then again that doesn’t suit all use cases and just shifts the problem to another use case. So we find the best way is to go with generic phrasing as much as we can, and allow the strings to be translated to suit whichever use case you may need. |
|
|
Thank you again. I know we’re on the same side. Glad to see we’re okay. I just downloaded POEdit. Let’s see how far I can get on my own without asking for help. 😉 |
|
John, if you get stuck please just reach out to us. We are here to help. That being said, Poedit is pretty straight forward yo use, but here’s a guide just in case: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/ |
|
Thank you, Dean. Hopefully, I’m going to find time to give it a try sometime today. |
|
Well, I decided to try out Loco Translate. No idea if I did it correctly, but I do have a file now called “event-espresso-core-reg.pot.po” that’s now on my computer. What’s the next step in uploading it to my website? Where should it be placed? |
|
I’ve been digging around Loco Translate for general instructions. You know, words that tell you how to use the product. So far I haven’t come across any words that a non-programmer/non-developer would understand. Just curious, what’s the name of the file that holds all of the EE4 words and phrases I might want to change? How difficult would it be for me to download that file through FTP and make changes in TextEdit, then upload the file back? If I did a search of the words and phrases, replacing them with my preferred choices (being extremely careful, of course, to not lose any coding along the way), maybe, just maybe, that would be the best course of action for me. No extra plugins to deal with and slow down loading speeds. As long as I keep a copy of the original file, I wonder how much trouble I could get myself into. (grin!) |
|
So Loco Translate should have produced the .po file. You’ll want to then open up that .po file in PoEdit. Once you have finished your translation work in poedit, you will use poedit to export a .mo file (machine object). That is a binary file that you will not be able to edit, but when you place it onto your site, WP will pick it up and use it for the actual translation work. |
|
Thanks, Sidney. Maybe you missed my most recent entry. I already created a .po file with Loco Translate. I have no idea if I did that correctly, as they don’t believe in posting instructions. So I just guessed. Now back to my most recent question:
If I don’t need to use Loco Translate and PoEdit, isn’t that ultimately easier than learning to use two more plugins? And wouldn’t the pages load faster if they didn’t have to replace words every time the pages are opened? As it turns out, Quick Localisation wasn’t quick at all. Yes, it was quick to figure out and use, but it doubled the loading time of my pages. Seriously, doubled it. So if you’d just direct me to the source, I’d like to try editing there. And if it turns out that’s not possible, then maybe I’ll try the Loco Translate -> PoEdit route. |
|
Hi John, You can of course edit the terminology directly at source though I strongly advise to not to, as it will become a manual job every time you update the plugin. Now, there are a lot of instances of the phrases Registration and Events, so giving you a list of where to find them is virtually impossible. There are 5934 translatable strings in EE, and trying to separate out the translatable word “event” from the generally used word event is difficult. Your best option would be to use Poedit to find them as it just searches the strings and note down the location accordingly. I’d like to offer you a different solution than manually doing it. It does involve a plugin but it is fairly lightweight, but does involve editing some code. Create a Site Specific functions plugin – it’s really quite easy, we have instructions here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ Add the following to the site specific plugin:
If you read through the code, it should be fairly straightforward. You add in what you want to change and then what it will become: ‘Register’ becomes ‘Sign up’ Just follow the structure and don’t forget the commas at the end of each and you should be fine. The plugin itself uses gettext like every other translation plugin, but it has 0 overhead (no settings, extra files etc), so while it will still increase load time as it processes the gettext, it should be less of an effect than other plugins. https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function |
|
You make a great case for trying this approach, Dean. Thank you for creating a template for me to follow. I’ll give it a try when I am able. |
|
Okay, I need more help here. Following these instructions: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ I’ve created a folder within public_html => wp_content. And in a file inside that folder I’ve added this code:
I saved the file edit. Then I went to my WP dashboard, clicked on Plugins => Editor, then clicked on the box in the upper right corner to look for my new plugin. But it’s not there. So there must be at least one more step in between saving the file and looking for it in the dashboard. What would that be? By the way, regarding step 6b, I don’t know if I need to get any file permissions from my web host, but I did get a “success” sign when I edited the file. And one more question, regarding the code Dean provided me above. Does that go into the file on my web host that I just created, or does it go into the plugin on my WP dashboard? Right now I have it edited with some of the changes I want to make, but it’s just in a TextEdit file on my Mac. |
|
You really don’t want to use the Plugins=>Editor. |
|
So, you’re advising me against what Dean advised me to do? How am I to resolve that conflict in advice? |
|
Oh, no, I would follow Dean’s advice. I would just never use the built in editor in WP for anything, plugins or themes. Only use your local editor, TextEdit, and then upload the edited file to your site’s installation over ftp. |
|
So, if you read my post, you’d know that I was working in a TextEdit file. Now, back to my questions, if you could answer them I’d appreciate it. Here’s what I prepared to add, based on Dean’s advice:
Essentially, I want to change four words. Maybe more later, but just four basic words. Two words, really, with singular and plural versions. And I don’t want to learn a new program or do anything extraordinary. I just want to substitute a few words. And I don’t want to use anything like Quick Localisation, makes the website un-quick. So where does that code belong, and how does it get to where it belongs? Sidney, you might want to re-read my question before answering. |
|
oh, I see, you put the custom plugin file in wp-content, instead of wp-content/plugins. |
|
Okay, I have an uploaded file inside a folder, which is inside wp-content/plugins. Now, how do I get it to show up in my WP dashboard plugins list? |
|
Seriously, what’s the next step? |
|
Before you can put any code into a custom functions plugin, you will need to get your custom plugin recognized by WP by following the standards here: http://codex.wordpress.org/Writing_a_Plugin#Standard_Plugin_Information but I’m really afraid we may be talking at cross-purposes here. We need to get your custom functions plugin recognized so that you can insert your custom code so that you can get this gettext function working to get your site to translate these four strings. That may be completely accurate, or not, I just want to make sure we are on the same page here. |
Hi John, the coding snippet that you shared isn’t going to work as you expect. You are likely wanting it to change the word “event” to “class” and so forth. However, the gettext filter will only do that if the word is by itself so the following would be changed: event …however, the word event in the following statement would not be changed using the coding that you shared. I look forward to seeing you at my event. Download this plugin and install it through WordPress admin –> Plugins –> Add New –> Upload: http://cl.ly/0B0x1n0T3p3p/download/cprtwincities-sitespecificplugin.zip You can see the messaging/verbiage that it will change here: https://gist.github.com/lorenzocaum/b4bbd1bb839a1c80b2b4 Thanks — |
|
|
I asked for help in getting EE to say things differently. I asked to change “tickets” to something that would work for my business, like “registrations” for classes. I don’t hold “events.” I hold “classes.” Thus I need wording changes. I was told it was going to be simple: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ But what I’m being told now is in no way simple. If you’d like to help, please go back to the beginning on this forum and read what’s already been covered before responding again. |
|
Thank you, Lorenzo. I was in the middle of sending Sidney a reply when your followup came in. I added the plugin you sent me, though the name of what showed up in my WP plugins looks like the plugin I was trying to enter earlier:
So is this yours or mine? Whichever it is, it still says:
where I want it to say:
Here’s an example: http://www.cpr-twincities.com/community/cpr On this page, http://www.cpr-twincities.com/events/adult-pediatric-adult-child-infant-cpraed-2, it also says:
rather than
It also says:
But I’d like it to say:
Below that, however, the next line is just as I’d like it:
On this page, http://www.cpr-twincities.com/register, I’d like it to say
instead of:
I’m hoping that this very specific feedback will help you to understand what I’m attempting to do. |
|
It’s probably a very simple thing if we are on the same page, but I think we might be out of phase a little bit, talking cross purposes. |
|
Sidney, I don’t know how we could be talking “cross purposes.” Once again, I ask you to start at the beginning of this forum. And, once you’ve done that, I think you’ll see that my purpose has not changed. How you’re interpreting that purpose, that intent, that desire, however, I can’t control. So, for that reason, yes, we probably are talking “cross purposes.” We absolutely need to be on the same page if you’re going to be successful in helping here. And it’s quite clear that we’re not at all on the same page. Regarding your statement that you don’t think that there are “simpler ways” to replace words, perhaps you’ve never used Quick Localisation. If you had, you’d know that it will do what I want it to do. It just doubles the loading time of each translated page. I’m hoping that one of the EE veterans will jump in and help sort this out. |
|
Any high-level EE folks available to help me here? There’s been some progress, but I’ve been getting too much conflicting advice, which makes me lose my patience. I sure would like to solve this problem, so I can go back to work running the rest of my one-person business. |
Hi I came across this post because I have also found that many of the standard wording in EE isn’t right for some clients.The tracking down and adjustment is a little long-winded some of which involves adding code. I used a different WP online booking plugin recently and it had a ‘translation’ section which simply allowed you to map all of the various strings used in the plugin to whatever you chose. It was a straightforward solution which worked perfectly. EE needs something like this in a future version. |
|
|
Hi hoffinst,
|
|
I’m still trying to get this accomplished. I just edited the text of what I think Lorenzo created for me, and added that to the plugin that he also created for me. I’ll post it below:
I changed the text within the plugin, then clicked the button to update it. But this is the resulting fatal error message I got:
Could it be because I tried this?
Here’s a sample page of where you see these words: http://www.cpr-twincities.com/events/bls-cpraed-for-pro-rescuers-health-care-providers-3 The original line was “Available Tickets,” which I already changed to “Available Registrations.” But what I’m trying to do here is eliminate this line altogether. Ultimately, I really don’t care what words are used on the back end. I only care about what site visitors see, so they really understand what’s going on. I suspect that the code needs to be changed on the server, not conveniently my dashboard. If so, please tell me where to find the file. And can I do it without an editing tool other than TextEdit? |
|
Would somebody please tell me what the syntax error is and how to fix it!!! So we’re both on the same page, here is a current copy of what I have in my plugin:
|
How are you adding that code currently? I looks like your editor is styling the quotes… so ‘Event’ => ‘Class’, as opposed to: 'Event' => 'Class', So is seems ‘Class’ is being considered as a class declaration. Try using the code here: https://gist.github.com/Pebblo/fe477d573ab2dbda686d Although this will depend on how you are adding the code to plugin currently? |
|
|
Hi, Tony. Thanks for your response. Funny, I was thinking that the quotes might be the problem, so I went through the whole thing and made sure that they were all regular, not “smart.” Isn’t that the way they appear in what I posted? I’ve been adding all this code into the WP plugin that Lorenzo created for me. I get the error message when I go to re-activate the plugin. Okay, here goes with your edit … And it appears that it’s been accepted by the WordPress gods. I don’t know what magic you used, but it seems to have worked. No, wait a minute. It seems to have broken something, as “View Details” takes me to a “Not Found” page: “Apologies, but the page you requested could not be found. Perhaps searching will help.” I’m going to deactivate the plugin until you get a chance to look through the code, if you don’t mind. Nope, deactivating it didn’t get it back. Maybe you’ll be able to see it here: http://www.cpr-twincities.com/classes/bls-cpraed-for-pro-rescuers-health-care-providers-3 |
|
I have no idea why, but on my laptop computer, everything’s just fine. Apparently, even though I emptied the cache on my desktop computer through WP Super Cache (several times) it still appeared broken. But, clearly, something bad was still hanging on in my desktop, no matter how many times I emptied the cache. So now — after two weeks of back-and-forth communications between us — it appears that all’s well in WordPressLand. Thank you for all of your help! |
The support post ‘Regarding Speed – My Custom CSS vs. Quick Localisation?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.