Version Notes
First public release
Download this release
Release Info
Developer | Fabrizio Balliano |
Extension | magento-full-catalog-translate |
Version | 0.4.0 |
Comparing to | |
See all releases |
Code changes from version 0.2.0 to 0.4.0
- app/code/community/Fballiano/FullCatalogTranslate/Model/TranslatableAttributes.php +48 -0
- app/code/community/Fballiano/FullCatalogTranslate/etc/config.xml +7 -2
- app/code/community/Fballiano/FullCatalogTranslate/etc/system.xml +3 -1
- app/code/community/Fballiano/FullCatalogTranslate/sql/fballiano_fullcatalogtranslate_setup/upgrade-0.2.0-0.3.0.php +41 -0
- lib/Magmi/inc/magmi_engine.php +1 -0
- package.xml +4 -4
app/code/community/Fballiano/FullCatalogTranslate/Model/TranslatableAttributes.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FBalliano
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this Module to
|
15 |
+
* newer versions in the future.
|
16 |
+
*
|
17 |
+
* @category FBalliano
|
18 |
+
* @package FBalliano_FullCatalogTranslate
|
19 |
+
* @copyright Copyright (c) 2014 Fabrizio Balliano (http://fabrizioballiano.it)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
class Fballiano_FullCatalogTranslate_Model_TranslatableAttributes
|
24 |
+
{
|
25 |
+
public function toOptionArray()
|
26 |
+
{
|
27 |
+
$entityTypeId = Mage::getModel('eav/entity')
|
28 |
+
->setType(Mage_Catalog_Model_Product::ENTITY)
|
29 |
+
->getTypeId();
|
30 |
+
|
31 |
+
$attributes = Mage::getModel("catalog/entity_attribute")->getCollection()
|
32 |
+
->addFieldToFilter("entity_type_id", $entityTypeId)
|
33 |
+
->addFieldToFilter("backend_type", array("in" => array("varchar", "text", "textarea")))
|
34 |
+
->addFieldToFilter("frontend_input", array("in" => array("text", "textarea")))
|
35 |
+
->addFieldToFilter("attribute_code", array("nin" => array("custom_layout_update", "recurring_profile")))
|
36 |
+
->setOrder("attribute_code", "ASC");
|
37 |
+
|
38 |
+
$toreturn = array();
|
39 |
+
foreach ($attributes as $attribute) {
|
40 |
+
$toreturn[] = array(
|
41 |
+
"value" => $attribute["attribute_code"],
|
42 |
+
"label" => ucfirst(str_replace("_", " ", $attribute["attribute_code"]))
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
return $toreturn;
|
47 |
+
}
|
48 |
+
}
|
app/code/community/Fballiano/FullCatalogTranslate/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fballiano_FullCatalogTranslate>
|
5 |
-
<version>0.
|
6 |
</Fballiano_FullCatalogTranslate>
|
7 |
</modules>
|
8 |
<global>
|
@@ -11,6 +11,11 @@
|
|
11 |
<class>Fballiano_FullCatalogTranslate_Helper</class>
|
12 |
</fballiano_fullcatalogtranslate>
|
13 |
</helpers>
|
|
|
|
|
|
|
|
|
|
|
14 |
<resources>
|
15 |
<fballiano_fullcatalogtranslate_setup>
|
16 |
<setup>
|
@@ -23,7 +28,7 @@
|
|
23 |
<default>
|
24 |
<fballiano_full_catalog_translate>
|
25 |
<general>
|
26 |
-
<attributes_to_translate>name,
|
27 |
</general>
|
28 |
</fballiano_full_catalog_translate>
|
29 |
</default>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fballiano_FullCatalogTranslate>
|
5 |
+
<version>0.4.0</version>
|
6 |
</Fballiano_FullCatalogTranslate>
|
7 |
</modules>
|
8 |
<global>
|
11 |
<class>Fballiano_FullCatalogTranslate_Helper</class>
|
12 |
</fballiano_fullcatalogtranslate>
|
13 |
</helpers>
|
14 |
+
<models>
|
15 |
+
<fballiano_fullcatalogtranslate>
|
16 |
+
<class>Fballiano_FullCatalogTranslate_Model</class>
|
17 |
+
</fballiano_fullcatalogtranslate>
|
18 |
+
</models>
|
19 |
<resources>
|
20 |
<fballiano_fullcatalogtranslate_setup>
|
21 |
<setup>
|
28 |
<default>
|
29 |
<fballiano_full_catalog_translate>
|
30 |
<general>
|
31 |
+
<attributes_to_translate>name,short_description,description,meta_title,meta_keyword,meta_description</attributes_to_translate>
|
32 |
</general>
|
33 |
</fballiano_full_catalog_translate>
|
34 |
</default>
|
app/code/community/Fballiano/FullCatalogTranslate/etc/system.xml
CHANGED
@@ -20,7 +20,9 @@
|
|
20 |
<show_in_default>1</show_in_default>
|
21 |
<show_in_website>0</show_in_website>
|
22 |
<show_in_store>0</show_in_store>
|
23 |
-
<
|
|
|
|
|
24 |
</attributes_to_translate>
|
25 |
</fields>
|
26 |
</general>
|
20 |
<show_in_default>1</show_in_default>
|
21 |
<show_in_website>0</show_in_website>
|
22 |
<show_in_store>0</show_in_store>
|
23 |
+
<frontend_type>multiselect</frontend_type>
|
24 |
+
<source_model>fballiano_fullcatalogtranslate/translatableAttributes</source_model>
|
25 |
+
<comment>Only these attributes will be translated.</comment>
|
26 |
</attributes_to_translate>
|
27 |
</fields>
|
28 |
</general>
|
app/code/community/Fballiano/FullCatalogTranslate/sql/fballiano_fullcatalogtranslate_setup/upgrade-0.2.0-0.3.0.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* FBalliano
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* DISCLAIMER
|
13 |
+
*
|
14 |
+
* Do not edit or add to this file if you wish to upgrade this Module to
|
15 |
+
* newer versions in the future.
|
16 |
+
*
|
17 |
+
* @category FBalliano
|
18 |
+
* @package FBalliano_FullCatalogTranslate
|
19 |
+
* @copyright Copyright (c) 2014 Fabrizio Balliano (http://fabrizioballiano.it)
|
20 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
+
*/
|
22 |
+
|
23 |
+
/* @var $installer Mage_Catalog_Model_Resource_Setup */
|
24 |
+
$installer = $this;
|
25 |
+
$installer->startSetup();
|
26 |
+
|
27 |
+
$db = Mage::getSingleton('core/resource')->getConnection("core_write");
|
28 |
+
$config_table_name = Mage::getSingleton('core/resource')->getTableName("core_config_data");
|
29 |
+
$configs = $db->fetchAll("SELECT * FROM $config_table_name WHERE path='fballiano_full_catalog_translate/general/attributes_to_translate'");
|
30 |
+
foreach ($configs as $config) {
|
31 |
+
$newvalues = array();
|
32 |
+
$values = explode(",", $config["value"]);
|
33 |
+
foreach ($values as $value) {
|
34 |
+
$value = trim($value);
|
35 |
+
if (strlen($value)) $newvalues[] = $value;
|
36 |
+
}
|
37 |
+
$newvalues = implode(",", $newvalues);
|
38 |
+
$db->update($config_table_name, array("value" => $newvalues), "config_id={$config["config_id"]}");
|
39 |
+
}
|
40 |
+
|
41 |
+
$installer->endSetup();
|
lib/Magmi/inc/magmi_engine.php
CHANGED
@@ -47,6 +47,7 @@ abstract class Magmi_Engine extends DbHelper
|
|
47 |
$this->_conf->load();
|
48 |
|
49 |
$this->tprefix=$this->_conf->get("DATABASE","table_prefix");
|
|
|
50 |
$this->_excid=0;
|
51 |
$this->_initialized=true;
|
52 |
$this->_exceptions=array();
|
47 |
$this->_conf->load();
|
48 |
|
49 |
$this->tprefix=$this->_conf->get("DATABASE","table_prefix");
|
50 |
+
$this->tprefix=Mage::getConfig()->getTablePrefix();//FB: patch for magento
|
51 |
$this->_excid=0;
|
52 |
$this->_initialized=true;
|
53 |
$this->_exceptions=array();
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>magento-full-catalog-translate</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -28,9 +28,9 @@ php fballiano_full_catalog_translate.php default storeviewita
|
|
28 |
The process will gather all the products that need to be translated (from the target storeview), gather the untranslated text (from the source storeview), call Google Translate API for every attribute, import the translated text into the target store view, set the record to "not to be translated" (again, into the target storeview).</description>
|
29 |
<notes>First public release</notes>
|
30 |
<authors><author><name>Fabrizio Balliano</name><user>fballiano</user><email>fabrizio@fabrizioballiano.it</email></author></authors>
|
31 |
-
<date>2014-06-
|
32 |
-
<time>07:
|
33 |
-
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Fballiano"><dir name="FullCatalogTranslate"><dir name="Helper"><file name="Data.php" hash="fed4f9d970da860ee349d8de2bb752ac"/></dir><dir name="etc"><file name="adminhtml.xml" hash="db29c60a26c76fc43d89a6aad45b8c0d"/><file name="config.xml" hash="
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>magento-full-catalog-translate</name>
|
4 |
+
<version>0.4.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
28 |
The process will gather all the products that need to be translated (from the target storeview), gather the untranslated text (from the source storeview), call Google Translate API for every attribute, import the translated text into the target store view, set the record to "not to be translated" (again, into the target storeview).</description>
|
29 |
<notes>First public release</notes>
|
30 |
<authors><author><name>Fabrizio Balliano</name><user>fballiano</user><email>fabrizio@fabrizioballiano.it</email></author></authors>
|
31 |
+
<date>2014-06-19</date>
|
32 |
+
<time>07:00:44</time>
|
33 |
+
<contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Fballiano"><dir name="FullCatalogTranslate"><dir name="Helper"><file name="Data.php" hash="fed4f9d970da860ee349d8de2bb752ac"/></dir><dir name="Model"><file name="TranslatableAttributes.php" hash="ff09f3548fa07b6519cfb26179adf5e4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="db29c60a26c76fc43d89a6aad45b8c0d"/><file name="config.xml" hash="35dc07c2e1d13f0935f0a4923e4f78d6"/><file name="system.xml" hash="0d54ad60f3c69db5106f9472a5cf73a4"/></dir><dir name="sql"><dir name="fballiano_fullcatalogtranslate_setup"><file name="install-0.1.0.php" hash="39142871be423777adec9c76372a9731"/><file name="upgrade-0.2.0-0.3.0.php" hash="4cfb093baf6cb77ef090bbe2e47f4288"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Fballiano_FullCatalogTranslate.xml" hash="7763d2974b52ca32136a0260a426f090"/></dir></dir></dir><dir name="lib"><dir name="Magmi"><file name="ReleaseNotes.txt" hash="0ac67ff0b1bd147e09aacc854113309d"/><dir name="conf"><file name="magmi.ini" hash="17ad89d67997e66c499c673e3e8af291"/><file name="plugins.conf" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><dir name="engines"><file name="magmi_productimportengine.php" hash="8897589287f42e89a4c13dae04c5c152"/><file name="magmi_utilityengine.php" hash="d0ca093690e95caea5864d2fd4321104"/></dir><dir name="inc"><file name="dbhelper.class.php" hash="9d08f9e386e482048335c35069175e1c"/><file name="dbhelper.class.php~" hash="59098f2580e780f55bd99f0602e78b2d"/><file name="fshelper.php" hash="b191c2c916cf3dca5055bd96c93b8945"/><file name="license.txt" hash="d69f02f4db9d64af32ac1a390d2a9574"/><file name="magmi_config.php" hash="aea8a1efdeca49f2405f473c1f0b9a23"/><file name="magmi_csvreader.php" hash="895070e4753f1e77d1702f9de5652d03"/><file name="magmi_defs.php" hash="50a8feecdfb43dde843bd7e36fddc413"/><file name="magmi_engine.php" hash="0f3b9ff5bc80bf9bd902b043f9b349bb"/><file name="magmi_loggers.php" hash="27e74b06ce160c6e07f9da614503bfba"/><file name="magmi_mixin.php" hash="95ac60575fcda43174fa545f2e4c0217"/><file name="magmi_pluginhelper.php" hash="75d5ba334c43f545cdc38d274341b423"/><file name="magmi_postinstall.php" hash="3bef1b9a85d364d0858502e0d5b3cd87"/><file name="magmi_statemanager.php" hash="a56c33fe73c871338853c25933c2a280"/><file name="magmi_utils.php" hash="9694d4ffdb23c1ca2b350dad99d08e96"/><file name="magmi_version.php" hash="1a18210c3c8b7884c596a2d350ebc7ae"/><file name="properties.php" hash="1a57150735e51255fff575b8f1df5e91"/></dir><dir name="integration"><dir name="inc"><file name="magmi_datapump.php" hash="5446ff3f4dd82086d10d81c8f32bba05"/><file name="magmi_datapumpdatasource.php" hash="98113a6bc3d3617da7655c850596c36b"/><file name="productimport_datapump.php" hash="b5bfa0ce6aa4e7b56f70bd3da623e428"/><file name="pumpfactory.ini" hash="b4beac3e561fcf91a416eb52c76ce4e3"/></dir><dir name="samples"><file name="sample.php" hash="89df4a819a4396ab981092cae130eaa9"/><file name="sample2_configurables.php" hash="4ab28a07812ae27c9ad26bf3edbb68fd"/></dir></dir><dir name="plugins"><dir name="base"><dir name="datasources"><dir name="__magento"><file name="magmi_magentodatasource.php" hash="7994fe4f0ffdbe6d2d5881d31597319a"/><file name="options_panel.php" hash="1c1cf71c5ca55933b1c39e4040d1865e"/></dir><dir name="csv"><file name="csvds_filelist.php" hash="737e882668364fd8fe517f6fb94d3deb"/><file name="magmi_csvdatasource.php" hash="d6d78948b50669161fd8bb615dab8de1"/><file name="options_panel.php" hash="0addabcc9d0469cfd6a86b0cbda63418"/></dir><dir name="genericsql"><file name="mysql_options.php" hash="ca0c24ee9397fcdfba2b75063ef28901"/><file name="options_panel.php" hash="fe738f8d7f861eba725a4cd7a6798809"/><file name="other_options.php" hash="f47deb1e13a7e5bfaade5b878f9f1065"/><file name="sql_datasource.php" hash="f1e6b42056630739bcb38df8e74f121e"/></dir></dir><dir name="general"><dir name="emailreport"><file name="emailreport.php" hash="6bda450b7141cdcdb7b0e7b184cca8bd"/><file name="options_panel.php" hash="72c1ac4891219fa1a87f8b03a15dc0c6"/></dir><dir name="importurl"><file name="importurl_plugin.php" hash="3b3226fb553a03a2bfff8d45babf4f02"/><file name="options_panel.php" hash="3f4131f0c50b22af8d5762eae25a8561"/></dir><dir name="optimizer"><file name="magmi_optimizer_plugin.php" hash="2c0a9f084c93ac6052a115eaac5cb398"/></dir><dir name="reindex"><file name="magmi_reindexing_plugin.php" hash="2552a823150c881b877035d79824565f"/><file name="options_panel.php" hash="eb077f772e34bdbf75c79ce882cd0f07"/></dir></dir><dir name="itemprocessors"><dir name="columnmapper"><file name="000_columnmapper.php" hash="7a0ae78ee3ab4f38431c07f8ed46bd6d"/><file name="options_panel.php" hash="44b2ab98da57a5354cd22c1d7f5a8e0f"/></dir><dir name="configurables"><file name="magmi_configurableprocessor.php" hash="93f7f7da42a017e77a3293e825bb2048"/><file name="options_panel.php" hash="4ffc870e5ff6bc33a02e972a2f614707"/></dir><dir name="defaultvalues"><file name="00_default_values.php" hash="d8e94a904b9b4a03304785ec2d5a9d9d"/><file name="options_panel.php" hash="b951c2d3487d694597c416a1ff3dafa1"/></dir><dir name="genericmapper"><file name="02_genericmapper.php" hash="5890de9499085267cde209a07aabb9d0"/><dir name="mappings"><dir name="default"><file name="__common__.csv" hash="51f076b2137b08cbcec63bcfa046ad7a"/><file name="options_container.csv" hash="bb84f94e68900c1aafc66ce2c2461d06"/><file name="page_layout.csv" hash="0f6ac4af46d4090cb22497d172bad2f8"/><file name="status.csv" hash="dc5569042656c4163fea1cd74e8ed6d8"/><file name="visibility.csv" hash="462fe1effcdb1ab3942677a011019f15"/></dir></dir><file name="options_panel.php" hash="06477d262c34d194da52d533af8d270f"/></dir><dir name="grouped"><file name="alpine_groupedprocessor.php" hash="570fd184740e822b6b4489cd3a30324a"/><file name="options_panel.php" hash="746c1d9e4e3248ab768f2da7002d0ac4"/></dir><dir name="importlimiter"><file name="01_importlimiter.php" hash="770310a86b9bd7b8a03889c60d4b82d2"/><file name="options_panel.php" hash="cb52e5ac4bc489c50b2b5768608bcf0b"/></dir><dir name="productdeleter"><file name="options_panel.php" hash="4252b3a975efc6bc42ec3903a1f9158f"/><file name="productdeleter.php" hash="d9390afd593ed793a5ce13f3877d2f70"/></dir><dir name="related"><file name="related_products.php" hash="c9623952da7d17e76d8e6483b7327f80"/></dir><dir name="skufinder"><file name="001_skufinder.php" hash="a5dbdaed122087f6c0a68e024556fae4"/><file name="options_panel.php" hash="fe48ad7baac974583c41eb762dbe4e1c"/></dir><dir name="upcross_sell"><file name="crossupsell_products.php" hash="23eec787b46fcb0463367090e47e97e4"/></dir></dir></dir><dir name="inc"><file name="magmi_datasource.php" hash="255921bd1b5879e77a3a16f762781ac0"/><file name="magmi_default_options_panel.php" hash="b35c690a790c77b97124c3bd395b176d"/><file name="magmi_defaultattributehandler.php" hash="4f6ce8c7286aca015bef34366c11899d"/><file name="magmi_generalimport_plugin.php" hash="e5a337ee90873ee82c6ecb7ed38af647"/><file name="magmi_item_processor.php" hash="1bd368a6970940206724284a299f028b"/><file name="magmi_plugin.php" hash="c3a09fef3804f0b56b3123494e47239c"/><file name="magmi_utility_plugin.php" hash="8b0aaa8700a9337a206d72ded13bfa9b"/></dir></dir></dir></dir><dir name="shell"><file name="fballiano_full_catalog_translate.php" hash="e87ba031e963a459a5f22edf30902900"/></dir></target></contents>
|
34 |
<compatible/>
|
35 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
36 |
</package>
|