/var/www/html_sp/wp-content/plugins/loco-translate/tpl/admin/init/init-po.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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>