WPML plugin translation - wordpress

This question's quite stupid, but I'm having trouble getting wpml to translate my plugin. Every translatable string is surrounded by __() calls and they appear POedit, I added translation for a couple of strings and they don't appear.
Translation for the theme is working OK.
I'm sure I'm missing something very stupid like a filename somewhere, or some function call, or something, I've read every piece of documentation I've found and I think it's confused me more. I read that you need to call setlocale, but I'm guessing wpml does that.. what might I be missing?

Is the plugin loading the .mo file?
http://codex.wordpress.org/Function_Reference/load_plugin_textdomain

You might also want to check this FAQ page to see different reasons for String Translation not being applied:
http://wpml.org/faq/language-setup/

I was missing the second parameter in the __() calls, the textdomain name.

Related

Translated polylang strings don't appear

I am translating our website using Polylang. Our theme is Flatbase, fully compatible with WPML so it should also work with Polylang.
I have an issue with the custom strings. They appear in the "string translation" area, and I can type in and save the translation, but the translation doesn't show on the website, the string is still in the original language.
Apparently it is not an issue with wpml-config.xml, since I can see the strings and translate them. I posted on the module community forum but got no answer.
Thank you in advance for your help.
it does't work that way with polylang, you need to register your custom strings in function.php file of your theme. following is the link to similar question. i hope it will be helpful, other wise let me know i'll be happy to help.
https://wordpress.stackexchange.com/questions/82855/custom-strings-for-translation-using-polylang-plugin

Adobe Brackets Wordpress hints / autocomplete

so.. I am trying out Adobe Brackets as my editor right now and I really like it so far, but there is one thing I am missing and I wonder if there is an extension for that..
I mainly code php, css and javascript for wordpress themes / plugins etc. I was using sublime 3 before, where I had a plugin that, if I type a wordpress function name and use the autocomplete, automatically inserts the parameters of that function. So in sublime it looks like this http://i.imgur.com/FxxUOy8.png
In Adobe Brackets I tried every wordpress extension that I found but I cant get the same result. The hints for wordpress functions do work but when I accept a hint it wont insert the parameters of that function http://i.imgur.com/25HsuSe.png
So I wondered if anyone knows an extension that offers autocompletion like in the sublime screenshot. Or am I missing sth else to get that?
Thanks in advance!
I haven't yet installed this, but I came across it today and will be trying it out myself. It's an extension for Brackets called "Brackets WordPress Hint". It looks like the repository hasn't been contributed to in a while, but I haven't (yet) found anything newer.
https://github.com/Tusko/brackets-wp-hint

How to override searchform.php using a plugin

I am trying to build a search form that looks a bit different from the default WP search box. I can edit the searchform.php for that, but I want it to be in form of a plugin, so that I can easily enable it and disable it at will. But the problem is that if WP finds searchform.php, it will use the form in that file, so no tricks like add_filter, add_action will work here. So, what I want to ask from folks here is: does there wxist some way by which I can achieve the above. i.e override the code of searchform.php
Also on a different note, if I name the search box to anything other than "s", then the code goes to index.php, instead of search.php. This, I have verified by putting debug echo's and other wierd statements.
What could be the possible reason for this?
Thanks in advance for your help.
Okay, I found a hack. Not very good though, but works for me. So what I did is, in the activation filter of my plugin, I wrote the code to rename the original searchform.php (the one residing in the current theme folder) to searchform_orig.php This way WP does not find searchform.php and so renders the searchform which I have hooked to the filter. Similarly, on deactivation part, I rename the file back to searchform.php. May not be ideal , but is working on y systems that I have tested. Though I would be interested in knowing loopholes/caveats in this approach. Marking it as an answer ;-)

Stary Quotes Wordpress

OK so here is the deal I am using a plugin called stray quotes for a website,http://ohmsgaming.com/quotes-from-last-session/ , It has some really nice functions I can't find in other plugins like that it has a simple to add quotes to the database etc. Thing is, not only was the styling odd and I had to fix all that. But it only displays text. It doesn't allow comments for each quote, voting, or sharing. This is something I have been asked to make, and for the life of me I can't figure out how.
Here are some of my ideas:
Forget the plugin, use wordpress posts instead, make it so only that post type is shown on that page only. This allows comments to be tied in already etc. Problems here are: Styling the post, and only that type, and making it easy to add quotes for admins and users.
Other thought, modify the stray quote plugin, add the functions to allow commenting etc, since it already has the easy to add parts. Problems: Lots of code to have to read, No clue how to make it so when you hit reply it opens a new "page" with the quote and all its comments in paginated form.
So my questions:
Can anyone help me with either of the above. I have looked through tons of stuff and I can't figure out what to do, there is so many freaking things. The ideal thing would be to have a plugin like stray quotes that had a simple to add quotes section for all; stored them separately from posts; allowed comments(with pagination) and voting; and styled well.
P.S. the WordPress theme I am using is suffusion, which has tons of custom abilities.
Add quotes as a custom taxonomy.
Or simply have post entries with a category of "quote" be output with a different CSS class than normal post entry.

Need a translation toolkit that supports msgctxt

Wordpress 3.1 came out recently with a lot of new features, and as I can see, there's a big change in support for translation. The context feature of GNU Gettext (msgctxt) is now used a lot in Wordpress's code, some e() and _() are replaced by _x() and _ex(). And... it's causing a problem for me.
I'm using PoEdit to edit the translation for Wordpress, but currently it doesn't support msgctxt. I know how to manually edit the .po file to translate a string that uses msgctxt, but it's a hard work. And, the bigger problem is that when I use PoEdit's Update button, all my hard works... go away, the things that I changed by manually editing the .po file go away!
So now, I come here to ask you, do you know any translation toolkit (like PoEdit) that supports GNU gettext's msgctxt? Please tell me, thanks a lot for your help :D
Great news: PoEdit 1.5.5 now supports msgctxt! The key thing to get right is the keyword sources configuration within your Catalog properties. For _x and _ex it should look like: "_x:1,2c" and "_ex:1,2c". Covered in more detail here: http://wp.tutsplus.com/tutorials/theme-development/translating-your-theme/
you can use PoEditor.com it supports the msgctxt!
Regards
I realize this is a year-old question, but have you tried Automattic's own GlotPress?
It's still a work in progress, and you have to install it from the Subversion repository, but it does support translation contexts and it allows collaboration.

Resources