Advertisement
alex91ckua

wcipi country localization

Feb 9th, 2024
890
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.     $current_laguage = apply_filters( 'wpml_current_language', NULL );
  3.  
  4.     if ( $current_laguage === 'ua' ) {
  5.         echo <<<EOD
  6. <script>
  7.     jQuery(function() {
  8.         const newCountriesData = {
  9.           'Ukraine': 'Україна',
  10.           'Poland': 'Польща'
  11.         };
  12.  
  13.         setTimeout(() => {
  14.             jQuery('.iti__country-name').each( function() {
  15.               const countryName = jQuery(this).text();
  16.               jQuery(this).text(newCountriesData[countryName]);
  17.             });
  18.         }, 3000);
  19.     });
  20. </script>
  21. EOD;
  22.     }
  23. ?>
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement