Пример #1
0
 public static function get_instance()
 {
     if (self::$instance == null) {
         self::$instance = new AE_Language();
     }
     return self::$instance;
 }
Пример #2
0
    /**
     * Field Render Function.
     *
     * Takes the vars and outputs the HTML for the field in the settings
     *
     * @since AEFramework 1.0.0
     */
    function render()
    {
        $language = AE_Language::get_instance();
        $langArr = $language->get_language_list();
        ?>
    	
		<div class="f-left-all width100p clearfix">
			<div class="" >
				<select id="base-language">
					<option class="empty" value=""><?php 
        _e('Choose a Language', ET_DOMAIN);
        ?>
</option>
					<?php 
        foreach ($langArr as $value) {
            ?>
						<option value="<?php 
            echo $value;
            ?>
"><?php 
            echo $value;
            ?>
</option>
					<?php 
        }
        ?>
				</select>		
			</div>

			<div class="btn-language">
				<button id="save-language"><?php 
        _e('Save', ET_DOMAIN);
        ?>
 <span class="icon" data-icon="~"></span></button>
			</div>
		</div>
        <p>
            <?php 
        _e("You should save your translation after every 20 strings to make sure they won't lost ", ET_DOMAIN);
        ?>
        </p>
		<div id="translate-form" style="height: 600px;overflow-y: scroll;margin-top: 30px;" >		        			

		</div>
		<div id="pager"></div>
				
    <?php 
    }
Пример #3
0
    /**
     * Field Render Function.
     *
     * Takes the vars and outputs the HTML for the field in the settings
     *
     * @since AEFramework 1.0.0
     */
    function render()
    {
        $language = AE_Language::get_instance();
        $langArr = $language->get_language_list();
        $selected_lang = $this->value;
        ?>
		<ul class="list-language">
    	<?php 
        foreach ($langArr as $value) {
            ?>
        	<li>
        		<a class="<?php 
            if ($selected_lang == $value) {
                echo "active";
            }
            ?>
" title="<?php 
            echo $value;
            ?>
" href="#et-change-language" rel="<?php 
            echo $value;
            ?>
"><?php 
            echo $value;
            ?>
 </a>
        	</li>
        <?php 
        }
        ?>
        	<li class="new-language">
        		<button class="add-lang"><?php 
        _e('Add a new language', ET_DOMAIN);
        ?>
<span class="icon" data-icon="+"></span></button>
        		<div class="lang-field-wrap">
        			<input id="" type="text" placeholder="<?php 
        _e("Enter language name", ET_DOMAIN);
        ?>
" name="lang_name" class="input-new-lang">
        		</div>
        	</li>
        </ul>

		<div class="no-padding">
			<div class="show-new-language">
				<div class="item form no-background no-padding no-margin">
					<div class="form-item form-item-short">
						<!-- <div class="label"><?php 
        _e("Language name", ET_DOMAIN);
        ?>
:</div> -->
						<input id="new-language-name" class="bg-grey-input" type="text" placeholder="<?php 
        _e("Enter the language's name", ET_DOMAIN);
        ?>
" />
						<button id="add-new-language" ><?php 
        _e('Add language', ET_DOMAIN);
        ?>
<span class="icon" data-icon="+"></span></button>
						<a class="cancel" id="cancel-add-lang"><?php 
        _e('Cancel', ET_DOMAIN);
        ?>
</a>
					</div>
				</div>
			</div>
		</div>

    <?php 
    }