clean up and release

This commit is contained in:
Jean-Christian Denis 2021-09-02 23:44:01 +02:00
parent d5ba4e1298
commit 6277dbc7ce
18 changed files with 483 additions and 429 deletions

View file

@ -1,109 +1,115 @@
x.x xxxxxxxx 2021.09.02.1 - dev
- help translation - [ ] help translation
- source translation - [ ] source translation
- [ ] fix constante for official modules
- [ ] fix third-party API (all are broken)
- [ ] add dashboard icon
2021.09.02
- clean up code and fix typo
2021.08.18 2021.08.18
* Fixed PSR-2 Coding Style - Fixed PSR-2 Coding Style
* Move settings to _config file - Move settings to config file
2018.10.26 - Pierre Van Glabeke 2018.10.26 - Pierre Van Glabeke
* Bug avec php 7.2 (https://forum.dotclear.org/viewtopic.php?pid=342810#p342810) - Bug avec php 7.2 (https://forum.dotclear.org/viewtopic.php?pid=342810#p342810)
2018.10.18 - Pierre Van Glabeke 2018.10.18 - Pierre Van Glabeke
* Modifs localisation - Modifs localisation
2018.02.14 - Pierre Van Glabeke 2018.02.14 - Pierre Van Glabeke
* Suppression ?> en fin de lang.php - Suppression ?> en fin de lang.php
2017.05.10 - Pierre Van Glabeke 2017.05.10 - Pierre Van Glabeke
* Suppression ligne 614 de "continue" dans \inc\class.dc.translater.php - Suppression ligne 614 de "continue" dans \inc\class.dc.translater.php
2016.08.20 - Pierre Van Glabeke 2016.08.20 - Pierre Van Glabeke
* Ajout Pluriel dans po - Ajout Pluriel dans po
* Ajout favori - Ajout favori
2016.07.08 - Pierre Van Glabeke 2016.07.08 - Pierre Van Glabeke
* Modifs localisation - Modifs localisation
2013.05.11 2013.05.11
* Rewrited proposal tools - Rewrited proposal tools
* Added Microsoft translation tool - Added Microsoft translation tool
* Updated Google translation tool - Updated Google translation tool
* Removed permissions, now required superadmin - Removed permissions, now required superadmin
* Fixed page title and messages and contents - Fixed page title and messages and contents
* Moved all sub-pages into one page - Moved all sub-pages into one page
1.5 20100901 1.5 - 2010.09.01
* Added option to set defaut tab (closes #552) - Added option to set defaut tab (closes #552)
* Fixed occurrences count (closes #551) - Fixed occurrences count (closes #551)
* Fixed regxep (closes #550) - Fixed regxep (closes #550)
* Cleaned design (thanks to osku) - Cleaned design (thanks to osku)
1.4.2 20100901 1.4.2 - 2010.09.01
* Tried to fix crash with regexp on parsing .po file - Tried to fix crash with regexp on parsing .po file
1.4.1 20100626 1.4.1 - 2010.06.26
* Fixed crash on .po files - Fixed crash on .po files
* Fixed toggle function - Fixed toggle function
* Fixed admin crash on non 2.2 - Fixed admin crash on non 2.2
* Fixed minor bugs - Fixed minor bugs
* Added option to hide default modules of Dotclear - Added option to hide default modules of Dotclear
1.4 20100605 1.4 - 2010.06.05
* Switched to DC 2.2 - Switched to DC 2.2
* Added toogle list of existing translation - Added toogle list of existing translation
* Fixed google translate (now uses Google ajax API) - Fixed google translate (now uses Google ajax API)
* Removed "simple mode" - Removed "simple mode"
* Changed admin interface (easy, light, fast) - Changed admin interface (easy, light, fast)
1.3 20091025 1.3 - 2009.10.25
* Added babelfish help - Added babelfish help
* Added behaviors on files writing - Added behaviors on files writing
* Fixed regexp again - Fixed regexp again
* Changed priority to .po files instead of .lang.php files - Changed priority to .po files instead of .lang.php files
1.2 20091010 1.2 - 2009.10.10
* Added direct text copy and paste - Added direct text copy and paste
* Added grouping file change - Added grouping file change
* Fixed some typo - Fixed some typo
1.1 20091002 1.1 - 2009.10.02
* Added the proposed translation - Added the proposed translation
* Rewrited settings system - Rewrited settings system
* Speed up expert mode - Speed up expert mode
1.0 20090928 1.0 - 2009.09.28
* Added translation of template files. closes #250 - Added translation of template files. closes #250
0.9 20090923 0.9 - 2009.09.23
* Fixed bug on translate escape string - Fixed bug on translate escape string
* Added _uninstall.php support - Added _uninstall.php support
0.8 20090816 0.8 - 2009.08.16
* Fixed php 5.3 compatibility - Fixed php 5.3 compatibility
0.7 0.7
* Fixed some l10n - Fixed some l10n
* Fixed ''xhtml strict'' validation - Fixed ''xhtml strict'' validation
0.6 0.6
* Added ''author'' to langs files - Added ''author'' to langs files
* Added ''two-cols'' option - Added ''two-cols'' option
* Added ''sort option'' on array of translations - Added ''sort option'' on array of translations
* Fixed ''bugs'' with no theme - Fixed ''bugs'' with no theme
* Fixed ''bugs'' with folder perms - Fixed ''bugs'' with folder perms
* Fixed ''nothing to update" in simple mode - Fixed ''nothing to update" in simple mode
* Fixed ''bugs'' in Import/export - Fixed ''bugs'' in Import/export
* Fixed ''html >'' like DC changset 2385 - Fixed ''html >'' like DC changset 2385
* Fixed ''xhtml strict'' validation - Fixed ''xhtml strict'' validation
0.5 0.5
* Fixed ''admin url'' - Fixed ''admin url''
* Added user perm check - Added user perm check
* Fixed ''bugs'' with bad strings (close #166) - Fixed ''bugs'' with bad strings (close #166)
0.4 0.4
* Changed default tab to plugin - Changed default tab to plugin
* Replaced list of modules in select box rather than in help - Replaced list of modules in select box rather than in help
* Fixed wrong message when nothing to export - Fixed wrong message when nothing to export
* Added help in helpBlock - Added help in helpBlock

38
README.md Normal file
View file

@ -0,0 +1,38 @@
# README
## WHAT IS TRANSLATER ?
_translater_ is a plugins for the open-source
web publishing software called Dotclear.
It helps dev to translate plugin and theme.
## REQUIREMENTS
_translater_ requires:
* administrator permissions
* Dotclear 2.19
* Custom templates if default theme is not used.
## USAGE
First install _translater_, mannualy from a zip package or from
Dotaddict repository. (See Dotclear's documentation to know how do this)
Go to ''plugins manager'', expand _translater_ information then
go to ''configure plugin'', fill in form.
Once it's done you can manage your plugins and themes languages from menu
''Translater'' on sidebar menu.
## MORE
* License : GNU GPL v2
* Source & contribution : [GitHub Page](https://github.com/JcDenis/saba)
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/saba)
## CONTRIBUTORS
* Jean-Chritian Denis
* Pierre Van Glabeke

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;
@ -39,7 +39,7 @@ class translaterAdminBehaviors
if (!$core->blog->settings->translater->translater_plugin_menu || !$core->auth->isSuperAdmin()) { if (!$core->blog->settings->translater->translater_plugin_menu || !$core->auth->isSuperAdmin()) {
return; return;
} }
echo echo
'<div class="multi-part" id="translater" title="' . '<div class="multi-part" id="translater" title="' .
__('Translate plugins') . __('Translate plugins') .
@ -51,9 +51,9 @@ class translaterAdminBehaviors
'<th class="nowrap">' . __('Details') . '</th>' . '<th class="nowrap">' . __('Details') . '</th>' .
'<th class="nowrap">' . __('Author') . '</th>' . '<th class="nowrap">' . __('Author') . '</th>' .
'</tr>'; '</tr>';
$modules = $core->plugins->getModules(); $modules = $core->plugins->getModules();
foreach ($modules as $name => $plugin) { foreach ($modules as $name => $plugin) {
echo echo
'<tr class="line">' . '<tr class="line">' .
@ -69,35 +69,35 @@ class translaterAdminBehaviors
echo echo
'</table></div>'; '</table></div>';
} }
# Themes menu # Themes menu
public static function adminCurrentThemeDetails($core, $id, $infos) public static function adminCurrentThemeDetails($core, $id, $infos)
{ {
if (!$core->blog->settings->translater->translater_theme_menu || !$core->auth->isSuperAdmin()) { if (!$core->blog->settings->translater->translater_theme_menu || !$core->auth->isSuperAdmin()) {
return; return;
} }
$root = path::real($infos['root']); $root = path::real($infos['root']);
if ($id != 'default' && is_dir($root.'/locales')) { if ($id != 'default' && is_dir($root.'/locales')) {
return return
'<p><a href="plugin.php?p=translater&amp;part=module&amp;type=theme&amp;module=' . $id . '"' . '<p><a href="plugin.php?p=translater&amp;part=module&amp;type=theme&amp;module=' . $id . '"' .
' class="button">' . __('Translate this theme') . '</a></p>'; ' class="button">' . __('Translate this theme') . '</a></p>';
} }
} }
# Google Translater tools # Google Translater tools
public static function addGoogleProposalTool($proposal) public static function addGoogleProposalTool($proposal)
{ {
$proposal->addTool('googleProposalTool'); $proposal->addTool('googleProposalTool');
} }
# Yahoo Babelfish tools # Yahoo Babelfish tools
public static function addYahooProposalTool($proposal) public static function addYahooProposalTool($proposal)
{ {
$proposal->addTool('yahooProposalTool'); $proposal->addTool('yahooProposalTool');
} }
# Microsoft Bing tools # Microsoft Bing tools
public static function addMicrosoftProposalTool($proposal) public static function addMicrosoftProposalTool($proposal)
{ {

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_MODULE')) { if (!defined('DC_CONTEXT_MODULE')) {
return null; return null;

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return; return;
@ -21,10 +21,11 @@ $this->registerModule(
'Jean-Christian Denis & contributors', 'Jean-Christian Denis & contributors',
'2021.08.18', '2021.08.18',
[ [
'requires' => [['core', '2.19']],
'permissions' => 'usage,contentadmin,admin', 'permissions' => 'usage,contentadmin,admin',
'type' => 'plugin', 'type' => 'plugin',
'dc_min' => '2.18',
'support' => 'http://forum.dotclear.org/viewtopic.php?id=39220', 'support' => 'http://forum.dotclear.org/viewtopic.php?id=39220',
'details' => 'https://plugins.dotaddict.org/dc2/details/translater' 'details' => 'https://plugins.dotaddict.org/dc2/details/translater',
'repository' => 'https://raw.githubusercontent.com/JcDenis/translater/master/dcstore.xml'
] ]
); );

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_RC_PATH')) { if (!defined('DC_RC_PATH')) {
return; return;

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;
@ -36,7 +36,6 @@ $this->addUserAction(
/* description */ __('delete the version number') /* description */ __('delete the version number')
); );
$this->addDirectAction( $this->addDirectAction(
/* type */ 'settings', /* type */ 'settings',
/* action */ 'delete_all', /* action */ 'delete_all',

11
dcstore.xml Normal file
View file

@ -0,0 +1,11 @@
<modules xmlns:da="http://dotaddict.org/da/">
<module id="translater">
<name>Traducteur</name>
<version>2021.08.18</version>
<author>Jean-Christian Denis &amp; contributors</author>
<desc>Translate your Dotclear plugins and themes</desc>
<file>https://github.com/JcDenis/translater/releases/download/v2021.08.18/plugin-translater.zip</file>
<da:details>https://plugins.dotaddict.org/dc2/details/translater</da:details>
<da:support>http://forum.dotclear.org/viewtopic.php?id=39220</da:support>
</module>
</modules>

File diff suppressed because it is too large Load diff

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
/** /**
* Translater proposal tools container. * Translater proposal tools container.

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;
@ -30,7 +30,7 @@ class microsoftProposalTool extends translaterProposalTool
$this->setActive(false); $this->setActive(false);
$this->client = $this->core->blog->settings->translater->translater_microsoft_proposal_client; $this->client = $this->core->blog->settings->translater->translater_microsoft_proposal_client;
$this->secret = $this->core->blog->settings->translater->translater_microsoft_proposal_secret; $this->secret = $this->core->blog->settings->translater->translater_microsoft_proposal_secret;
$this->setName(__('Bing')); $this->setName(__('Bing'));
$this->setDesc(__('Microsoft Bing translation tool')); $this->setDesc(__('Microsoft Bing translation tool'));
$this->setActive(!empty($this->client) && !empty($this->secret)); $this->setActive(!empty($this->client) && !empty($this->secret));
@ -61,7 +61,7 @@ class microsoftProposalTool extends translaterProposalTool
'' : $_POST['translater_microsoft_proposal_client']; '' : $_POST['translater_microsoft_proposal_client'];
$secret = empty($_POST['translater_microsoft_proposal_secret']) ? $secret = empty($_POST['translater_microsoft_proposal_secret']) ?
'' : $_POST['translater_microsoft_proposal_secret']; '' : $_POST['translater_microsoft_proposal_secret'];
$this->core->blog->settings->translater->put('translater_microsoft_proposal_client', $client, 'string', '', true, true); $this->core->blog->settings->translater->put('translater_microsoft_proposal_client', $client, 'string', '', true, true);
$this->core->blog->settings->translater->put('translater_microsoft_proposal_secret', $secret, 'string', '', true, true); $this->core->blog->settings->translater->put('translater_microsoft_proposal_secret', $secret, 'string', '', true, true);
} }

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
/** /**
* Translater proposal tool. * Translater proposal tool.
@ -35,7 +35,7 @@ abstract class translaterProposalTool
/** /**
Set name of this tool Set name of this tool
@param string Tool's name @param string Tool's name
*/ */
final protected function setName($name) final protected function setName($name)
@ -45,7 +45,7 @@ abstract class translaterProposalTool
/** /**
Get name of this tool Get name of this tool
@return string Tool's name @return string Tool's name
*/ */
final public function getName() final public function getName()
@ -55,7 +55,7 @@ abstract class translaterProposalTool
/** /**
Set description of this tool Set description of this tool
@param string Tool's description @param string Tool's description
*/ */
final protected function setDesc($desc) final protected function setDesc($desc)
@ -65,7 +65,7 @@ abstract class translaterProposalTool
/** /**
Get description of this tool Get description of this tool
@return string Tool's description @return string Tool's description
*/ */
final public function getDesc() final public function getDesc()
@ -75,7 +75,7 @@ abstract class translaterProposalTool
/** /**
Set tool as (un)active Set tool as (un)active
@param boolean $active True to set it as active @param boolean $active True to set it as active
*/ */
final protected function setActive($active) final protected function setActive($active)
@ -85,7 +85,7 @@ abstract class translaterProposalTool
/** /**
Check if this tool is active Check if this tool is active
@return boolean True if it is active @return boolean True if it is active
*/ */
final public function isActive() final public function isActive()
@ -100,7 +100,7 @@ abstract class translaterProposalTool
/** /**
Get configuration interface Get configuration interface
@return Form field @return Form field
*/ */
abstract public function form(); abstract public function form();
@ -112,7 +112,7 @@ abstract class translaterProposalTool
/** /**
Translate a string from a language to another Translate a string from a language to another
@param string $str Trimed UTF-8 string to translate @param string $str Trimed UTF-8 string to translate
@param string $from Source language code @param string $from Source language code
@param string to Destination language code @param string to Destination language code

View file

@ -1,15 +1,15 @@
<?php <?php
# -- BEGIN LICENSE BLOCK ---------------------------------- /**
# * @brief translater, a plugin for Dotclear 2
# This file is part of translater, a plugin for Dotclear 2. *
# * @package Dotclear
# Copyright (c) 2009-2021 Jean-Christian Denis and contributors * @subpackage Plugin
# *
# Licensed under the GPL version 2.0 license. * @author Jean-Christian Denis & contributors
# A copy of this license is available in LICENSE file or at *
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * @copyright Jean-Christian Denis
# * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------ */
if (!defined('DC_CONTEXT_ADMIN')) { if (!defined('DC_CONTEXT_ADMIN')) {
return; return;
@ -259,7 +259,7 @@ switch ($action) {
throw new Exception(__('Nothing to import')); throw new Exception(__('Nothing to import'));
} }
$translater->importPack($_POST['modules'], $_FILES['packfile']); $translater->importPack($_POST['modules'], $_FILES['packfile']);
http::redirect($p_url . '&part=pack&msg=' . $action . '&tab=pack-import'); http::redirect($p_url . '&part=pack&msg=' . $action . '&tab=pack-import');
} catch (Exception $e) { } catch (Exception $e) {
$core->error->add(sprintf($errors[$action], $e->getMessage())); $core->error->add(sprintf($errors[$action], $e->getMessage()));
@ -533,7 +533,7 @@ switch ($part) {
'<th>' . __('Backups') . '</th>' . '<th>' . __('Backups') . '</th>' .
'<th>' . __('Last backup') . '</th>' . '<th>' . __('Last backup') . '</th>' .
'</tr>'; '</tr>';
foreach($M->langs AS $lang => $name) { foreach($M->langs AS $lang => $name) {
echo echo
'<tr class="line">' . '<tr class="line">' .
@ -541,7 +541,7 @@ switch ($part) {
'<a href="' . $p_url . '&amp;part=lang&amp;type=' . $type . '&amp;module=' . $module . '&amp;lang=' . $lang . '">' . $name . '</a>' . '<a href="' . $p_url . '&amp;part=lang&amp;type=' . $type . '&amp;module=' . $module . '&amp;lang=' . $lang . '">' . $name . '</a>' .
'</td>' . '</td>' .
'<td class="nowrap"> ' . $lang . '</td>'; '<td class="nowrap"> ' . $lang . '</td>';
if (isset($M->backups[$lang])) { if (isset($M->backups[$lang])) {
foreach($M->backups[$lang] AS $file => $info) { foreach($M->backups[$lang] AS $file => $info) {
$time[$lang] = isset($time[$lang]) && $time[$lang] > $info['time'] ? $time[$lang] = isset($time[$lang]) && $time[$lang] > $info['time'] ?

View file

@ -15,7 +15,7 @@
$.fn.translater = function(options){ $.fn.translater = function(options){
var opts = $.extend({}, $.fn.translater.defaults, options); var opts = $.extend({}, $.fn.translater.defaults, options);
return this.each(function(){ return this.each(function(){
var img = '<img src="index.php?pf=translater/inc/img/field.png" alt="" />'; var img = '<img src="index.php?pf=translater/inc/img/field.png" alt="" />';
var tog = '<img src="index.php?pf=translater/inc/img/toggle.png" alt="" />'; var tog = '<img src="index.php?pf=translater/inc/img/toggle.png" alt="" />';
var line = this; var line = this;
@ -23,7 +23,7 @@
var msgfile = $(line).children('.translatermsgfile'); var msgfile = $(line).children('.translatermsgfile');
var msgstr = $(line).children('.translatermsgstr'); var msgstr = $(line).children('.translatermsgstr');
var target = $(line).children('.translatertarget'); var target = $(line).children('.translatertarget');
$('.strlist').hide(); $('.strlist').hide();
var img_go = $('<a class="addfield" title="'+opts.title_go+'">'+img+'</a>').css('cursor','pointer'); var img_go = $('<a class="addfield" title="'+opts.title_go+'">'+img+'</a>').css('cursor','pointer');
@ -48,7 +48,7 @@
} }
}); });
}); });
$(msgstr).children('.subtranslatermsgstr').each(function(){ $(msgstr).children('.subtranslatermsgstr').each(function(){
var img_str = $('<a class="togglelist" title="detail">'+tog+'</a>').css('cursor','pointer'); var img_str = $('<a class="togglelist" title="detail">'+tog+'</a>').css('cursor','pointer');
$(this).children('strong').each(function(){ $(this).children('strong').each(function(){
@ -56,14 +56,14 @@
var img_add = $('<a class="addfield" title="'+opts.title_add+'">'+img+'</a>').css('cursor','pointer'); var img_add = $('<a class="addfield" title="'+opts.title_add+'">'+img+'</a>').css('cursor','pointer');
$(this).prepend(' ').prepend(img_add); $(this).prepend(' ').prepend(img_add);
$(img_add).click(function(){addText(target,txt);}); $(img_add).click(function(){addText(target,txt);});
$(this).append(' ').append(img_str); $(this).append(' ').append(img_str);
var strlist=$(this).siblings('.strlist'); var strlist=$(this).siblings('.strlist');
$(strlist).click(function(){$(strlist).toggle();}); $(strlist).click(function(){$(strlist).toggle();});
$(img_str).click(function(){$(strlist).toggle();}); $(img_str).click(function(){$(strlist).toggle();});
}); });
}); });
var img_file = $('<a class="togglelist" title="detail">'+tog+'</a>').css('cursor','pointer'); var img_file = $('<a class="togglelist" title="detail">'+tog+'</a>').css('cursor','pointer');
$(msgfile).children('strong').each(function(){ $(msgfile).children('strong').each(function(){
$(this).append(' ').append(img_file); $(this).append(' ').append(img_file);

View file

@ -416,5 +416,4 @@ $GLOBALS['__l10n']['Enable menu on themes page'] = 'Activer le menu sur la page
$GLOBALS['__l10n']['translater'] = 'Traducteur'; $GLOBALS['__l10n']['translater'] = 'Traducteur';
$GLOBALS['__l10n']['Translate your Dotclear plugins and themes'] = 'Traduire vos plugins et thèmes pour Dotclear'; $GLOBALS['__l10n']['Translate your Dotclear plugins and themes'] = 'Traduire vos plugins et thèmes pour Dotclear';