Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 17 replies, has 2 voices.

Last updated by Bruno Kos 6 months, 4 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
July 31, 2019 at 8:42 am #4312989

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I received a definite answer that there is no such thing unfortunately. However, you can suggest it here:
https://wpml.org/suggest-a-new-feature-for-wpml/

If there are enough feature requests of this kind, our development team will take this into consideration for implementation. However, I cannot give you any guarantees that it will happen.

Regards,
Bruno Kos

July 31, 2019 at 8:49 am #4313033

christianS-25

Bruno,

Thanks!

We've been experimenting ourselves with some custom queries, this is what we've got so far and it seems to work as expected. Could you please validate the following code with your 2nd tier:

            $data_name_default = "Electric Connection Load (kW)";
            $translation_key = "de";
            $translation_label = "Anschlusslast (kW)";

            global $wpdb;
            $string_id = $wpdb->get_results( "SELECT `id`, `name`, `value` FROM `{$wpdb->prefix}icl_strings` WHERE `name` = 'taxonomy singular name: '" . $data_name_default . "' AND `value` = '" . $data_name_default . "' AND `context` = 'WordPress' LIMIT 1" );

            if( count( $string_id ) > 0 ):
              $string_translation_id = $wpdb->get_results( "SELECT `id`, `string_id`, `language`, `value` FROM `{$wpdb->prefix}icl_string_translations` WHERE `string_id` = '" . $string_id[0]->id . "' AND `language` = '" . $translation_key . "' LIMIT 1" );

              if( count( $string_translation_id ) == 0 ):
                $wpdb->query(
                  $wpdb->prepare( "INSERT INTO `{$wpdb->prefix}icl_string_translations` ( `string_id`, `language`, `status`, `value` ) VALUES ( %d, %s, %d, %s )", $string_id[0]->id, $translation_key, 10, $translation_label ));
              else:
                if( $string_translation_id[0]->value != $translation_label ):
                  $wpdb->query(
                    $wpdb->prepare( "UPDATE `{$wpdb->prefix}icl_string_translations` SET `value` = %s WHERE `id` = %d", $translation_label, $string_translation_id[0]->id ));
                endif;
              endif;
            endif;
July 31, 2019 at 11:21 am #4313863

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I'm afraid that I cannot help you further - examining custom code our clients provide is outside of what support offers. Also if trying to achieve what is not offered by WPML functionality through means of custom code, it is then considered to be outside of the support as well.
https://wpml.org/purchase/support-policy/.

Regards,
Bruno Kos