addons-settings-page.php
6 years ago
advanced-settings-page.php
6 years ago
error-manager-page.php
6 years ago
language-switcher-shortcode.php
6 years ago
license-settings-page.php
6 years ago
machine-translation-settings-page.php
6 years ago
main-settings-language-selector.php
6 years ago
main-settings-page.php
6 years ago
settings-navigation-tabs.php
6 years ago
test-api-settings-page.php
6 years ago
translation-manager.php
6 years ago
trp-remove-duplicate-rows.php
6 years ago
trp-update-database.php
6 years ago
main-settings-page.php
119 lines
| 1 | |
| 2 | <div id="trp-main-settings" class="wrap"> |
| 3 | <form method="post" action="options.php"> |
| 4 | <?php settings_fields( 'trp_settings' ); ?> |
| 5 | <h1> <?php esc_html_e( 'TranslatePress Settings', 'translatepress-multilingual' );?></h1> |
| 6 | <?php do_action ( 'trp_settings_navigation_tabs' ); ?> |
| 7 | |
| 8 | <table id="trp-options" class="form-table"> |
| 9 | <tr> |
| 10 | <th scope="row"><?php esc_html_e( 'Default Language', 'translatepress-multilingual' ); ?> </th> |
| 11 | <td> |
| 12 | <select id="trp-default-language" name="trp_settings[default-language]" class="trp-select2"> |
| 13 | <?php |
| 14 | foreach( $languages as $language_code => $language_name ){ ?> |
| 15 | <option title="<?php echo esc_attr( $language_code ); ?>" value="<?php echo esc_attr( $language_code ); ?>" <?php echo ( $this->settings['default-language'] == $language_code ? 'selected' : '' ); ?> > |
| 16 | <?php echo esc_html( $language_name ); ?> |
| 17 | </option> |
| 18 | <?php }?> |
| 19 | </select> |
| 20 | <p class="description"> |
| 21 | <?php esc_html_e( 'Select the original language of your content.', 'translatepress-multilingual' ); ?> |
| 22 | </p> |
| 23 | |
| 24 | <p class="warning" style="display: none;" > |
| 25 | <?php esc_html_e( 'WARNING. Changing the default language will invalidate existing translations.', 'translatepress-multilingual' ); ?><br/> |
| 26 | <?php esc_html_e( 'Even changing from en_US to en_GB, because they are treated as two different languages.', 'translatepress-multilingual' ); ?><br/> |
| 27 | <?php esc_html_e( 'In most cases changing the default flag is all it is needed: ', 'translatepress-multilingual' ); ?> |
| 28 | <a href="https://translatepress.com/docs/developers/replace-default-flags/"><?php esc_html_e( 'replace the default flag', 'translatepress-multilingual' ); ?></a> |
| 29 | </p> |
| 30 | |
| 31 | </td> |
| 32 | </tr> |
| 33 | |
| 34 | <?php do_action( 'trp_language_selector', $languages ); ?> |
| 35 | |
| 36 | <tr> |
| 37 | <th scope="row"><?php esc_html_e( 'Native language name', 'translatepress-multilingual' ); ?> </th> |
| 38 | <td> |
| 39 | <select id="trp-native-language-name" name="trp_settings[native_or_english_name]" class="trp-select"> |
| 40 | <option value="english_name" <?php selected( $this->settings['native_or_english_name'], 'english_name' ); ?>><?php esc_html_e( 'No', 'translatepress-multilingual') ?></option> |
| 41 | <option value="native_name" <?php selected( $this->settings['native_or_english_name'], 'native_name' ); ?>><?php esc_html_e( 'Yes', 'translatepress-multilingual') ?></option> |
| 42 | </select> |
| 43 | <p class="description"> |
| 44 | <?php esc_html_e( 'Select Yes if you want to display languages in their native names. Otherwise, languages will be displayed in English.', 'translatepress-multilingual' ); ?> |
| 45 | </p> |
| 46 | </td> |
| 47 | </tr> |
| 48 | |
| 49 | <tr> |
| 50 | <th scope="row"><?php esc_html_e( 'Use a subdirectory for the default language', 'translatepress-multilingual' ); ?> </th> |
| 51 | <td> |
| 52 | <select id="trp-subdirectory-for-default-language" name="trp_settings[add-subdirectory-to-default-language]" class="trp-select"> |
| 53 | <option value="no" <?php selected( $this->settings['add-subdirectory-to-default-language'], 'no' ); ?>><?php esc_html_e( 'No', 'translatepress-multilingual') ?></option> |
| 54 | <option value="yes" <?php selected( $this->settings['add-subdirectory-to-default-language'], 'yes' ); ?>><?php esc_html_e( 'Yes', 'translatepress-multilingual') ?></option> |
| 55 | </select> |
| 56 | <p class="description"> |
| 57 | <?php echo wp_kses ( __( 'Select Yes if you want to add the subdirectory in the URL for the default language.</br>By selecting Yes, the default language seen by website visitors will become the first one in the "All Languages" list.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?> |
| 58 | </p> |
| 59 | </td> |
| 60 | </tr> |
| 61 | |
| 62 | <tr> |
| 63 | <th scope="row"><?php esc_html_e( 'Force language in custom links', 'translatepress-multilingual' ); ?> </th> |
| 64 | <td> |
| 65 | <select id="trp-force-language-in-custom-links" name="trp_settings[force-language-to-custom-links]" class="trp-select"> |
| 66 | <option value="no" <?php selected( $this->settings['force-language-to-custom-links'], 'no' ); ?>><?php esc_html_e( 'No', 'translatepress-multilingual') ?></option> |
| 67 | <option value="yes" <?php selected( $this->settings['force-language-to-custom-links'], 'yes' ); ?>><?php esc_html_e( 'Yes', 'translatepress-multilingual') ?></option> |
| 68 | </select> |
| 69 | <p class="description"> |
| 70 | <?php esc_html_e( 'Select Yes if you want to force custom links without language encoding to keep the currently selected language.', 'translatepress-multilingual' ); ?> |
| 71 | </p> |
| 72 | </td> |
| 73 | </tr> |
| 74 | |
| 75 | <tr> |
| 76 | <th scope="row"><?php esc_html_e( 'Language Switcher', 'translatepress-multilingual' ); ?> </th> |
| 77 | <td> |
| 78 | <div class="trp-ls-type"> |
| 79 | <input type="checkbox" disabled checked id="trp-ls-shortcode" ><b><?php esc_html_e( 'Shortcode ', 'translatepress-multilingual' ); ?>[language-switcher] </b> |
| 80 | <div> |
| 81 | <?php $this->output_language_switcher_select( 'shortcode-options', $this->settings['shortcode-options'] ); ?> |
| 82 | </div> |
| 83 | <p class="description"> |
| 84 | <?php esc_html_e( 'Use shortcode on any page or widget.', 'translatepress-multilingual' ); ?> |
| 85 | </p> |
| 86 | </div> |
| 87 | <div class="trp-ls-type"> |
| 88 | <label><input type="checkbox" id="trp-ls-menu" disabled checked ><b><?php esc_html_e( 'Menu item', 'translatepress-multilingual' ); ?></b></label> |
| 89 | <div> |
| 90 | <?php $this->output_language_switcher_select( 'menu-options', $this->settings['menu-options'] ); ?> |
| 91 | </div> |
| 92 | <p class="description"> |
| 93 | <?php |
| 94 | $link_start = '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) .'">'; |
| 95 | $link_end = '</a>'; |
| 96 | printf( wp_kses( __( 'Go to %1$s Appearance -> Menus%2$s to add languages to the Language Switcher in any menu.', 'translatepress-multilingual' ), [ 'a' => [ 'href' => [] ] ] ), $link_start, $link_end ); ?> |
| 97 | <a href="https://translatepress.com/docs/settings/#language-switcher"><?php esc_html_e( 'Learn more in our documentation.', 'translatepress-multilingual' ); ?></a> |
| 98 | </p> |
| 99 | </div> |
| 100 | <div class="trp-ls-type"> |
| 101 | <label><input type="checkbox" id="trp-ls-floater" name="trp_settings[trp-ls-floater]" value="yes" <?php if ( isset($this->settings['trp-ls-floater']) && ( $this->settings['trp-ls-floater'] == 'yes' ) ){ echo 'checked'; } ?>><b><?php esc_html_e( 'Floating language selection', 'translatepress-multilingual' ); ?></b></label> |
| 102 | <div> |
| 103 | <?php $this->output_language_switcher_select( 'floater-options', $this->settings['floater-options'] ); ?> |
| 104 | <?php $this->output_language_switcher_floater_possition( $this->settings['floater-position'] ); ?> |
| 105 | </div> |
| 106 | <p class="description"> |
| 107 | <?php esc_html_e( 'Add a floating dropdown that follows the user on every page.', 'translatepress-multilingual' ); ?> |
| 108 | </p> |
| 109 | </div> |
| 110 | </td> |
| 111 | </tr> |
| 112 | |
| 113 | <?php do_action ( 'trp_extra_settings', $this->settings ); ?> |
| 114 | </table> |
| 115 | |
| 116 | <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p> |
| 117 | </form> |
| 118 | </div> |
| 119 |