omegacoder
Forum Replies Created
-
Thanks marcus for all your assitance!
For me, using get_locale() always output en_US, so I couldn’t use that. I don’t have time now to dig and find out why. I’m really disappointed I couldn’t get the translations through. I’ve tried regenerating the .po file many times, and I see the translation strings in the .po file. My .mo file is also regenerated, but they just don’t show on my website for some reason. Does anyone else have this problem? Is my poedit software buggy? No, it works for my own custom plugin. I would really want to the solution
As to your suggested solution, I’m doing something similar now, although i’m a bit uncomfortable with these unclean quick fixes, because they really should be translated through the .po,.mo files, but as a practical solution, that’s what I’ll have to do – for now anyway
For everyone reading this, I’ve used the following solution:
my theme function file:
global $blog_id;
// using multisite, $blog_id=1 refers to main site
switch($blog_id) {
case 1:
default:
define(‘TXT_SEARCH_FOR_EVENTS’, ‘search for events’);
// etc
break;
case 2:
define(‘TXT_SEARCH_FOR_EVENTS’,’搜索您感兴趣的活动’);
// etc
break;
}So I put all the non-working translations in the case, the rest was successsfully translated in the .op, .mo files
when I echo my locale it always shows en_US
echo $locale = get_locale();
But I’ve set the language of my subsite to chinese, and it still displays the locale as en_US (settings > general, site language set to chinese)
well if I use the get_lcale() and output the translations that way, isn’t this a messy hack?
I’ve regenerated the .po, .mo file many times without it working. Also within my theme, I have buddypress translations, so perhaps the translations will work still even if not in the plugin, I think you just have to referene the text domain e.g. _e(‘my text’,’buddypress);
anyway, about this get_locale() hack can you provide some sample code to set me on the right track? although I have quite a few translations remaining, so this really would be a last resort
ok, just checked no, it’s not in global tables mode
yes, it’s network activated. what is enable global tables mode?
also maybe relevant, I’m using wordpress multisite, the main site is english and subsite chinese
yes you are right it should work. It’s all from the events manager plugin default, so I hadn’t changed anything there.
I expected this to simply work. But it hasn’t. I checked the dbem-zh_CN.po file and it does contain the correct translations for relevant strings, but it doesn’t show up on my chinese version website when I call it in my theme, like this
<input type=”text” class=”search_input” value=”<?php _e(‘search for events’, ‘dbem’); ?>” />
I’m using a childtheme by the way, but I don’t see how this matters, I have other translations that work alright both in other plugins and this childtheme
that only applies for the events list search filter. I’ve got mine as a sidebar (which is not part of events manager). Actually I just realized that maybe this is why the translation is not showing, because my code above is not in the events manager plugin where the .po, .mo files are.
ill do some tests and report back for everyones information
check out https://www.jesstown.com/cn (see side bar), to see what I mean.
Also, my translation for “Event Tags” isn’t showing, and this I believe is part of events manager plugin, which is not showing in chinese also
thanks. I appreciate it!
thanks, I checked these files but didn’t help.
In the end I just updated the events manager plugin to latest version 5.2.9 and that solved the problem. ok, I had to re-enter all the hacks I did, but luckily it didn’t intefer with the changes made in the new events manager version.
Thanks alot for your help. Just so much stuff going on in my life right now. and I appreciate any help you’ve given, Thanks!!
ok, but does it work if you don’t put any words in the search input field, select “all categories” and “shanghai”?
At the moment it only works if you select a specific category
Yes, I’ve made some modifications to the plugin, and I’ve forgotten where I’ve made those changes, so I don’t really want to upgrade unless I really have, not to mention that it’s on multisite and other various plugins that have some minor modifications too
Is this a known bug with the events manager plugin version I’m using?
Yes you can try
https://www.jesstown.com/events/Play with the search filter and see that the “all categories” doen’t work. Although the other work
I’d appreaciate it if you are able to provide some insight into the issue? Thanks in advance
… also isn’t the em_event_save filter only used for custom fields for events. however events tags are infact seperate database entities and exist seperate from events. Since they are more than just events meta information, they are taxonomy terms for events. I’ve checked out the source files, and theres seperate classes to deal with event taxonomy: em-tag.php and em-tag-taxonomy.php, but these only deal with retrieving taxonomy data, and not saving them
I’m running:
events manager 5.2.5
wordpress 4.3.2 (running multisite)I only running on localhost, so can’t supply any links
I checked out the image source on the subsite, and it makes use of timthumb.php scripts. Not sure if this helps. The html image tag source is: https://localhost/events-community/cn/wp-content/plugins/events-manager/includes/thumbnails/timthumb.php?src=https://localhost/events-community/cn/files/2012/09/000798-image0.jpg&h=80&w=100
I’ve check the permissions on blogs.dir, and it’s writable alongside all the subfolders, but still no image appears
Hi,
The code snippet you supplied just gives a list of previously created event tags. Ok, this I can probably change to just an input text field so that the user can insert any event tag text to the event.
But I got stuck when you say hook into the “em_event_save” filter, where do I do this? in events-manager.php? Also event tags comprise of several db tables “wp_terms”, “wp_terms_taxonomy” and “wwp_term_relationships”, and inserting tags related info into these table together, is a bit more complicated than the styles example in the online tutorial.
Amittedly I’m new to wordpress, and for the benefit of others that will surely in future encounter this issue can you please give a bit clearer instructions on how to allow users create their own event tags. I will surely be grateful man