AesopInteractive / lasso

Code Repository for Editus (formerly Lasso) Commercial Plugin
https://edituswp.com
GNU General Public License v2.0
147 stars 25 forks source link

Use load_plugin_textdomain #104

Open rhurling opened 9 years ago

rhurling commented 9 years ago

Hi,

I think lasso should useload_plugin_textdomain instead of manually building the path and using load_textdomain. This brings the positive side effect that one doesn't have to reupload the translations after each update, since they can be stored in wp-content/languages/plugins instead of wp-content/plugins/lasso/languages.

Just replacing

$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );

in https://github.com/AesopInteractive/lasso/blob/836c5dafaa5c0d30040d2cf1c4527d69e9e57e6e/public/includes/lasso.php#L251 with

load_plugin_textdomain( $domain, false, dirname( plugin_basename( LASSO_FILE ) ) . '/languages' );

is all that's needed and it still allows translations to be stored in the languages folder of lasso.

bearded-avenger commented 9 years ago

Thanks for the heads up! Since we use a license and automatic update system to update the plugin users don't have to worry about re-uploading translations. We encourage users to submit translations so that everyone can benefit, which are then automatically updated as we get them from Transifex.

Lasso uses the same technique as we use in Aesop Story Engine which is in almost 100 languages and so far there haven't been any issues there.

rhurling commented 9 years ago

Okay... I updated manually on my dev site using the WP updater and it removed my translation in the process. Furthermore I can't find any link to a Transifex site or something like that where I could submit a translation, see current translation status or download a translation.

I just think that this change would be easy and backwards compatible to the current approach, furthermore Aesop Story Engine would probably have to use load_plugin_textdomain to be able to benefit from the WP Repo's translation system (once that finally comes online).

PS: My translation file isn't even complete, mostly because our Users won't be able to see the backend and I didn't bother to translate it yet.

michaelbeil commented 9 years ago

Editus is not on Transifex, Nick was mistaken. Do you have a translation file that you want included?