Plugin Directory

Changeset 1665360


Ignore:
Timestamp:
05/26/2017 11:56:39 AM (9 years ago)
Author:
alexhal
Message:

translation added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wplms-unit-access-addon/trunk/classes/wplms_uaa_class.php

    r1663725 r1665360  
    1111          add_filter('wplms_unit_metabox',array($this,'add_number_of_access'));
    1212          add_action('the_content',array($this,'check_update_user_access_meta'));
     13          add_action('plugins_loaded',array($this,'wplms_uaa_translations'));
    1314        } // END public function __construct
    1415        public function activate(){
     
    1920        function add_number_unit_access_backend($settings){
    2021          $settings['vibe_unit_access_number']=array( // Text Input
    21               'label' => __('Number of times user can access course units','vibe-customtypes'), // <label>
     22              'label' => __('Number of times user can access course units','wplms-uaa'), // <label>
    2223              'desc'  => '', // description
    2324              'id'  => 'vibe_unit_access_number', // field id and name
     
    3132          $fields = $settings['course_settings']['fields'];
    3233          $arr=array(array( // Text Input
    33               'label' => __('Number of times user can access course units','vibe-customtypes'), // <label>
    34               'desc'=> __('Number of times user can access course units','wplms-front-end' ),
    35               'text'=> __('Number of times user can access course units','wplms-front-end' ),
     34              'label' => __('Number of times user can access course units','wplms-uaa'), // <label>
     35              'desc'=> __('Number of times user can access course units','wplms-uaa' ),
     36              'text'=> __('Number of times user can access course units','wplms-uaa' ),
    3637              'id'  => 'vibe_unit_access_number', // field id and name
    3738              'type'  => 'number', // type of field
     
    4748        function add_number_of_access($settings){
    4849          $settings['number_access']=array( // Text Input
    49               'label' => __('Number of times user can access this unit','vibe-customtypes'), // <label>
     50              'label' => __('Number of times user can access this unit','wplms-uaa'), // <label>
    5051              'desc'  => '', // description
    5152              'id'  => 'number_access', // field id and name
     
    9495            return $content;
    9596        }
     97        function wplms_uaa_translations(){
     98              $locale = apply_filters("plugin_locale", get_locale(), 'wplms-uaa');
     99              $lang_dir = dirname( __FILE__ ) . '/languages/';
     100              $mofile        = sprintf( '%1$s-%2$s.mo', 'wplms-uaa', $locale );
     101              $mofile_local  = $lang_dir . $mofile;
     102              $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
    96103
     104              if ( file_exists( $mofile_global ) ) {
     105                  load_textdomain( 'wplms-uaa', $mofile_global );
     106              } else {
     107                  load_textdomain( 'wplms-uaa', $mofile_local );
     108              } 
     109        }
    97110       
    98111    } // END class WPLMS_Unit_Addon_Class
Note: See TracChangeset for help on using the changeset viewer.