Skip to content

Commit ad4aeae

Browse files
committed
* code reformat
* Google Translate API URL was changed (now is "https://translation.googleapis.com/language/translate/v2")
1 parent dc63d7a commit ad4aeae

File tree

12 files changed

+260
-254
lines changed

12 files changed

+260
-254
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.7.3
2+
-----
3+
* code reformat
4+
* Google Translate API URL was changed (now is "https://translation.googleapis.com/language/translate/v2")
5+
16
0.7.2
27
-----
38
* mbstring extension is required (check added) if you use Google Translate API.
Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* FBalliano
45
*
@@ -28,26 +29,26 @@ public function getAttributesToTranslate()
2829
{
2930
$attributes = Mage::getStoreConfig("fballiano_full_catalog_translate/general/attributes_to_translate");
3031
$attributes = explode(",", $attributes);
31-
foreach ($attributes as $k=>$v) {
32+
foreach ($attributes as $k => $v) {
3233
$attributes[$k] = trim($v);
3334
}
3435

3536
return $attributes;
3637
}
3738

38-
/**
39-
* @return array
40-
*/
41-
public function getCategoryAttributesToTranslate()
42-
{
43-
$attributes = Mage::getStoreConfig("fballiano_full_catalog_translate/general/category_attributes_to_translate");
44-
$attributes = explode(",", $attributes);
45-
foreach ($attributes as $k=>$v) {
46-
$attributes[$k] = trim($v);
47-
}
39+
/**
40+
* @return array
41+
*/
42+
public function getCategoryAttributesToTranslate()
43+
{
44+
$attributes = Mage::getStoreConfig("fballiano_full_catalog_translate/general/category_attributes_to_translate");
45+
$attributes = explode(",", $attributes);
46+
foreach ($attributes as $k => $v) {
47+
$attributes[$k] = trim($v);
48+
}
4849

49-
return $attributes;
50-
}
50+
return $attributes;
51+
}
5152

5253
/**
5354
* @return string
@@ -57,19 +58,19 @@ public function getApiKey()
5758
return Mage::getStoreConfig("fballiano_full_catalog_translate/google_translate/api_key");
5859
}
5960

60-
/**
61-
* @return string
62-
*/
63-
public function getTranslationSystem()
64-
{
65-
return Mage::getStoreConfig("fballiano_full_catalog_translate/general/translation_system");
66-
}
61+
/**
62+
* @return string
63+
*/
64+
public function getTranslationSystem()
65+
{
66+
return Mage::getStoreConfig("fballiano_full_catalog_translate/general/translation_system");
67+
}
6768

68-
/**
69-
* @return string
70-
*/
71-
public function getCommand()
72-
{
73-
return Mage::getStoreConfig("fballiano_full_catalog_translate/custom/command");
74-
}
69+
/**
70+
* @return string
71+
*/
72+
public function getCommand()
73+
{
74+
return Mage::getStoreConfig("fballiano_full_catalog_translate/custom/command");
75+
}
7576
}

app/code/community/Fballiano/FullCatalogTranslate/Model/TranslatableAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* FBalliano
45
*
@@ -19,7 +20,6 @@
1920
* @copyright Copyright (c) 2014 Fabrizio Balliano (http://fabrizioballiano.it)
2021
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2122
*/
22-
2323
class Fballiano_FullCatalogTranslate_Model_TranslatableAttributes
2424
{
2525
public function toOptionArray()

app/code/community/Fballiano/FullCatalogTranslate/Model/TranslatableCategoryAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* FBalliano
45
*
@@ -19,7 +20,6 @@
1920
* @copyright Copyright (c) 2014 Fabrizio Balliano (http://fabrizioballiano.it)
2021
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2122
*/
22-
2323
class Fballiano_FullCatalogTranslate_Model_TranslatableCategoryAttributes
2424
{
2525
public function toOptionArray()

app/code/community/Fballiano/FullCatalogTranslate/Model/TranslationSystems.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* FBalliano
45
*
@@ -19,20 +20,19 @@
1920
* @copyright Copyright (c) 2014 Fabrizio Balliano (http://fabrizioballiano.it)
2021
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2122
*/
22-
2323
class Fballiano_FullCatalogTranslate_Model_TranslationSystems
2424
{
2525
public function toOptionArray()
2626
{
2727
$toreturn = array();
28-
$toreturn[] = array(
29-
"value" => "googletranslate",
30-
"label" => "Google Translate"
31-
);
32-
$toreturn[] = array(
33-
"value" => "custom",
34-
"label" => "Custom"
35-
);
28+
$toreturn[] = array(
29+
"value" => "googletranslate",
30+
"label" => "Google Translate"
31+
);
32+
$toreturn[] = array(
33+
"value" => "custom",
34+
"label" => "Custom"
35+
);
3636

3737
return $toreturn;
3838
}
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0"?>
22
<config>
3-
<acl>
4-
<resources>
5-
<admin>
6-
<children>
7-
<system>
8-
<children>
9-
<config>
10-
<children>
11-
<fballiano_full_catalog_translate>
12-
<title>FBalliano Full Catalog Translate</title>
13-
</fballiano_full_catalog_translate>
14-
</children>
15-
</config>
16-
</children>
17-
</system>
18-
</children>
19-
</admin>
20-
</resources>
21-
</acl>
3+
<acl>
4+
<resources>
5+
<admin>
6+
<children>
7+
<system>
8+
<children>
9+
<config>
10+
<children>
11+
<fballiano_full_catalog_translate>
12+
<title>FBalliano Full Catalog Translate</title>
13+
</fballiano_full_catalog_translate>
14+
</children>
15+
</config>
16+
</children>
17+
</system>
18+
</children>
19+
</admin>
20+
</resources>
21+
</acl>
2222
</config>
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<?xml version="1.0"?>
22
<config>
3-
<modules>
4-
<Fballiano_FullCatalogTranslate>
5-
<version>0.7.0</version>
6-
</Fballiano_FullCatalogTranslate>
7-
</modules>
8-
<global>
9-
<helpers>
10-
<fballiano_fullcatalogtranslate>
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>
22-
<module>Fballiano_FullCatalogTranslate</module>
23-
<class>Mage_Catalog_Model_Resource_Setup</class>
24-
</setup>
25-
</fballiano_fullcatalogtranslate_setup>
26-
</resources>
27-
</global>
28-
<default>
29-
<fballiano_full_catalog_translate>
30-
<general>
3+
<modules>
4+
<Fballiano_FullCatalogTranslate>
5+
<version>0.7.3</version>
6+
</Fballiano_FullCatalogTranslate>
7+
</modules>
8+
<global>
9+
<helpers>
10+
<fballiano_fullcatalogtranslate>
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>
22+
<module>Fballiano_FullCatalogTranslate</module>
23+
<class>Mage_Catalog_Model_Resource_Setup</class>
24+
</setup>
25+
</fballiano_fullcatalogtranslate_setup>
26+
</resources>
27+
</global>
28+
<default>
29+
<fballiano_full_catalog_translate>
30+
<general>
3131
<translation_system>googletranslate</translation_system>
32-
<attributes_to_translate>name,short_description,description,meta_title,meta_keyword,meta_description</attributes_to_translate>
32+
<attributes_to_translate>name,short_description,description,meta_title,meta_keyword,meta_description</attributes_to_translate>
3333
<category_attributes_to_translate>name,description,meta_title,meta_keyword,meta_description</category_attributes_to_translate>
34-
</general>
35-
</fballiano_full_catalog_translate>
36-
</default>
34+
</general>
35+
</fballiano_full_catalog_translate>
36+
</default>
3737
</config>
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0"?>
22
<config>
3-
<sections>
4-
<fballiano_full_catalog_translate>
5-
<tab>service</tab>
6-
<label>Fballiano Full Catalog Translate</label>
7-
<show_in_default>1</show_in_default>
8-
<show_in_website>0</show_in_website>
9-
<show_in_store>0</show_in_store>
10-
<groups>
11-
<general>
12-
<label>General</label>
13-
<show_in_default>1</show_in_default>
14-
<show_in_website>0</show_in_website>
15-
<show_in_store>0</show_in_store>
16-
<sort_order>10</sort_order>
17-
<fields>
3+
<sections>
4+
<fballiano_full_catalog_translate>
5+
<tab>service</tab>
6+
<label>Fballiano Full Catalog Translate</label>
7+
<show_in_default>1</show_in_default>
8+
<show_in_website>0</show_in_website>
9+
<show_in_store>0</show_in_store>
10+
<groups>
11+
<general>
12+
<label>General</label>
13+
<show_in_default>1</show_in_default>
14+
<show_in_website>0</show_in_website>
15+
<show_in_store>0</show_in_store>
16+
<sort_order>10</sort_order>
17+
<fields>
1818
<translation_system>
1919
<label>Translation system</label>
2020
<show_in_default>1</show_in_default>
@@ -24,16 +24,16 @@
2424
<source_model>fballiano_fullcatalogtranslate/translationSystems</source_model>
2525
<sort_order>40</sort_order>
2626
</translation_system>
27-
<attributes_to_translate>
28-
<label>Attributes to translate</label>
29-
<show_in_default>1</show_in_default>
30-
<show_in_website>0</show_in_website>
31-
<show_in_store>0</show_in_store>
32-
<frontend_type>multiselect</frontend_type>
33-
<source_model>fballiano_fullcatalogtranslate/translatableAttributes</source_model>
34-
<comment>Only these attributes will be translated.</comment>
27+
<attributes_to_translate>
28+
<label>Attributes to translate</label>
29+
<show_in_default>1</show_in_default>
30+
<show_in_website>0</show_in_website>
31+
<show_in_store>0</show_in_store>
32+
<frontend_type>multiselect</frontend_type>
33+
<source_model>fballiano_fullcatalogtranslate/translatableAttributes</source_model>
34+
<comment>Only these attributes will be translated.</comment>
3535
<sort_order>20</sort_order>
36-
</attributes_to_translate>
36+
</attributes_to_translate>
3737
<category_attributes_to_translate>
3838
<label>Attributes to translate (for categories)</label>
3939
<show_in_default>1</show_in_default>
@@ -44,23 +44,23 @@
4444
<comment>Only these attributes will be translated.</comment>
4545
<sort_order>30</sort_order>
4646
</category_attributes_to_translate>
47-
</fields>
48-
</general>
49-
<google_translate>
50-
<label>Google Translate</label>
51-
<show_in_default>1</show_in_default>
52-
<show_in_website>0</show_in_website>
53-
<show_in_store>0</show_in_store>
54-
<sort_order>20</sort_order>
55-
<fields>
56-
<api_key>
57-
<label>API key</label>
58-
<show_in_default>1</show_in_default>
59-
<show_in_website>0</show_in_website>
60-
<show_in_store>0</show_in_store>
61-
</api_key>
62-
</fields>
63-
</google_translate>
47+
</fields>
48+
</general>
49+
<google_translate>
50+
<label>Google Translate</label>
51+
<show_in_default>1</show_in_default>
52+
<show_in_website>0</show_in_website>
53+
<show_in_store>0</show_in_store>
54+
<sort_order>20</sort_order>
55+
<fields>
56+
<api_key>
57+
<label>API key</label>
58+
<show_in_default>1</show_in_default>
59+
<show_in_website>0</show_in_website>
60+
<show_in_store>0</show_in_store>
61+
</api_key>
62+
</fields>
63+
</google_translate>
6464
<custom>
6565
<label>Custom translation system</label>
6666
<show_in_default>1</show_in_default>
@@ -77,7 +77,7 @@
7777
</command>
7878
</fields>
7979
</custom>
80-
</groups>
81-
</fballiano_full_catalog_translate>
82-
</sections>
80+
</groups>
81+
</fballiano_full_catalog_translate>
82+
</sections>
8383
</config>

app/code/community/Fballiano/FullCatalogTranslate/sql/fballiano_fullcatalogtranslate_setup/install-0.1.0.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"type" => "int",
3131
"default" => "0",
3232
"label" => "Translate automatically?",
33-
"note"=> "Should this product be translated automatically when the store admin decides so?",
33+
"note" => "Should this product be translated automatically when the store admin decides so?",
3434
"input" => "select",
3535
'source' => 'eav/entity_attribute_source_boolean',
3636
"global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,

0 commit comments

Comments
 (0)