wrong text domain in newsletters lite?

At least this free lite version of the plugin makes some problems if you would like to translate the plugin. It seems for me, the wrong text domain in the __(...) functions is used. According to

https://codex.wordpress.org/I18n_for_WordPress_Developers

"The text domain is a unique identifier, which makes sure WordPress can distinguish between all loaded translations. If your plugin is a single file called my-plugin.php or it is contained in a folder called my-plugin the domain name should be my-plugin. The text domain name must use dashes and not underscores."

Newsletters lite plugin defines "wp-mailinglist" as text domain, while the folder is newsletters-lite.

Comments

  • 8 Comments sorted by
  • Vote Up0Vote Down

    quick and dirty so you must not wait for an update:

    you can rename the pluginfolder  to wp-mailinglist  without loosing your options

    but after this you have to reactive the plugin and now translation would work => I have had the same troubles this weeking and figured this ten minutes ago out :-)

    I'm using the languages files from github => download as .zip;

    upload  the "us" language files and after this I can use the plugin loco translate for translation => it works!

  • Vote Up0Vote Down

    Hello @bhenselmann,

    Monika is actually right, you can please follow her instructions to get your translation to work while using the newsletter-lite. We are currently working on some improvements for the plugin upgrade process and translations, those are going to be available in a future update.

    Please let us know if the provided solution works for you ok?

    All the best!

  • Vote Up0Vote Down

    @MonikaTS

    Thank you for providing the great information you did.

    @bhenselmann

    Please let us know if you manage with it.

    We are adding this to our development list so that we can check the textdomain and see if there is a fix needed for it. The textdomain should be dynamically set to the folder name though.

  • Vote Up0Vote Down

    @tribulant

    I managed it by changing the text-domain in file wp-mailinglist.php from wp-mailing-list to newsletters-lite, which worked as well.

    But with updating the plugin today to v 4.5.5.2 (btw: thanks for repairing the unsubsribe-shortcodes!) offcause this gets lost together with the .po /.pot /.mo files in the language-folder of the plugin.

    Maybe your developers will find a better  solution for the translation. It should not be very hard, because I´ve never had this problems with other plugins.

  • Vote Up0Vote Down

    @bhenselman

    Thank you for your response.

    The language files should match the folder of your plugin.

    So if your plugin's folder is newsletters-lite, your language files should be newsletters-lite-en_US.mo.

    If your plugin's folder is wp-mailinglist, your language files should be wp-mailinglist-en_US.mo

    The newsletters-lite folder is the WordPress.org plugin.

    It is exactly the same as the one that users get from us, the only difference is the serial key.

    We are working on this to see how we can consolidate everyone to the same folder at the moment.

    Thank you for your feedback on this so far.

  • Vote Up0Vote Down

    @bhenselmann

    We've been working on this in our latest development.

    It will consolidate all users to the same folder name for the Newsletter plugin.

    The folder name will now always be wp-mailinglist

    We'll first run some trials on it before launching it though.

    If you want to try it out, please send us a ticket: http://tribulant.com/support/

  • Vote Up0Vote Down

    @tribulant

    Hello,

    I´ve updated the newsletter-lite plugin to the newest version 4.5.5.9, which is available on WP repository.

    Unfortunately the obove discussed problem with the text domain of the plugin is not solved up to now.

    According to

    https://codex.wordpress.org/I18n_for_WordPress_Developers

    "The text domain is a unique identifier, which makes sure WordPress can distinguish between all loaded translations. If your plugin is a single file called my-plugin.php or it is contained in a folder called my-plugin the domain name should be my-plugin. The text domain name must use dashes and not underscores."

    The folder of the plugin is: "newsletter-lite"

    plugin_name is: "Newsletter"

    The main php-file name is: "wp-mailinglist.php"

    The Text Domain is: "wp-mailinglist"

    The plugin uses the __() language function in this way: __('Select Drop Down', $this -> plugin_name)

    Because of that, the language function is not using the text domain "wp-mailinglist" but the text domain "Newsletter".

    Offcourse the website admin can rename anything, so it is working at the end, but this seems not to be a professional way.

    If you like to use plugins like Loco Translation Management to create individual translations for the WP-core, themes and plugins, the translation management plugin will not find the .mo-files of the newsletter-lite plugin, because the text domain is not defined according to WordPress standards.

    To be shure, that individual translations not getting lost by updating a plugin, WordPress a plugin could use the folder wp-content/languages/plugin.

    Have a look on http://ottopress.com/2013/language-packs-101-prepwork/ , where Otto describes the proper use of text-domains.

    Hope, you get it with the next version?

  • Vote Up0Vote Down

    @bhenselmann

    Actually $this -> plugin_name refers to the folder name.

    So if your plugin's folder is wp-mailinglist that is the textdomain that will be used.

    So you can put your language file(s) in wp-content/plugins/wp-mailinglist-languages/*textdomain*-*lang*.mo eg. wp-mailinglist-en_US.mo or wp-mailinglist-de_DE.mo

    Let me know if everything is in order or if you need further assistance with this.

Sign In or Register to comment.