Title: Make it work with WPML
Last modified: August 21, 2016

---

# Make it work with WPML

 *  Resolved [Thubten](https://wordpress.org/support/users/thubten/)
 * (@thubten)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/)
 * If you use _WPML String_ with this pluggin, I propose two files change:
 * In **_quotes-collection-admin.php_**:
 * – Line 40, under **$results = $wpdb->query( $insert );**
 *     ```
       //WPML
       if (function_exists('icl_register_string')) {
       	$newid = $wpdb->insert_id;
       	icl_register_string('Quotes Collection', 'Quote ID '.$newid, trim(stripslashes($quote), "'"));
       	icl_register_string('Quotes Collection', 'Source ID '.$newid, trim(stripslashes($source), "'"));
       	icl_register_string('Quotes Collection', 'Author ID '.$newid, trim(stripslashes($author), "'"));
       }
       ```
   
 * – Line 89, under **$results = $wpdb->query( $update );**
 *     ```
       // WPML
       if (function_exists('icl_register_string')) {
       	icl_register_string('Quotes Collection', 'Quote ID '.$quote_id, trim(stripslashes($quote), "'"));
       	icl_register_string('Quotes Collection', 'Source ID '.$quote_id, trim(stripslashes($source), "'"));
       	icl_register_string('Quotes Collection', 'Author ID '.$quote_id, trim(stripslashes($author), "'"));
       }
       ```
   
 * – Line 109, under **” WHERE quote_id = ” . $quote_id;**
 *     ```
       // WPML
       if (function_exists('icl_unregister_string')) {
       	icl_unregister_string('Quotes Collection', 'Quote ID '.$quote_id);
       	icl_unregister_string('Quotes Collection', 'Source ID '.$quote_id);
       	icl_unregister_string('Quotes Collection', 'Author ID '.$quote_id);
       }
       ```
   
 * In **_quotes-collection.php_**:
 * – Line 91, under **$random_quote = $wpdb->get_row($sql, ARRAY_A);**
 *     ```
       // WPML
       if (function_exists('icl_t')) {
       	$random_quote['quote'] = icl_t('Quotes Collection', 'Quote ID '.$random_quote['quote_id'], $random_quote['quote']);
       	$random_quote['source'] = icl_t('Quotes Collection', 'Source ID '.$random_quote['quote_id'], $random_quote['source']);
       	$random_quote['author'] = icl_t('Quotes Collection', 'Author ID '.$random_quote['quote_id'], $random_quote['author']);
       }
       ```
   
 * > Each time you _add_ or _edit_ a quote, it will add a new **WPML string** with**
   > Quote ID**, **Source** and **Author** to translate.
 * Yours

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Sylvie D](https://wordpress.org/support/users/sylvie-d/)
 * (@sylvie-d)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/#post-5095045)
 * Thanks A LOT for this, it made my day!
    A question: how do you make the Quotes
   Collection (Random Quote) Widget title appear in the WPML strings?
 *  Thread Starter [Thubten](https://wordpress.org/support/users/thubten/)
 * (@thubten)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/#post-5095047)
 * Hello,
 * To add the **Widget title** in **WPML String**, please change the plugin’s code
   as follow:
 * In **_quotes-collection-widget.php:_**
 * – Line 13, under **$options = get_option(‘quotescollection’);**
 *     ```
       // WPML
       if (function_exists('icl_t')) {
       	$options['title'] = icl_t('Quotes Collection', 'Widget title', $options['title']);
       }
       ```
   
 * – Line 71, under **update_option(‘quotescollection’, $options);**
 *     ```
       //WPML
       if (function_exists('icl_register_string')) {
       	icl_register_string('Quotes Collection', 'Widget title', $options['title']);
       }
       ```
   
 * All the best
 *  [Sylvie D](https://wordpress.org/support/users/sylvie-d/)
 * (@sylvie-d)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/#post-5095049)
 * Hello Thubten,
 * The widget title is now registered as a string and can be translated but now 
   the widgets in the translated languages do not appear anymore in the sidebar.
   But it is OK, don’t spend time on this, I will do without a title… Thanks again
   for your help!
 *  Thread Starter [Thubten](https://wordpress.org/support/users/thubten/)
 * (@thubten)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/#post-5095050)
 * Your welcome…
    Hope it will be helpful for anyone who wants to use this plugin
   with WPML.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Make it work with WPML’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quotes-collection.svg)
 * [Quotes Collection](https://wordpress.org/plugins/quotes-collection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quotes-collection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quotes-collection/)
 * [Active Topics](https://wordpress.org/support/plugin/quotes-collection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quotes-collection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quotes-collection/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Thubten](https://wordpress.org/support/users/thubten/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/make-it-work-with-wpml/#post-5095050)
 * Status: resolved