1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # This file is part of translater, a plugin for Dotclear 2. |
---|
4 | # |
---|
5 | # Copyright (c) 2009 JC Denis and contributors |
---|
6 | # jcdenis@gdwd.com |
---|
7 | # |
---|
8 | # Licensed under the GPL version 2.0 license. |
---|
9 | # A copy of this license is available in LICENSE file or at |
---|
10 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
11 | # -- END LICENSE BLOCK ------------------------------------ |
---|
12 | |
---|
13 | if (!defined('DC_CONTEXT_ADMIN')){return;} |
---|
14 | |
---|
15 | $new_version = $core->plugins->moduleInfo('translater','version'); |
---|
16 | $old_version = $core->getVersion('translater'); |
---|
17 | |
---|
18 | if (version_compare($old_version,$new_version,'>=')) return; |
---|
19 | |
---|
20 | try |
---|
21 | { |
---|
22 | if (!version_compare(DC_VERSION,'2.1.5','>=')) { |
---|
23 | |
---|
24 | throw new Exception('translater plugin requires Dotclear 2.1.5'); |
---|
25 | } |
---|
26 | $s =& $core->blog->settings; |
---|
27 | |
---|
28 | $s->setNameSpace('translater'); |
---|
29 | $s->put('translater_light_face',0,'boolean','Use easy and light interface',false,true); |
---|
30 | $s->put('translater_two_cols',0,'boolean','Use two columns in admin options',false,true); |
---|
31 | $s->put('translater_plugin_menu',0,'boolean','Put an link in plugins page',false,true); |
---|
32 | $s->put('translater_theme_menu',0,'boolean','Put a link in themes page',false,true); |
---|
33 | $s->put('translater_backup_auto',1,'boolean','Make a backup of languages old files when there are modified',false,true); |
---|
34 | $s->put('translater_backup_limit',20,'string','Maximum backups per module',false,true); |
---|
35 | $s->put('translater_backup_folder','module','string','In which folder to store backups',false,true); |
---|
36 | $s->put('translater_write_po',1,'boolean','Write .po languages files',false,true); |
---|
37 | $s->put('translater_write_langphp',1,'boolean','Write .lang.php languages files',false,true); |
---|
38 | $s->put('translater_scan_tpl',0,'boolean','Translate strings of templates files',false,true); |
---|
39 | $s->put('translater_parse_nodc',1,'boolean','Translate only untranslated strings of Dotclear',false,true); |
---|
40 | $s->put('translater_parse_comment',1,'boolean','Write comments and strings informations in lang files',false,true); |
---|
41 | $s->put('translater_parse_user',1,'boolean','Write inforamtions about author in lang files',false,true); |
---|
42 | $s->put('translater_parse_userinfo','displayname, email','string','Type of informations about user to write',false,true); |
---|
43 | $s->put('translater_import_overwrite',0,'boolean','Overwrite existing languages when import packages',false,true); |
---|
44 | $s->put('translater_export_filename','type-module-l10n-timestamp','string','Name of files of exported package',false,true); |
---|
45 | $s->put('translater_proposal_tool','google','string','Id of default tool for proposed translation',false,true); |
---|
46 | $s->put('translater_proposal_lang','en','string','Default source language for proposed translation',false,true); |
---|
47 | $s->setNameSpace('system'); |
---|
48 | |
---|
49 | $core->setVersion('translater',$core->plugins->moduleInfo('translater','version')); |
---|
50 | |
---|
51 | return true; |
---|
52 | } |
---|
53 | catch (Exception $e) |
---|
54 | { |
---|
55 | $core->error->add($e->getMessage()); |
---|
56 | } |
---|
57 | return false; |
---|
58 | ?> |
---|