/admin-dev/themes/default/template/controllers/translations/helpers/view/main.tpl

https://bitbucket.org/marcenuc/prestashop · Smarty Template · 205 lines · 170 code · 10 blank · 25 comment · 11 complexity · 6a6b3c1143cff0d466eebc9a800775c5 MD5 · raw file

  1. {*
  2. * 2007-2012 PrestaShop
  3. *
  4. * NOTICE OF LICENSE
  5. *
  6. * This source file is subject to the Academic Free License (AFL 3.0)
  7. * that is bundled with this package in the file LICENSE.txt.
  8. * It is also available through the world-wide-web at this URL:
  9. * http://opensource.org/licenses/afl-3.0.php
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@prestashop.com so we can send you a copy immediately.
  13. *
  14. * DISCLAIMER
  15. *
  16. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  17. * versions in the future. If you wish to customize PrestaShop for your
  18. * needs please refer to http://www.prestashop.com for more information.
  19. *
  20. * @author PrestaShop SA <contact@prestashop.com>
  21. * @copyright 2007-2012 PrestaShop SA
  22. * @version Release: $Revision$
  23. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  24. * International Registered Trademark & Property of PrestaShop SA
  25. *}
  26. {extends file="helpers/view/view.tpl"}
  27. {block name="override_tpl"}
  28. <script type="text/javascript">
  29. function chooseTypeTranslation(id_lang)
  30. {
  31. getE('translation_lang').value = id_lang;
  32. document.getElementById('typeTranslationForm').submit();
  33. }
  34. function addThemeSelect(el)
  35. {
  36. var list_type_for_theme = [{foreach $translations_type_for_theme as $type}'{$type}', {/foreach}];
  37. var type = el.value;
  38. $('select[name=theme]').hide();
  39. for (i=0; i < list_type_for_theme.length; i++)
  40. if (list_type_for_theme[i] == type)
  41. $('select[name=theme]').show();
  42. else
  43. $('select[name=theme]').val('{$theme_default}');
  44. }
  45. $(document).ready(function(){
  46. $('select[name=type]').change(function() {
  47. addThemeSelect(this);
  48. });
  49. });
  50. </script>
  51. <fieldset>
  52. <legend><img src="../img/admin/translation.gif" />{l s='Modify translations'}</legend>
  53. {l s='Here you can modify translations for all text input in PrestaShop.'}<br />
  54. {l s='First, select a section (such as Back Office or Modules), then click the flag representing the language you want to edit.'}<br /><br />
  55. <form method="get" action="index.php" id="typeTranslationForm">
  56. <input type="hidden" name="controller" value="AdminTranslations" />
  57. <input type="hidden" name="lang" id="translation_lang" value="0" />
  58. <select name="type" style="float:left; margin-right:10px;">
  59. {foreach $translations_type as $type => $array}
  60. <option value="{$type}">{$array.name} &nbsp;</option>
  61. {/foreach}
  62. </select>
  63. <select name="theme" style="float:left; margin-right:10px;">
  64. {foreach $themes as $theme}
  65. <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name} &nbsp;</option>
  66. {/foreach}
  67. </select>
  68. {foreach $languages as $language}
  69. <a href="javascript:chooseTypeTranslation('{$language['iso_code']}');">
  70. <img src="{$theme_lang_dir}{$language['id_lang']}.jpg" alt="{$language['iso_code']}" title="{$language['iso_code']}" />
  71. </a>
  72. {/foreach}
  73. <input type="hidden" name="token" value="{$token}" />
  74. </form>
  75. </fieldset>
  76. <br /><h2>{l s='Translation exchange'}</h2>
  77. <form action="{$url_submit}" method="post" enctype="multipart/form-data">
  78. <fieldset>
  79. <legend>
  80. <img src="../img/admin/import.gif" />{l s='Add / Update a language'}
  81. </legend>
  82. <div id="submitAddLangContent" style="float:left;">
  83. <p>{l s='You can add or update a language directly from prestashop.com here'}</p>
  84. <div class="warn">
  85. {l s='If you choose to update an existing language pack, all your previous customization in the theme named "Default" will be lost. This includes Front Office expressions and default e-mail templates.'}
  86. </div>
  87. {if $packs_to_update || $packs_to_install}
  88. <div style="font-weight:bold; float:left;">{l s='Language you want to add or update:'}
  89. <select id="params_import_language" name="params_import_language">
  90. <optgroup label="{l s='Update a language'}">
  91. {foreach $packs_to_update as $lang_pack}
  92. <option value="{$lang_pack['iso_code']}|{$lang_pack['version']}">{$lang_pack['name']}</option>
  93. {/foreach}
  94. </optgroup>
  95. <optgroup label="{l s='Add a language'}">
  96. {foreach $packs_to_install as $lang_pack}
  97. <option value="{$lang_pack['iso_code']}|{$lang_pack['version']}">{$lang_pack['name']}</option>
  98. {/foreach}
  99. </optgroup>
  100. </select> &nbsp;
  101. <input type="submit" value="{l s='Add or update a language'}" name="submitAddLanguage" class="button" />
  102. </div>
  103. {else}
  104. <br /><br /><p class="error">{l s='Cannot connect to prestashop.com to get language list.'}</p></div>
  105. {/if}
  106. </div>
  107. </fieldset>
  108. </form><br /><br />
  109. <form action="{$url_submit}" method="post" enctype="multipart/form-data">
  110. <fieldset>
  111. <legend>
  112. <img src="../img/admin/import.gif" />{l s='Import a language pack manually'}
  113. </legend>
  114. <div id="submitImportContent">
  115. <p>
  116. {l s='If the name format is: isocode.gzip (e.g. us.gzip) and the language corresponding to this package does not exist, it will automatically be created.'}
  117. {l s='Be careful, as this will replace all existing data for the destination language!'}
  118. </p>
  119. <p><label for="importLanguage">{l s='Language pack to import:'}</label><input type="file" name="file" id="importLanguage"/>&nbsp;</p>
  120. <p>
  121. <label for="selectThemeForImport">{l s='Select your theme:'}</label>
  122. <select name="theme[]" id="selectThemeForImport" {if count($themes) > 1}multiple="multiple"{/if} >
  123. {foreach $themes as $theme}
  124. <option value="{$theme->directory}" selected="selected">{$theme->name} &nbsp;</option>
  125. {/foreach}
  126. </select>
  127. </p>
  128. <p class="margin-form"><input type="submit" value="{l s='Import'}" name="submitImport" class="button" /></p>
  129. </div>
  130. </fieldset>
  131. </form>
  132. <br /><br />
  133. <form action="{$url_submit}" method="post" enctype="multipart/form-data">
  134. <fieldset>
  135. <legend><img src="../img/admin/export.gif" />{l s='Export a language'}</legend>
  136. <p>{l s='Export data from one language to a file (language pack).'}<br />
  137. {l s='Choose the theme from which you want to export translations.'}<br />
  138. <select name="iso_code" style="margin-top:10px;">
  139. {foreach $languages as $language}
  140. <option value="{$language['iso_code']}">{$language['name']}</option>
  141. {/foreach}
  142. </select>
  143. &nbsp;&nbsp;&nbsp;
  144. <select name="theme" style="margin-top:10px;">
  145. {foreach $themes as $theme}
  146. <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
  147. {/foreach}
  148. </select>&nbsp;&nbsp;
  149. <input type="submit" class="button" name="submitExport" value="{l s='Export'}" />
  150. </fieldset>
  151. </form>
  152. <br /><br />
  153. <form action="{$url_submit}" method="post">
  154. <fieldset>
  155. <legend><img src="../img/admin/copy_files.gif" />{l s='Copy'}</legend>
  156. <p>{l s='Copies data from one language to another.'}<br />
  157. {l s='Be careful, as this will replace all existing data for the destination language!'}<br />
  158. {l s='If necessary'}, <b><a href="{$url_create_language}">{l s='first create a new language'}</a></b>.</p>
  159. <div style="float:left;">
  160. <p>
  161. <div style="width:75px; font-weight:bold; float:left;">{l s='From:'}</div>
  162. <select name="fromLang">
  163. {foreach $languages as $language}
  164. <option value="{$language['iso_code']}">{$language['name']}</option>
  165. {/foreach}
  166. </select>
  167. &nbsp;&nbsp;&nbsp;
  168. <select name="fromTheme">
  169. {foreach $themes as $theme}
  170. <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
  171. {/foreach}
  172. </select> <span style="font-style: bold; color: red;">*</span>
  173. </p>
  174. <p>
  175. <div style="width:75px; font-weight:bold; float:left;">{l s='To:'}</div>
  176. <select name="toLang">
  177. {foreach $languages as $language}
  178. <option value="{$language['iso_code']}">{$language['name']}</option>
  179. {/foreach}
  180. </select>
  181. &nbsp;&nbsp;&nbsp;
  182. <select name="toTheme">
  183. {foreach $themes as $theme}
  184. <option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
  185. {/foreach}
  186. </select>
  187. </p>
  188. </div>
  189. <div style="float:left;">
  190. <input type="submit" value="{l s=' Copy '}" name="submitCopyLang" class="button" style="margin:25px 0px 0px 25px;" />
  191. </div>
  192. <p style="clear: left; padding: 16px 0px 0px 0px;"><span style="font-style: bold; color: red;">*</span> {l s='Language files must be complete to allow copying of translations'}</p>
  193. </fieldset>
  194. </form>
  195. {/block}