Plugin user
Forum Replies Created
-
And by the way, I say this issue is NOT resolved until all of us are translating this plugin without having to edit the core every time the plugin is updated!
One challenge that I have found out with my own plugins is the fact that any variable to be used by Ajax has to be passed to it by POST.
Wordfence translations may be loaded and working fine but when you make that Ajax call, the output does not translate.
Here is my solution. You make the Ajax callback load the translation again when it runs.
For that I had to add some code to Wordfence plugin. Fox example:\wordfence\modules\login-security\classes\controller\ajax.php
public function _ajax_authenticate_callback() { // Added by Horacio to translate messages in user's browser language [Begin] $browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // Get the browser language switch ($browser_lang){ // Set language independently of the country version case "es": $locale = 'es_ES'; break; case "fr": $locale = 'fr_FR'; break; case "it": $locale = 'it_IT'; break; case "pt": $locale = 'pt_BR'; break; case "co": $locale = 'co'; break; default: $locale = 'en_US'; } // and set it to one of these 6 languages of this site $domain = 'wordfence'; $mofile = $domain . '-' . $locale . '.mo'; unload_textdomain( $domain ); load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ); // Added by Horacio to translate messages in user's language [End] if (!isset($_POST['log']) || !is_string($_POST['log']) || empty($_POST['log']) || !isset($_POST['pwd']) || !is_string($_POST['pwd']) || empty($_POST['pwd'])) { self::send_json(array('error' => sprintf(__('<strong>ERROR</strong>: A username and password must be provided. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()))); }Again, eventually Wordfence developers will integrate a version of my solution to the plugin and we all are going to be happy; right guys?
Wordfence is a great plugin!
And it is actually ready for us to translate to many languages. The messages are already using I10n functions. The pot file is easily created with poEdit and translate the messages and saved them in mo files.
The only thing missing in this plugin is to load the texdomain (once the mo translation files are ready).
This is the way I do it.
Because I do not want to edit Wordfence every time they update the plugin, I load the textdomain for WordFence in my own plugin like this:
/* Translate Wordfence plugin */ // Added by Horacio Figarella add_action( 'init', 'Translate_Wordfence' ); function Translate_Wordfence() { $browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); // Get the browser language switch ($browser_lang){ // Set language independently of the country version case "es": $locale = 'es_ES'; break; case "fr": $locale = 'fr_FR'; break; case "it": $locale = 'it_IT'; break; case "pt": $locale = 'pt_BR'; break; case "co": $locale = 'co'; break; default: $locale = 'en_US'; } // and set it to one of these 6 languages of this site $domain = 'wordfence'; // Domain 1 $mofile = $domain . '-' . $locale . '.mo'; // Contains all translation for all 3 domains unload_textdomain( $domain ); load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ); $domain = 'wordfence-2fa'; // Domain 2 //$mofile = $domain . '-' . $locale . '.mo'; // Not needed unload_textdomain( $domain ); load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ); $domain = 'wordfence-ls'; // Domain 3 //$mofile = $domain . '-' . $locale . '.mo'; // Not needed unload_textdomain( $domain ); load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ); }Eventually the plugin developers will integrate a version on this code in their plugin with support for more languages. I am only interested in 6.
I may understand what Tim says above because they are too busy making the plugin that good.
But it really does not take much time to make a plugin translatable. All is needed is to add 2 words to every text to be output.
__( ‘text to be output’, ‘domain’ ) when you want the text translated but not echoed and _e( ‘text to be output’, ‘domain’ ) otherwise.
The advantage of translation, Tim, is to the client, the final user.
This message on the screen:
“Email verification invalid or expired. Please try again.”
You know what it means, I do too, but this person in another country visiting my web site which is all in his/her language and this message pops up in English makes it difficult for them to understand what we want them to do.
Yeah, they can use a machine translator. But I prefer to say exactly what I want, and not to depend on another translator. ¿Entiendes lo que digo?
Horacio
- This reply was modified 6 years ago by Plugin user.
Forum: Plugins
In reply to: [RootsPersona] RootsPersona 3.3.3 NOT ready for PHP 7.0.0 RC 3 yetHi Ed,
RootsPersona 3.3.3 works fine with:
- PHP 7
- WordPress 4.5-alpha (nightly build)
All files in folder \rootspersona\php\dao\mysql:
where
class RP_xxxxxx_xxxxxx_Mysql_Dao extends Rp_Mysql_DAOwill trigger the following PHP Warnings on PHP 7:
Declaration of RP_xxxxxx_xxxxxx_Mysql_Dao::load($id) should be compatible with RP_Mysql_DAO::load($table_name, $id_col, $batch_col, $id, $batch_id) Declaration of RP_xxxxxx_xxxxxx_Mysql_Dao::delete($id) should be compatible with RP_Mysql_DAO::delete($table_name, $id_col, $batch_col, $id, $batch_id) Declaration of RP_xxxxxx_xxxxxx_Mysql_Dao::clean() should be compatible with RP_Mysql_DAO::clean($table_name) .....The reason for that is the function with the same name as the parent class must have the same number of parameters to be compatible on PHP 7:
Parent:
class RP_Mysql_DAO { public function load($table_name, $id_col, $batch_col, $id, $batch_id) {Child:
class RP_Address_Mysql_Dao extends Rp_Mysql_DAO { public function load( $id, $dummy1 = 0, $dummy2 = 0, $dummy3 = 0, $dummy4 = 0 ) {Once you understand this, you will be convinced like me:
Short for Better Portable Graphics, BPG offers around the same image quality as JPEG, but at half the file size. To perform such witchcraft, BPG simply uses a newer codec — x265, the open-source implementation of HEVC/H.265.
I have converted all my videos to HEVC/H.265 (same quality, half the size). The future for some, the present for me. http://x265.org/hevc-h265/
I want to do the same with my 65,000+ photos. 10,000 of them are on my web site at 1920×1080. I just imagine how much faster my pages will open when showing my photo galleries with half the size and the same quality using BPG.
I’ll be waiting for BPG support on WordPress. If it is NextGen Gallery fine; otherwise my purpose is to be able to show the same quality photos in half the size.
NextGen Gallery 1.8.2 and qTranslate 2.5.21 are working fine for me now!
For those of us with multilingual sites:
qtranslate allows you to have as many languages as .mo you have on your site.
To stop NextGen Gallery from redirecting the web site to the default language as you click on albums, galleries, and navigation buttons, NextGen Gallery’s code has to be modified to use a qtraslate function:
from:
$nggRewrite->get_permalink(params)where params varies in pages nggfunctions.php, lib/navigation.php and lib/rewrite.phpto:
qtrans_convertURL($nggRewrite->get_permalink(params))Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Fatal error when creating thumbnailYou are right, Alex. iPower sets my limit to 52 MB. I am trying to have them increase it.
I temporarily increased my available memory by deactivating other plugins, and no error show now. (WordPress2.9-rare and NextGEN Gallery Version 1.4.0a)
This is an awesome plugin! Congratulations, and thanks Alex.