Would it be possible to let the Gravity Forms plugin look for language files in wp-content/lanuages/
? It's really annoying to update all of the instances of the plugin by hand.
Would it be possible to let the Gravity Forms plugin look for language files in wp-content/lanuages/
? It's really annoying to update all of the instances of the plugin by hand.
Does anyone have an idea? Maybe a snippet for functions.php?
A huge +1 for this request. This might not by high on your (as in GF) priority list, but for us international guys this would be a major time saver. I maintain more than 80 sites for clients and having to manually upload the translation files every time a GF update comes along is a pain ...
Wouldn't adding another define to gravityforms.php do the trick?
if(!defined("GRAVITY_LANGUAGES_URL"))<br />
define("GRAVITY_LANGUAGES_URL", "http://path-to-translationfi.le/");
and using that url in line 50 load_plugin_textdomain( 'gravityforms', FALSE, 'GRAVITY_LANGUAGES_URL' );
That would allow us to add a define to for instance a functions.php file ..
Looks great Remkus. Thanks!
I will add that into 1.5. Keep posted for the next beta in a week or two.
w00t!
I was in the process of adding the setting and I noticed that WordPress has a hook that allows you to change the path of the MO files, so I thought it would more "proper" to use that hook instead. Here is a code snippet to change the location to a languages folder in the root of the website
add_filter('load_textdomain_mofile', 'change_mo_file_location', 10, 2);
function change_mo_file_location($mofile, $domain){
//remove the following two lines if you would like to set the path for all MO files
if($domain != "gravityforms")
return $mofile;
$pathinfo = pathinfo($mofile);
return ABSPATH . "/languages/" . $pathinfo["basename"];
}
I was not aware of that filter, thanks! I personally do have slight preference my version, but this works fine too, I guess.
Thanks again Alex!