• Resolved Yordan Soares

    (@yordansoares)


    Hi @hokku,

    I’m using your plugin and I like very much. I just found two small issues:

    1. Its not well prepared for translation
    2. Print the HTML tags in message

    I made a few changes to fix it. First of all, I add four new lines to the plugin header comments in cf7-telegram.php (License, License URI, Text Domain and Domain Path):

    /*
    * Plugin Name: Contact Form 7 + Telegram
    * Description: Sends messages to Telegram-chat
    * Author:      Hokku
    * Version:     0.4
    * License:     GPL v2 or later
    * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    * Text Domain: cf7-telegram
    * Domain Path: /languages
    */

    You can edit the license if you want, but the text domain must to be ?cf7-telegram? that is the one define for the slug of www.ads-software.com (https://developer.www.ads-software.com/plugins/plugin-basics/header-requirements/). Another change I made in the main file of plugin was the text domain loader. This ones register the text domain and path of .mo files for translation purposes:

    // Load text domain for internationalitation
    load_plugin_textdomain('cf7-telegram', FALSE,  dirname(plugin_basename(__FILE__)) . '/languages');

    I also edit the value of class variable $domain in class-wpcf7telegram.php file to ?cf7-telegram? to match with the slug of the plugin, a requirement for WordPress to consider the plugin internationalitation well done. Finally, I created a .pot file, the main translation project of plugin, and also a .po file with the es_ES translation.

    After apply all the changes we can see the setting screen in the selected language (in this case es_ES):

    In the same file, I added new lines of code from :99 to :131 to transform HTML tags to Markdown code and add line :138 to enable parse_mode to Markdown.

    Before convert HTML tags into Markdown:

    After the convertion:

    Download the last changes from here

    Thanks for your work and I hope this helps other people besides me ??

    • This topic was modified 5 years, 1 month ago by Yordan Soares. Reason: adding download link
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘A few fix to improve the plugin’ is closed to new replies.