Skip to content

Use load_plugin_textdomain #104

@rhurling

Description

@rhurling

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

$out = load_textdomain( $domain, trailingslashit( LASSO_DIR ). 'languages/' . $domain . '-' . $locale . '.mo' );
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions