<commit_before><?php
/**
 * Tatoeba Project, free collaborative creation of multilingual corpuses project
 * Copyright (C) 2009  <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * PHP version 5
 *
 * @category PHP
 * @package  Tatoeba
 * @author   <NAME> <<EMAIL>>
 * @license  Affero General Public License
 * @link     http://tatoeba.org
 */

$this->set('title_for_layout', $pages->formatTitle(__('Add sentences', true)));

echo $javascript->link(JS_PATH . 'sentences.contribute.js', true);
?>

<div id="annexe_content">
    <div class="module">
    <h2><?php __('Important'); ?></h2>
    <ol>
    <li>
    <?php
    __(
        'Please do not forget <strong>capital letters</strong> '.
        'and <strong>punctuation</strong>! Thank you.'
    );
    ?>
    </li>
    <li>
    <?php
    echo format(
        __(
            'Do not copy-paste sentences from elsewhere, '.
            'except if the content is CC-BY compatible. '.
            '<a href="{}">Learn more...</a>', true
        ),
        'http://blog.tatoeba.org/2011/01/legally-valid-content.html'
    );
    ?>
    </li>
    </ol>
    </div>
    
    <div class="module">
    <h2><?php __('Tips'); ?></h2>
    <ol>
        <li>
        <?php
        __(
            "You can add sentences that you do not know how to translate. ".
            "Perhaps someone else will know!"
        );
        ?>
        </li>
        <li>
        <?php
        echo format(
            __(
                'Or create sentences with '.
                '<a href="{}">words not yet in Tatoeba</a>.', true
            ), 'http://a4esl.com/temporary/tatoeba/notyet/'
        );
        ?>
        </li>
    </ol>
    </div>
</div>

<div id="main_content">
    
    <div class="module">
        <h2><?php __('Add new sentences'); ?></h2>
        <div class="sentences_set">
            <div class="new">
            <?php
            $langArray = $this->Languages->profileLanguagesArray(true, false, false);
            $currentUserLanguages = CurrentUser::getProfileLanguages();
            if (empty($currentUserLanguages)) {

                $this->Languages->displayAddLanguageMessage(true);

            } else {
                echo $form->input(
                    'text',
                    array(
                        "label" => __('Sentence: ', true),
                        "id" => "SentenceText",
                        "lang" => "",
                        "dir" => "auto",
                    )
                );

                $preSelectedLang = $session->read('contribute_lang');

                if (!array_key_exists($preSelectedLang, $langArray)) {
                    $preSelectedLang = key($langArray);
                }
                ?>

                <div class="languageSelection">
                    <?php
                    echo $form->select(
                        'contributionLang',
                        $langArray,
                        $preSelectedLang,
                        array(
                            "class" => "language-selector",
                            "empty" => false
                        ),
                        false
                    );
                    ?>
                </div>

                <?php
                echo $form->button(
                    __('OK', true),
                    array("id" => "submitNewSentence")
                );

            }
            ?>
            </div>
        </div>
    </div>
    
    <div class="module">
        <h2><?php __('Sentences added'); ?></h2>
        
        <div class="sentencesAddedloading" style="display:none">
        <?php echo $html->image('loading.svg'); ?>
        </div>
        
        <div id="sentencesAdded">
        <?php
        if (isset($sentence)) {
            $translation = array();            
            $sentences->displaySentencesGroup(
                $sentence['Sentence'],
                $translation,
                $sentence['User']
            );
        }
        ?>
        </div>
    </div>
</div><commit_msg>Fixed size of loading icon in sentences/add.<commit_after><?php
/**
 * Tatoeba Project, free collaborative creation of multilingual corpuses project
 * Copyright (C) 2009  <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * PHP version 5
 *
 * @category PHP
 * @package  Tatoeba
 * @author   <NAME> <<EMAIL>>
 * @license  Affero General Public License
 * @link     http://tatoeba.org
 */

$this->set('title_for_layout', $pages->formatTitle(__('Add sentences', true)));

echo $javascript->link(JS_PATH . 'sentences.contribute.js', true);
?>

<div id="annexe_content">
    <div class="module">
    <h2><?php __('Important'); ?></h2>
    <ol>
    <li>
    <?php
    __(
        'Please do not forget <strong>capital letters</strong> '.
        'and <strong>punctuation</strong>! Thank you.'
    );
    ?>
    </li>
    <li>
    <?php
    echo format(
        __(
            'Do not copy-paste sentences from elsewhere, '.
            'except if the content is CC-BY compatible. '.
            '<a href="{}">Learn more...</a>', true
        ),
        'http://blog.tatoeba.org/2011/01/legally-valid-content.html'
    );
    ?>
    </li>
    </ol>
    </div>
    
    <div class="module">
    <h2><?php __('Tips'); ?></h2>
    <ol>
        <li>
        <?php
        __(
            "You can add sentences that you do not know how to translate. ".
            "Perhaps someone else will know!"
        );
        ?>
        </li>
        <li>
        <?php
        echo format(
            __(
                'Or create sentences with '.
                '<a href="{}">words not yet in Tatoeba</a>.', true
            ), 'http://a4esl.com/temporary/tatoeba/notyet/'
        );
        ?>
        </li>
    </ol>
    </div>
</div>

<div id="main_content">
    
    <div class="module">
        <h2><?php __('Add new sentences'); ?></h2>
        <div class="sentences_set">
            <div class="new">
            <?php
            $langArray = $this->Languages->profileLanguagesArray(true, false, false);
            $currentUserLanguages = CurrentUser::getProfileLanguages();
            if (empty($currentUserLanguages)) {

                $this->Languages->displayAddLanguageMessage(true);

            } else {
                echo $form->input(
                    'text',
                    array(
                        "label" => __('Sentence: ', true),
                        "id" => "SentenceText",
                        "lang" => "",
                        "dir" => "auto",
                    )
                );

                $preSelectedLang = $session->read('contribute_lang');

                if (!array_key_exists($preSelectedLang, $langArray)) {
                    $preSelectedLang = key($langArray);
                }
                ?>

                <div class="languageSelection">
                    <?php
                    echo $form->select(
                        'contributionLang',
                        $langArray,
                        $preSelectedLang,
                        array(
                            "class" => "language-selector",
                            "empty" => false
                        ),
                        false
                    );
                    ?>
                </div>

                <?php
                echo $form->button(
                    __('OK', true),
                    array("id" => "submitNewSentence")
                );

            }
            ?>
            </div>
        </div>
    </div>
    
    <div class="module">
        <h2><?php __('Sentences added'); ?></h2>
        
        <div class="sentencesAddedloading" style="display:none">
        <?php echo $images->svgIcon(
            'loading',
            array(
                'width' => 50,
                'height' => 50,
                'class' => 'loading-icon'
            )
        ); ?>
        </div>
        
        <div id="sentencesAdded">
        <?php
        if (isset($sentence)) {
            $translation = array();            
            $sentences->displaySentencesGroup(
                $sentence['Sentence'],
                $translation,
                $sentence['User']
            );
        }
        ?>
        </div>
    </div>
</div>
{'fraction_non_alphanumeric': 0.13335421888053467, 'fraction_numerical': 0.004803675856307435, 'mean_word_length': 1.411127895266868, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4091955', 'n_tokens_mistral': 2652, 'n_tokens_neox': 2522, 'n_words': 671}