diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-02-09 07:29:24 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-02-09 07:29:24 +0000 |
commit | fa1f49d99a30a029d1a4e09b820c639d639f6283 (patch) | |
tree | 3e4d10b152456f0d5f1a944c66affa3cd94e4b09 /core/views | |
parent | af944f94334139d6b49b9344795652510a62bae0 (diff) |
Adding translation UI. Not backed by any model yet (submissions are ignored).
The code is based on the l10n_client module from Drupal 6, by Gabor Hojtsy (http://drupal.org/user/4166).
Diffstat (limited to 'core/views')
-rw-r--r-- | core/views/l10n_client.html.php | 30 | ||||
-rw-r--r-- | core/views/scaffold.html.php | 7 |
2 files changed, 37 insertions, 0 deletions
diff --git a/core/views/l10n_client.html.php b/core/views/l10n_client.html.php new file mode 100644 index 00000000..7c09df7b --- /dev/null +++ b/core/views/l10n_client.html.php @@ -0,0 +1,30 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> + +<div id='l10n-client' class='hidden'> + <div class='labels'> + <span class='toggle'><?= t('Translate Text') ?></span> + <div class='label strings'><h2><?= t('Page Text') ?></h2></div> + <div class='label source'><h2><?= t('Source') ?></div> + <div class='label translation'><h2><?= t('Translation to %language', + array('%language' => 'TODO')) ?></h2></div> + </div> + <div id='l10n-client-string-select'> + <ul class='string-list'> + <? foreach ($string_list as $string): ?> + <li class='<?= $string["translation"] === '' ? "untranslated" : "translated" ?>'><?= $string["source"] ?></li> + <? endforeach; ?> + </ul> + <?= $l10n_search_form ?> + </div> + <div id='l10n-client-string-editor'> + <div class='source'> + <div class='source-text'></div> + </div> + <div class='translation'> + <?= $l10n_form ?> + </div> + </div> + <script type="text/javascript"> + var l10n_client_data = <?= json_encode($string_list) ?>; + </script> +</div> diff --git a/core/views/scaffold.html.php b/core/views/scaffold.html.php index 2dd256c2..b54e6cd2 100644 --- a/core/views/scaffold.html.php +++ b/core/views/scaffold.html.php @@ -440,6 +440,13 @@ <?= html::anchor("scaffold/session/debug?value=1", "on") ?> <b>off</b> <? endif ?> </li> + <li> Translation Mode: + <? if (Session::instance()->get("l10n_mode", false)): ?> + <b>on</b> <?= html::anchor("scaffold/session/l10n_mode?value=0", "off") ?> + <? else: ?> + <?= html::anchor("scaffold/session/l10n_mode?value=1", "on") ?> <b>off</b> + <? endif ?> + </li> </ul> </div> |