summaryrefslogtreecommitdiff
path: root/modules/gallery/views/l10n_client.html.php
blob: c0cbbfa2770f7c22aa7c726618c23df87f7c58e2 (plain)
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
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="l10n-client" class="hidden">
  <div class="labels">
    <span id="l10n-client-toggler">X</span>
    <div class="label strings"><h2><?= t("Page Text") ?>
    <? if (!Input::instance()->get('show_all_l10n_messages')): ?>
      <a style="background-color:#fff" href="<?= url::site("admin/languages?show_all_l10n_messages=1") ?>"><?= t("(Show All)") ?></a>
    <? endif; ?>
    </h2></div>
    <div class="label source"><h2><?= t("Source") ?></div>
    <div class="label translation"><h2><?= t("Translation to %language",
                                             array("language" => locale::display_name())) ?></h2></div>
  </div>
  <div id="l10n-client-string-select">
    <ul class="string-list">
      <? foreach ($string_list as $string): ?>
      <li class="<?= $string["translation"] === ""  ? "untranslated" : "translated" ?>">
        <? if (is_array($string["source"])): ?>
       [one] - <?= $string["source"]["one"] ?><br/>
       [other] - <?= $string["source"]["other"] ?>
        <? else: ?>
        <?= $string["source"] ?>
        <? endif; ?>
      </li>
      <? endforeach; ?>
    </ul>

    <?= $l10n_search_form ?>
  </div>
  <div id="l10n-client-string-editor">
    <div class="source">
      <p class="source-text"></p>
      <p id="source-text-tmp-space" style="display:none"></p>
    </div>
    <div class="translation">
      <form method="post" action="<?= url::site("l10n_client/save") ?>" id="gL10nClientSaveForm">
        <?= access::csrf_form_field() ?>
        <?= form::hidden("l10n-message-key") ?>
        <?= form::textarea("l10n-edit-translation", "", ' rows="5" class="translationField"') ?>
        <div id="plural-zero" class="translationField hidden">
          <label for="l10n-edit-plural-translation-zero">[zero]</label>
          <?= form::textarea("l10n-edit-plural-translation-zero", "", ' rows="2"') ?>
        </div>
        <div id="plural-one" class="translationField hidden">
          <label for="l10n-edit-plural-translation-one">[one]</label>
          <?= form::textarea("l10n-edit-plural-translation-one", "", ' rows="2"') ?>
        </div>
        <div id="plural-two" class="translationField hidden">
          <label for="l10n-edit-plural-translation-two">[two]</label>
          <?= form::textarea("l10n-edit-plural-translation-two", "", ' rows="2"') ?>
        </div>
        <div id="plural-few" class="translationField hidden">
          <label for="l10n-edit-plural-translation-few">[few]</label>
          <?= form::textarea("l10n-edit-plural-translation-few", "", ' rows="2"') ?>
        </div>
        <div id="plural-many" class="translationField hidden">
          <label for="l10n-edit-plural-translation-many">[many]</label>
          <?= form::textarea("l10n-edit-plural-translation-many", "", ' rows="2"') ?>
        </div>
        <div id="plural-other" class="translationField hidden">
          <label for="l10n-edit-plural-translation-other">[other]</label>
          (<a href="http://www.unicode.org/cldr/data/charts/supplemental/language_plural_rules.html"><?= t("learn more about plural forms") ?></a>)
          <?= form::textarea("l10n-edit-plural-translation-other", "", ' rows="2"') ?>
        </div>
        <input type="submit" name="l10n-edit-save" value="<?= t("Save translation") ?>"/>
        <a href="javascript: Gallery.l10nClient.copySourceText()"
           class="gButtonLink ui-state-default ui-corner-all"><?= t("Copy source text") ?></a>
      </form>
    </div>
  </div>
  <script type="text/javascript">
    var MSG_TRANSLATE_TEXT = "<?= t("Translate Text") ?>";
    var MSG_CLOSE_X = "<?= t("X") ?>";
    var l10n_client_data = <?= json_encode($string_list) ?>;
    var plural_forms = <?= json_encode($plural_forms) ?>;
  </script>
</div>