ddw_wcde_setup_translation_loader

Translation loader for loading translations, depending on location (frontend & admin; frontend only; admin only).

Description

ddw_wcde_setup_translation_loader(); 

For current active plugin


Usage

  1. if ( !function_exists( 'ddw_wcde_setup_translation_loader' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-wctranslations-loader.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_wcde_setup_translation_loader(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wcde-wctranslations-loader.php  
  1. function ddw_wcde_setup_translation_loader() { 
  2.  
  3. /** Bail early, if no German locale environment */ 
  4. if ( ! wcde_is_german() ) { 
  5. return; 
  6.  
  7. /** Unload original packagedtranslationsto avoid merging */ 
  8. //unload_textdomain( 'woocommerce' ); 
  9.  
  10. /** Get plugin general options */ 
  11. $wcde_loading_location = get_option( 'wcde_loading_location' ); 
  12.  
  13. /** 1) Loadtranslationsglobal - both, frontend & admin */ 
  14. if ( 'global' === $wcde_loading_location ) { 
  15.  
  16.  
  17.  
  18. /** 2) Loadtranslationsonly within admin */ 
  19. elseif ( is_admin() && 'admin_only' === $wcde_loading_location ) { 
  20.  
  21.  
  22.  
  23. /** 3) Loadtranslationsonly in frontend */ 
  24. elseif ( ! is_admin() && 'frontend_only' === $wcde_loading_location ) { 
  25.  
  26.  
  27. } // end if is_admin() & settings checks 
  28.  
  29. } // end of function ddw_wcde_setup_translation_loader