first commit
This commit is contained in:
169
wp-content/plugins/loco-translate/tpl/admin/config/apis.php
Normal file
169
wp-content/plugins/loco-translate/tpl/admin/config/apis.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* API keys/settings screen
|
||||
*/
|
||||
|
||||
$this->extend('../layout');
|
||||
/* @var Loco_mvc_ViewParams $ui */
|
||||
/* @var Loco_mvc_ViewParams[] $apis */
|
||||
/* @var Loco_mvc_ViewParams $nonce */
|
||||
$help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/providers');
|
||||
?>
|
||||
|
||||
<form action="" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<input type="hidden" name="<?php $nonce->e('name')?>" value="<?php $nonce->e('value')?>" />
|
||||
<table class="form-table">
|
||||
<tbody><?php
|
||||
// DEEPL
|
||||
$api = $apis['deepl']?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php $ui->e('api_key')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--deepl_api_key">
|
||||
<?php $ui->e('api_key')?>:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[deepl][key]" id="loco--deepl_api_key" value="<?php $api->e('key')?>" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<span class="description"><a href="https://www.deepl.com/translator" target="_blank" tabindex="-1">https://www.deepl.com/translator</a></span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr><?php
|
||||
// GOOGLE
|
||||
$api = $apis['google']?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php $ui->e('api_key')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--google_api_key">
|
||||
<?php $ui->e('api_key')?>:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[google][key]" id="loco--google_api_key" value="<?php $api->e('key')?>" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<span class="description"><a href="https://cloud.google.com/translate/" target="_blank" tabindex="-1">https://cloud.google.com/translate</a></span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr><?php
|
||||
// LECTO AI
|
||||
$api = $apis['lecto']?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php $ui->e('api_key')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--lecto_api_key">
|
||||
<?php $ui->e('api_key')?>:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[lecto][key]" id="loco--lecto_api_key" value="<?php $api->e('key')?>" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<span class="description"><a href="https://lecto.ai/?ref=loco" target="_blank" tabindex="-1">https://lecto.ai/?ref=loco</a></span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr><?php
|
||||
// MICROSOFT
|
||||
$api = $apis['microsoft']?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php $ui->e('api_key')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--microsoft_api_key">
|
||||
<?php $ui->e('api_key')?>:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[microsoft][key]" id="loco--microsoft_api_key" value="<?php $api->e('key')?>" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--microsoft_api_region">
|
||||
<?php $ui->e('api_region')?>:
|
||||
</label>
|
||||
<input type="text" size="20" name="api[microsoft][region]" id="loco--microsoft_api_region" value="<?php $api->e('region')?>" spellcheck="false" placeholder="global" />
|
||||
</p>
|
||||
<p>
|
||||
<span class="description"><a href="https://aka.ms/MicrosoftTranslator" target="_blank" tabindex="-1">https://aka.ms/MicrosoftTranslator</a></span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr><?php
|
||||
// OPENAI (CHATGPT)
|
||||
$api = $apis['openai']?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php $ui->e('api_key')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--openai_api_key">
|
||||
<?php $ui->e('api_key')?>:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[openai][key]" id="loco--openai_api_key" value="<?php $api->e('key')?>" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--openai_api_model">
|
||||
Model:
|
||||
</label>
|
||||
<input type="text" size="50" name="api[openai][model]" id="loco--openai_api_model" value="<?php $api->e('model')?>" placeholder="gpt-4o-mini" spellcheck="false" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--openai_prompt" style="vertical-align: top">
|
||||
Prompt:
|
||||
</label>
|
||||
<textarea class="regular-text" name="api[openai][prompt]" id="loco--openai_prompt"><?php $api->e('prompt')?></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<span class="description"><a href="https://platform.openai.com/" target="_blank" tabindex="-1">https://platform.openai.com/</a></span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr><?php
|
||||
/* @var Loco_mvc_ViewParams[] $hooked */
|
||||
foreach( $hooked as $api ):?>
|
||||
<tr>
|
||||
<th scope="row"><?php $api->e('name')?></th>
|
||||
<td>
|
||||
<p><?php
|
||||
$api->key ? esc_html_e('Configured externally','loco-translate') : esc_html_e('No API key','loco-translate') ?><br />
|
||||
<span class="description"><a href="<?php $api->e('url')?>" target="_blank" tabindex="-1"><?php $api->e('url')?></a></span>
|
||||
</p>
|
||||
</td>
|
||||
</tr><?php
|
||||
endforeach?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="panel">
|
||||
<p>
|
||||
<strong class="has-icon"><?php esc_html_e('Important','loco-translate')?>:</strong>
|
||||
<span>
|
||||
<?php esc_html_e('Third party services are subject to their own terms of use and may incur costs from the provider','loco-translate')?>.
|
||||
<a href="<?php self::e($help)?>#legal" target="_blank" tabindex="-1"><?php esc_html_e('See full disclaimer','loco-translate')?></a>.
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" class="button-primary" value="<?php esc_html_e('Save settings','loco-translate')?>" />
|
||||
<a class="button button-link" href="<?php self::e($help)?>" target="_blank"><?php esc_html_e('Documentation','loco-translate')?></a>
|
||||
</p>
|
||||
</form>
|
||||
137
wp-content/plugins/loco-translate/tpl/admin/config/debug.php
Normal file
137
wp-content/plugins/loco-translate/tpl/admin/config/debug.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* System diagnostics
|
||||
*/
|
||||
$this->extend('../layout');
|
||||
|
||||
/* @var Loco_mvc_ViewParams $versions */
|
||||
/* @var Loco_mvc_ViewParams $encoding */
|
||||
?>
|
||||
|
||||
<div class="panel" id="loco-versions">
|
||||
<h3>
|
||||
Versions
|
||||
<a href="#loco-versions" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl><?php
|
||||
foreach( $versions as $key => $value ): if( $value ):?>
|
||||
<dt>
|
||||
<?php self::e($key)?>:
|
||||
</dt>
|
||||
<dd>
|
||||
<code class="path" id="loco-vers-<?php self::e(strtolower(strtr($key,' ','-')))?>"><?php
|
||||
$versions->e($key)?></code>
|
||||
</dd><?php
|
||||
endif; endforeach?>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-unicode">
|
||||
<h3>
|
||||
Unicode
|
||||
<a href="#loco-unicode" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl>
|
||||
<dt>UTF-8 rendering:</dt>
|
||||
<dd><?php echo $encoding->OK?> <span id="loco-utf8-check"><?php echo $encoding->tick?></span></dd>
|
||||
|
||||
<dt>Multibyte support:</dt>
|
||||
<dd><?php $encoding->e('mbstring')?></dd>
|
||||
|
||||
<dt>Site character set</dt>
|
||||
<dd><?php $encoding->e('charset')?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-ajax">
|
||||
<h3>
|
||||
Ajax
|
||||
<a href="#loco-ajax" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl>
|
||||
<dt>Endpoint:</dt>
|
||||
<dd><code id="loco-ajax-url" class="path">/wp-admin/admin-ajax.php</code></dd>
|
||||
|
||||
<dt>JSON decoding:</dt>
|
||||
<dd><?php echo $encoding->json?></dd>
|
||||
|
||||
<dt class="jsonly">Ajax test result:</dt>
|
||||
<dd class="jsonly" id="loco-ajax-check"><span class="inline-spinner"> </span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-apis">
|
||||
<h3>
|
||||
Translation APIs
|
||||
<a href="#loco-apis" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl><?php
|
||||
/* @var Loco_mvc_ViewParams[] $apis */
|
||||
foreach( $apis as $api ):?>
|
||||
<dt><?php $api->e('name')?>:</dt>
|
||||
<dd class="jsonly" id="loco-api-<?php $api->e('id')?>"><span class="inline-spinner"> </span></dd><?php
|
||||
endforeach?>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-sizes">
|
||||
<h3>
|
||||
Limits
|
||||
<a href="#loco-sizes" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl><?php
|
||||
/* @var Loco_mvc_ViewParams $memory */
|
||||
foreach( $memory as $key => $value ):?>
|
||||
<dt>
|
||||
<?php echo $memory->escape($key)?>:
|
||||
</dt>
|
||||
<dd>
|
||||
<?php $memory->e($key)?>
|
||||
</dd><?php
|
||||
endforeach?>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-files">
|
||||
<h3>
|
||||
Filesystem
|
||||
<a href="#loco-files" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl>
|
||||
<dt>File mods disallowed:</dt>
|
||||
<dd><?php echo $fs->disabled?'Yes':'No'?></dd>
|
||||
|
||||
<dt>File mod safety level:</dt>
|
||||
<dd><?php $fs->e('fs_protect')?></dd><?php
|
||||
|
||||
/* @var Loco_mvc_ViewParams[] $locations */
|
||||
foreach( $locations as $label => $f ):?>
|
||||
<dt><?php echo $f->escape($label)?>:</dt>
|
||||
<dd><?php
|
||||
$f->e('path');
|
||||
if( $f->writable ): echo ' ✓'; else:?>
|
||||
<span class="icon icon-warn" title="Not writable directly by PHP"></span><?php
|
||||
endif?>
|
||||
</dd><?php
|
||||
endforeach?>
|
||||
<dt>PHP open_basedir:</dt>
|
||||
<dd><?php self::e(ini_get('open_basedir'))?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="panel" id="loco-debug">
|
||||
<h3>
|
||||
Debug settings
|
||||
<a href="#loco-debug" class="loco-anchor" aria-hidden="true"></a>
|
||||
</h3>
|
||||
<dl><?php
|
||||
foreach( $debug as $key => $value ):?>
|
||||
<dt>
|
||||
<?php echo $debug->escape($key)?>:
|
||||
</dt>
|
||||
<dd>
|
||||
<?php $debug->e($key)?>
|
||||
</dd><?php
|
||||
endforeach?>
|
||||
</dl>
|
||||
</div>
|
||||
47
wp-content/plugins/loco-translate/tpl/admin/config/prefs.php
Normal file
47
wp-content/plugins/loco-translate/tpl/admin/config/prefs.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* User preferences screen
|
||||
*/
|
||||
|
||||
$this->extend('../layout');
|
||||
/* @var Loco_data_Preferences $opts */
|
||||
$help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/settings');
|
||||
?>
|
||||
|
||||
<form action="" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<input type="hidden" name="<?php $nonce->e('name')?>" value="<?php $nonce->e('value')?>" />
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e('Translator credit','loco-translate')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Translator credit','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<input type="text" size="64" name="opts[credit]" id="loco--credit" value="<?php echo esc_attr($opts->credit)?>" placeholder="<?php echo esc_attr($opts->default_credit())?>" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e('Restrict locales','loco-translate')?></th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Restrict locales','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<input type="text" size="64" name="opts[locales]" id="loco--locales" value="<?php echo esc_attr(implode(', ',$opts->locales) )?>" placeholder="en_US, ..." />
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="submit">
|
||||
<input type="submit" class="button-primary" value="<?php esc_html_e('Save settings','loco-translate')?>" />
|
||||
<a class="button button-link" href="<?php self::e($help)?>#user" target="_blank"><?php esc_html_e('Documentation','loco-translate')?></a>
|
||||
</p>
|
||||
</form>
|
||||
236
wp-content/plugins/loco-translate/tpl/admin/config/settings.php
Normal file
236
wp-content/plugins/loco-translate/tpl/admin/config/settings.php
Normal file
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
/**
|
||||
* Global settings screen. (plugin options)
|
||||
*/
|
||||
|
||||
$this->extend('../layout');
|
||||
$help_url = esc_html( apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/settings') );
|
||||
|
||||
/* @var Loco_data_Settings $opts */
|
||||
/* @var Loco_data_Settings $dflt */
|
||||
/* @var Loco_mvc_ViewParams $nonce */
|
||||
/* @var Loco_mvc_ViewParams $verbose */
|
||||
?>
|
||||
|
||||
<form action="#" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<input type="hidden" name="<?php $nonce->e('name')?>" value="<?php $nonce->e('value')?>" />
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Extracting strings','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#xgettext" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Extracting strings','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--max_php_size">
|
||||
<?php esc_html_e('Skip PHP files larger than:','loco-translate')?>
|
||||
</label>
|
||||
<input type="text" size="5" name="opts[max_php_size]" id="loco--max_php_size" value="<?php echo esc_attr( $opts->max_php_size)?>" placeholder="<?php echo esc_attr($dflt->max_php_size)?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--php_alias">
|
||||
<?php esc_html_e('Scan PHP files with extensions:','loco-translate')?>
|
||||
</label>
|
||||
<input type="text" size="15" name="opts[php_alias]" id="loco--php_alias" value="<?php echo esc_attr( implode(' ',$opts->php_alias) )?>" placeholder="<?php echo esc_attr(implode(' ',$dflt->php_alias))?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--jsx_alias">
|
||||
<?php esc_html_e('Scan JavaScript files with extensions:','loco-translate')?>
|
||||
</label>
|
||||
<input type="text" size="15" name="opts[jsx_alias]" id="loco--jsx_alias" value="<?php echo esc_attr( implode(' ',$opts->jsx_alias) )?>" placeholder="<?php echo esc_attr(implode(' ',$dflt->jsx_alias))?>" />
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Saving PO/POT files','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#po" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Saving PO/POT files','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--num-backups">
|
||||
<?php esc_html_e('Number of backups to keep of each file:','loco-translate')?>
|
||||
</label>
|
||||
<input type="number" min="0" max="99" size="2" name="opts[num_backups]" id="loco--num-backups" value="<?php printf('%u',$opts->num_backups)?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--po-width">
|
||||
<?php esc_html_e('Maximum line length (zero disables wrapping)','loco-translate')?>
|
||||
</label>
|
||||
<input type="number" min="0" max="999" size="2" name="opts[po_width]" id="loco--po-width" value="<?php printf('%u',$opts->po_width)?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--po-utf8-bom">
|
||||
<input type="checkbox" name="opts[po_utf8_bom]" value="1" id="loco--po-utf8-bom"<?php echo $opts->po_utf8_bom?' checked':''?> />
|
||||
<?php esc_html_e('Add UTF-8 byte order mark','loco-translate')?> (<?php esc_html_e('Not recommended','loco-translate')?>)
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--ajax-files">
|
||||
<input type="checkbox" name="opts[ajax_files]" value="1" id="loco--ajax-files"<?php echo $opts->ajax_files?' checked':''?> />
|
||||
<?php esc_html_e('Enable Ajax file uploads','loco-translate')?> (<?php esc_html_e('Recommended','loco-translate')?>)
|
||||
</label>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Syncing PO files','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#sync" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Syncing PO files','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--fuzziness">
|
||||
<?php esc_html_e('Fuzzy matching tolerance','loco-translate')?>:
|
||||
</label>
|
||||
<input type="text" size="5" maxlength="3" name="opts[fuzziness]" id="loco--fuzziness" value="<?php echo esc_attr( $opts->fuzziness)?>" placeholder="0-100" />
|
||||
<span>%</span>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--pot-expected">
|
||||
<?php // translators: Indicates that POT files are optional, which is not recommended
|
||||
esc_html_e('Sync with source when template missing','loco-translate')?>:
|
||||
</label>
|
||||
<select name="opts[pot_expected]" id="loco--pot-expected">
|
||||
<option value="0"><?php $verbose->e(0)?></option>
|
||||
<option value="1"<?php echo 1 === $opts->pot_expected?' selected':''?>><?php $verbose->e(1)?></option>
|
||||
<option value="2"<?php echo 2 === $opts->pot_expected?' selected':''?>><?php $verbose->e(2)?></option>
|
||||
</select>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Compiling MO files','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#mo" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Compiling MO files','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--gen-hash">
|
||||
<input type="checkbox" name="opts[gen_hash]" value="1" id="loco--gen-hash"<?php echo $opts->gen_hash?' checked':''?> />
|
||||
<?php esc_html_e('Generate hash tables','loco-translate')?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--use-fuzzy">
|
||||
<input type="checkbox" name="opts[use_fuzzy]" value="1" id="loco--use-fuzzy"<?php echo $opts->use_fuzzy?' checked':''?> />
|
||||
<?php esc_html_e('Include Fuzzy strings','loco-translate')?>
|
||||
</label>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Compiling JSON files','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#json" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Compiling JSON files','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--jed-pretty">
|
||||
<input type="checkbox" name="opts[jed_pretty]" value="1" id="loco--jed-pretty"<?php echo $opts->jed_pretty?' checked':''?> />
|
||||
<?php esc_html_e('Pretty formatting','loco-translate')?>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--jed-clean">
|
||||
<input type="checkbox" name="opts[jed_clean]" value="1" id="loco--jed-clean"<?php echo $opts->jed_clean?' checked':''?> />
|
||||
<?php esc_html_e('Delete redundant files','loco-translate')?>
|
||||
</label>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('File system access','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#fs" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('File system access','loco-translate')?></span>
|
||||
</legend>
|
||||
<p>
|
||||
<label for="loco--fs-persist">
|
||||
<input type="checkbox" name="opts[fs_persist]" value="1" id="loco--fs-persist"<?php echo $opts->fs_persist?' checked':''?> />
|
||||
<?php esc_html_e('Save credentials in session','loco-translate')?>
|
||||
(<?php esc_html_e('Not recommended','loco-translate')?>)
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--fs-protect">
|
||||
<?php esc_html_e('Modification of installed files','loco-translate');?>:
|
||||
</label>
|
||||
<select name="opts[fs_protect]" id="loco--fs-protect">
|
||||
<option value="0"><?php $verbose->e(0)?></option>
|
||||
<option value="1"<?php echo 1 === $opts->fs_protect?' selected':''?>><?php $verbose->e(1)?></option>
|
||||
<option value="2"<?php echo 2 === $opts->fs_protect?' selected':''?>><?php $verbose->e(2)?></option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="loco--pot-protect">
|
||||
<?php esc_html_e('Editing of POT (template) files','loco-translate');?>:
|
||||
</label>
|
||||
<select name="opts[pot_protect]" id="loco--pot-protect">
|
||||
<option value="0"><?php $verbose->e(0)?></option>
|
||||
<option value="1"<?php echo 1 === $opts->pot_protect?' selected':''?>><?php $verbose->e(1)?></option>
|
||||
<option value="2"<?php echo 2 === $opts->pot_protect?' selected':''?>><?php $verbose->e(2)?></option>
|
||||
</select>
|
||||
</p>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php esc_html_e('Grant access to roles','loco-translate')?>
|
||||
<a class="icon only-icon icon-help" href="<?php echo $help_url?>#roles" target="_blank"><span>(?)</span></a>
|
||||
</th>
|
||||
<td>
|
||||
<fieldset>
|
||||
<legend class="screen-reader-text">
|
||||
<span><?php esc_html_e('Allow full access to these roles','loco-translate')?></span>
|
||||
</legend><?php
|
||||
/* @var Loco_mvc_ViewParams[] $caps */
|
||||
foreach( $caps as $cap ):?>
|
||||
<p>
|
||||
<label>
|
||||
<input type="checkbox" name="<?php $cap->e('name')?>" value="<?php $cap->e('label')?>" <?php echo $cap->attrs?> />
|
||||
<?php $cap->e('label')?>
|
||||
</label>
|
||||
</p><?php
|
||||
endforeach;?>
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="submit">
|
||||
<input type="submit" class="button-primary" value="<?php esc_html_e('Save settings','loco-translate')?>" />
|
||||
<a class="button button-link" href="<?php echo $help_url?>" target="_blank"><?php esc_html_e('Documentation','loco-translate')?></a>
|
||||
</p>
|
||||
</form>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin version information
|
||||
*/
|
||||
$this->extend('../layout');
|
||||
|
||||
// Loco Translate version:
|
||||
if( $params->has('update') ):?>
|
||||
<div class="panel panel-warning">
|
||||
<h3 class="has-icon">
|
||||
<?php self::e( __('Version %s','loco-translate'), $version )?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php esc_html_e('A newer version of Loco Translate is available for download','loco-translate')?>.
|
||||
</p>
|
||||
<p class="submit">
|
||||
<a class="button button-primary" href="<?php echo $update_href?>" target="_blank"><?php self::e(__('Upgrade to %s','loco-translate'), 'v'.$update )?></a>
|
||||
<a class="button button-link has-icon icon-ext" href="https://wordpress.org/plugins/loco-translate/installation/" target="_blank"><?php esc_html_e('Install manually','loco-translate')?></a>
|
||||
</p>
|
||||
</div><?php
|
||||
|
||||
elseif( $params->has('devel') ):?>
|
||||
<div class="panel panel-debug">
|
||||
<h3 class="has-icon">
|
||||
<?php self::e( __('Version %s','loco-translate'), $version )?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php esc_html_e("You're running a development snapshot of Loco Translate",'loco-translate')?>
|
||||
</p>
|
||||
</div><?php
|
||||
|
||||
else:?>
|
||||
<div class="panel panel-success">
|
||||
<h3 class="has-icon">
|
||||
<?php self::e( __('Version %s','loco-translate'), $version)?>
|
||||
</h3>
|
||||
<p>
|
||||
<?php esc_html_e("You're running the latest version of Loco Translate",'loco-translate')?>
|
||||
</p>
|
||||
</div><?php
|
||||
endif;
|
||||
|
||||
|
||||
// PHP version (warnings only)
|
||||
if( $params->has('phpupdate') ):?>
|
||||
<div class="panel panel-warning">
|
||||
<h3 class="has-icon"><?php
|
||||
// translators: Where %s is the full version number of PHP
|
||||
self::e( __('PHP %s','loco-translate'), $phpversion )?>
|
||||
</h3>
|
||||
<p><?php
|
||||
// translators: (1) Name of software, e.g. "WordPress" (2) Version number, e.g. "5.6"
|
||||
self::e( __('Your version of %1$s is out of date. We recommend you upgrade to at least v%2$s, but preferably to the latest stable version.','loco-translate'),'PHP',$phpupdate)?>
|
||||
</p>
|
||||
<p class="submit">
|
||||
<a class="button" href="https://www.php.net/downloads.php#v7" target="_blank">PHP 7.4</a>
|
||||
<a class="button button-primary" href="https://www.php.net/downloads.php#v8" target="_blank">PHP 8.x</a>
|
||||
</p>
|
||||
</div><?php
|
||||
endif;
|
||||
|
||||
|
||||
// WordPress version (warnings only)
|
||||
if( $params->has('wpupdate') ):?>
|
||||
<div class="panel panel-warning">
|
||||
<h3 class="has-icon"><?php
|
||||
// translators: Where %s is the full version number of WordPress
|
||||
self::e( __('WordPress %s','loco-translate'), $wpversion )?>
|
||||
</h3>
|
||||
<p><?php
|
||||
self::e( __('Your version of %1$s is out of date. We recommend you upgrade to at least v%2$s, but preferably to the latest stable version.','loco-translate'),'WordPress',$wpupdate)?>
|
||||
</p>
|
||||
<p class="submit">
|
||||
<a class="button button-primary" href="<?php echo esc_url($wpupdate_href)?>"><?php esc_html_e('Update Now','loco-translate')?></a>
|
||||
<a class="button-link has-icon icon-ext" target="_blank" href="https://wordpress.org/download/releases/"><?php esc_html_e( __('Install manually','loco-translate') )?></a>
|
||||
</p>
|
||||
</div><?php
|
||||
endif;
|
||||
Reference in New Issue
Block a user