first commit

This commit is contained in:
Roman Pyrih
2025-08-26 10:50:15 +02:00
commit 97352dcdc9
6905 changed files with 2717203 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
/**
* Notice before creating a PO that an existing one can be copied
*/
$this->extend('../layout');
$help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/templates');
/* @var Loco_mvc_ViewParams $params */
/* @var Loco_mvc_ViewParams $ext */
/* @var Loco_mvc_ViewParams $skip */
/* @var Loco_mvc_ViewParams $copy */
?>
<div class="panel panel-warning">
<h3 class="has-icon">
<?php esc_html_e('Template missing','loco-translate')?>
</h3>
<p>
<?php esc_html_e('You can copy an existing PO file (recommended), or extract directly from source (advanced)','loco-translate')?>.
</p>
<p>
<a href="<?php $copy->e('link')?>" class="button button-link button-primary has-icon icon-copy"><?php $copy->e('text')?></a>
<a href="<?php $ext->e('link')?>" class="button button-link has-icon icon-add"><?php $ext->e('text')?></a>
<a href="<?php $skip->e('link')?>" class="button button-link has-icon icon-next"><?php $skip->e('text')?></a>
</p>
</div>

View File

@@ -0,0 +1,174 @@
<?php
/**
* Initialize a new PO translations file
*/
$this->extend('../layout');
/* @var Loco_mvc_ViewParams $params */
/* @var Loco_mvc_ViewParams $prompt */
if( $params->has('prompt') ):?>
<div class="panel panel-info">
<p><?php
$prompt->e('title')?>.
<a href="<?php $prompt->e('link')?>"><?php $prompt->e('text')?></a>.
</p>
</div><?php
endif?>
<div class="panel">
<h2><?php $params->e('subhead')?></h2>
<p><?php $params->e('summary')?></p>
<form action="" method="post" enctype="application/x-www-form-urlencoded" id="loco-poinit"><?php
/* @var Loco_mvc_HiddenFields $hidden */
$hidden->_e();?>
<table class="form-table">
<tbody class="loco-locales">
<tr>
<th scope="row">
<label for="loco-select-locale">
1. <?php esc_html_e('Choose a language','loco-translate')?>:
</label>
</th>
<td>
<fieldset>
<label for="loco-use-selector-1">
<span><input type="radio" name="use-selector" value="1" checked id="loco-use-selector-1" /></span>
<?php esc_attr_e('WordPress language','loco-translate')?>:
</label>
<div>
<span class="lang nolang"></span>
<select id="loco-select-locale" name="select-locale">
<option value=""><?php esc_attr_e('No language selected','loco-translate')?></option>
<optgroup label="<?php esc_attr_e( 'Installed languages', 'loco-translate' )?>"><?php
/* @var Loco_mvc_ViewParams[] $installed */
foreach( $installed as $option ):?>
<option value="<?php $option->e('value')?>" data-icon="<?php $option->e('icon')?>"<?php $option->e('selected')?>><?php $option->e('label')?></option><?php
endforeach;?>
</optgroup>
<optgroup label="<?php esc_attr_e( 'Available languages', 'loco-translate' )?>"><?php
/* @var Loco_mvc_ViewParams[] $locales */
foreach( $locales as $option ):?>
<option value="<?php $option->e('value')?>" data-icon="<?php $option->e('icon')?>"<?php $option->e('selected')?>><?php $option->e('label')?></option><?php
endforeach;?>
</optgroup>
</select>
</div>
</fieldset>
<fieldset class="disabled">
<label for="loco-use-selector-0">
<span><input type="radio" name="use-selector" value="0" id="loco-use-selector-0" <?php $params->has('custom') && print 'checked '?>/></span>
<?php esc_attr_e('Custom language','loco-translate')?>:
</label>
<div>
<span class="lang nolang"></span>
<span class="loco-clearable"><input type="text" maxlength="14" name="custom-locale" value="<?php $params->e('custom')?>" /></span>
</div>
</fieldset>
</td>
</tr>
</tbody>
<tbody class="loco-paths">
<tr valign="top">
<th scope="row">
<label>
2. <?php esc_html_e('Choose a location','loco-translate')?>:
</label>
</th>
<td>
<a href="<?php
/* @var Loco_mvc_ViewParams $help */
$help->e('href')?>#locations" class="has-icon icon-help" target="_blank" tabindex="-1"><?php $help->e('text')?></a>
</td>
</tr><?php
$choiceId = 0;
/* @var Loco_mvc_ViewParams[] $locations */
foreach( $locations as $typeId => $location ):?>
<tr class="compact">
<td>
<p class="description"><?php $location->e('label')?>:</p>
</td>
<td><?php
/* @var Loco_mvc_FileParams $choice */
/* @var Loco_mvc_FileParams $parent */
foreach( $location['paths'] as $choice ):
$parent = $choice['parent'];
$offset = sprintf('%u',++$choiceId);?>
<p><?php
if( $choice->disabled ):?>
<label class="for-disabled">
<span class="icon icon-lock"></span>
<input type="radio" name="select-path" class="disabled" disabled /><?php
else:?>
<label>
<input type="radio" name="select-path" value="<?php echo $offset?>" <?php echo $choice->checked?> />
<input type="hidden" name="path[<?php echo $offset?>]" value="<?php $choice->e('hidden')?>" /><?php
endif?>
<code class="path"><?php $parent->e('relpath')?>/<?php echo $choice->holder?></code>
</label>
</p><?php
endforeach?>
</td>
</tr><?php
endforeach;?>
</tbody><?php
if( $params->has('sourceLocale') ):?>
<tbody id="loco-copy" data-locale="<?php $params->e('sourceLocale')?>">
<tr>
<th scope="row" rowspan="4">
3. <?php esc_html_e('Template options','loco-translate')?>:
</th>
<td>
<a href="<?php $help->e('href')?>#copy" class="has-icon icon-help" target="_blank" tabindex="-1"><?php $help->e('text')?></a>
</td>
</tr>
<tr class="compact">
<td>
<p>
<label>
<input type="radio" name="strip" value="" />
<?php $params->f('sourceLocale', __('Copy target translations from "%s"','loco-translate') )?>
</label>
</p>
<p>
<label>
<input type="radio" name="strip" value="1" checked />
<?php esc_html_e('Just copy English source strings','loco-translate')?>
</label>
</p>
</td>
</tr>
<tr class="compact">
<td>
<p>
<label>
<input type="checkbox" name="json" value="1" checked />
<?php esc_html_e('Merge strings from related JSON files','loco-translate')?>
</label>
</p>
</td>
</tr>
<tr class="compact">
<td>
<p>
<label>
<input type="checkbox" name="link" value="1" checked />
<?php esc_html_e('Use this file as template when running Sync','loco-translate')?>
</label>
</p>
</td>
</tr>
</tbody><?php
endif?>
</table>
<p class="submit">
<button type="submit" class="button button-large button-primary" disabled><?php esc_html_e('Start translating','loco-translate')?></button>
</p>
</form>
</div>

View File

@@ -0,0 +1,46 @@
<?php
/**
* Initialize a new POT template file
*/
$this->extend('../layout');
$help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/templates');
?>
<div class="panel">
<h2><?php $params->e('subhead')?></h2>
<p>
<?php esc_html_e('Source files to scan:','loco-translate')?>
<strong><?php $scan->n('count')?></strong>
<span>(<?php
// Translators: Where %s is the size of a file
$scan->f( 'size', __('%s on disk','loco-translate') );?>, <?php
// Translators: Where %s is the size of a file
$scan->f( 'largest', __('largest is %s','loco-translate') )?>)</span>
</p><?php
if( $n = $scan->skip ):?>
<p>
<em><?php
// Translators: (1) Number of files excluded (2) the maximum size of file that was included
self::e( _n('Excludes %1$s file over %2$s','Excludes %1$s files over %2$s',$n,'loco-translate'), $n, $scan->large )?>.
<a class="icon icon-help" href="<?php echo esc_url(apply_filters('loco_external','https://localise.biz/wordpress/plugin/faqs/skipped-files'))?>" target="_blank"><span class="screen-reader-text">Help</span></a>
</em>
</p><?php
endif?>
<p>
<?php esc_html_e('Strings will be extracted to:','loco-translate')?>
<code class="path"><?php $pot->e('relpath')?></code>
</p>
<form action="" method="post" enctype="application/x-www-form-urlencoded" id="loco-potinit"><?php
foreach( $hidden as $name => $value ):?>
<input type="hidden" name="<?php echo $name?>" value="<?php $hidden->e($name)?>" /><?php
endforeach;?>
<p class="submit">
<button type="submit" class="button button-large button-primary" disabled><?php esc_html_e('Create template','loco-translate')?></button>
<a href="<?php echo esc_url($help)?>" class="button button-large button-link" target="_blank"><?php
esc_html_e('About templates','loco-translate')?></a>
</p>
</form>
</div>

View File

@@ -0,0 +1,33 @@
<?php
/**
* Notice before creating a PO that there is no POT.
*/
$this->extend('../layout');
$help = apply_filters('loco_external','https://localise.biz/wordpress/plugin/manual/templates');
/* @var Loco_mvc_ViewParams $params */
/* @var Loco_mvc_ViewParams $ext */
/* @var Loco_mvc_ViewParams $skip */
/* @var Loco_mvc_ViewParams $conf */
?>
<div class="panel panel-warning">
<h3 class="has-icon">
<?php esc_html_e('Template missing','loco-translate')?>
</h3><?php
if( $params->has('pot') ):?>
<p>
<?php esc_html_e("This bundle's template file doesn't exist yet. We recommend you create it before adding languages",'loco-translate')?>.
</p><?php
else:?>
<p>
<?php esc_html_e("This bundle doesn't define a translations template file",'loco-translate')?>.
</p><?php
endif?>
<p>
<a href="<?php $ext->e('link')?>" class="button button-link has-icon icon-add"><?php $ext->e('text')?></a>
<a href="<?php $skip->e('link')?>" class="button button-link has-icon icon-next"><?php $skip->e('text')?></a><?php
if( $this->has('conf') ):?>
<a href="<?php $conf->e('link')?>" class="button button-link has-icon icon-wrench"><?php $conf->e('text')?></a><?php endif?>
<a class="button button-link has-icon icon-help" href="<?php echo esc_url($help)?>" target="_blank"><?php esc_html_e('About templates','loco-translate')?></a>
</p>
</div>

View File

@@ -0,0 +1,62 @@
<?php
/**
* Generic upload template for installing a file into a translation set.
*/
$this->extend('../layout');
/* @var Loco_Locale $locale */
?>
<form action="" method="post" enctype="multipart/form-data" id="loco-main"><?php
/* @var Loco_mvc_HiddenFields $hidden */
$hidden->_e();?>
<div class="panel">
<h2>
<?php self::e( __('Choose a location','loco-translate') );?>
</h2>
<table class="form-table">
<tbody class="loco-paths"><?php
/* @var Loco_mvc_ViewParams[] $locations */
foreach( $locations as $typeId => $location ):?>
<tr class="compact">
<td>
<p class="description"><?php $location->e('label')?>:</p>
</td>
<td><?php
/* @var Loco_mvc_ViewParams $choice */
/* @var Loco_mvc_FileParams $parent */
foreach( $location['paths'] as $choice ):
$parent = $choice['parent'];?>
<p>
<label>
<input type="radio" name="dir" value="<?php $parent->e('relpath')?>" />
<code class="path"><?php $parent->e('relpath')?>/<?php echo $choice->holder?></code>
</label>
</p><?php
endforeach?>
</td>
</tr><?php
endforeach?>
</tbody>
</table>
</div>
<div class="panel panel-info">
<h2>
<?php esc_html_e('Upload PO file','loco-translate')?>
</h2>
<p><?php
// translators: This is HTML formatted. (1) placeholder for language code, (2) Example language code
echo wp_kses (
sprintf( __('Your file must be named as shown above where %1$s is the language code, e.g. %2$s','loco-translate'), '<code>{locale}</code>', '<code>'.$locale.'</code>' ),
['code'=>[]]
)?>
</p>
<p>
<input type="file" name="f" />
</p>
<p class="submit">
<button type="submit" class="button button-large button-primary has-icon icon-upload" disabled><?php esc_html_e('Upload','loco-translate')?></button>
</p>
</div>
</form>