Version Notes
www.ecommercegrow.com
Download this release
Release Info
Developer | ecommercegrow |
Extension | Aicod_ForceTranslate |
Version | 1.0.87534214 |
Comparing to | |
See all releases |
Version 1.0.87534214
app/code/community/Aicod/ForceTranslate/Model/Translate.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Aicod_ForceTranslate_Model_Translate extends Mage_Core_Model_Translate
|
5 |
+
{
|
6 |
+
protected function _loadThemeTranslation($forceReload = false)
|
7 |
+
{
|
8 |
+
$file = Mage::getDesign()->getLocaleFileName('translate_force.csv');
|
9 |
+
$scope = 'Aicod_ForceTranslate';
|
10 |
+
$data = $this->_getFileData($file);
|
11 |
+
foreach($data as $v=>$vt)
|
12 |
+
$this->_data[$scope.self::SCOPE_SEPARATOR.$v] = $vt;
|
13 |
+
|
14 |
+
//print_r($data);
|
15 |
+
//print_r($this->getData());
|
16 |
+
//exit;
|
17 |
+
|
18 |
+
return parent::_loadThemeTranslation($forceReload);
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _getTranslatedString($text, $code)
|
22 |
+
{
|
23 |
+
/*$translated = '';
|
24 |
+
if (array_key_exists($code, $this->getData())) {
|
25 |
+
$translated = $this->_data[$code];
|
26 |
+
}
|
27 |
+
elseif (array_key_exists($text, $this->getData())) {
|
28 |
+
$translated = $this->_data[$text];
|
29 |
+
}
|
30 |
+
else {
|
31 |
+
$translated = $text;
|
32 |
+
}
|
33 |
+
return $translated;*/
|
34 |
+
|
35 |
+
//return "test";
|
36 |
+
|
37 |
+
//print_r($this->getData());
|
38 |
+
//exit;
|
39 |
+
|
40 |
+
//$file = Mage::getDesign()->getLocaleFileName('translate_force.csv');
|
41 |
+
//$file_data = $this->_getFileData($file);
|
42 |
+
//if(array_key_exists($text,$file_data))
|
43 |
+
// return $file_data[$text];
|
44 |
+
|
45 |
+
$scope = 'Aicod_ForceTranslate';
|
46 |
+
$tkey = $scope.self::SCOPE_SEPARATOR.$text;
|
47 |
+
if(array_key_exists($tkey,$this->_data))
|
48 |
+
return $this->_data[$tkey];
|
49 |
+
|
50 |
+
return parent::_getTranslatedString($text,$code);
|
51 |
+
}
|
52 |
+
}
|
app/code/community/Aicod/ForceTranslate/README.TXT
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Aicod_ForceTranslate
|
2 |
+
http://www.ecommercegrow.com/
|
3 |
+
|
4 |
+
Purpose:
|
5 |
+
- Some "magento translations keys" like simple ones "start", "qty" and others are repeated for every "scope" like: "Mage_Sales.csv", "Mage_Checkout.csv" etc.
|
6 |
+
this extension allow you to bypass any scope and keep the core csv files not modified, all you need to to is insert you translation in:
|
7 |
+
{MAGENTO_ROOT}/app/design/frontend/{PACKAGE}/{THEME}/locale/{LOCALE_CODE}/translate_force.csv
|
8 |
+
LOCALE_CODE uses the same folder names you find in: {MAGENTO_ROOT}/app/locale
|
9 |
+
|
10 |
+
Compatibility:
|
11 |
+
- Magento 1.7+
|
12 |
+
|
13 |
+
Installation:
|
14 |
+
- Intall the provided tgz package file with the magento web gui:
|
15 |
+
Magento Backend\System\Magento Connect\Magento Connect Manager\Direct package file upload\Upload
|
16 |
+
Alternatively via command line: "MAGENTO_ROOT/mage install-file PACKAGEFILE.tgz"
|
17 |
+
- Always remember to flush magento cache after installing any extension: Magento Backend\System\Cache Management\Flush Cache Storage
|
18 |
+
And logout/login from the magento backend.
|
19 |
+
|
20 |
+
Uninstallation:
|
21 |
+
- Choose Unistall in Magento Backend\System\Magento Connect\Magento Connect Manager\Manage Existing Extensions
|
22 |
+
Alternatively via command line: "MAGENTO_ROOT/mage uninstall community PACKAGENAME" (use "MAGENTO_ROOT/mage list-installed" to retrive the list of installaed packages)
|
23 |
+
|
24 |
+
Configuration / Usage:
|
25 |
+
- Once installed the extension become immediatly active.
|
26 |
+
- Edit {MAGENTO_ROOT}/app/design/frontend/{PACKAGE}/{THEME}/locale/{LOCALE_CODE}/translate_force.csv
|
27 |
+
|
app/code/community/Aicod/ForceTranslate/etc/config.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Aicod_ForceTranslate>
|
5 |
+
<version>1.0</version>
|
6 |
+
</Aicod_ForceTranslate>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<global>
|
10 |
+
|
11 |
+
<models>
|
12 |
+
|
13 |
+
<core>
|
14 |
+
<rewrite>
|
15 |
+
<translate>Aicod_ForceTranslate_Model_Translate</translate>
|
16 |
+
</rewrite>
|
17 |
+
</core>
|
18 |
+
|
19 |
+
</models>
|
20 |
+
|
21 |
+
</global>
|
22 |
+
|
23 |
+
</config>
|
app/etc/modules/Aicod_ForceTranslate.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Aicod_ForceTranslate>
|
5 |
+
<active>1</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
|
8 |
+
<depends>
|
9 |
+
<Mage_Core />
|
10 |
+
</depends>
|
11 |
+
|
12 |
+
</Aicod_ForceTranslate>
|
13 |
+
</modules>
|
14 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Aicod_ForceTranslate</name>
|
4 |
+
<version>1.0.87534214</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.ecommercegrow.com/license">http://www.ecommercegrow.com/license</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>www.ecommercegrow.com</summary>
|
10 |
+
<description>www.ecommercegrow.com</description>
|
11 |
+
<notes>www.ecommercegrow.com</notes>
|
12 |
+
<authors>
|
13 |
+
<author>
|
14 |
+
<name>ecommercegrow</name>
|
15 |
+
<user>ecommercegrow</user>
|
16 |
+
<email>info@ecommercegrow.com</email>
|
17 |
+
</author>
|
18 |
+
</authors>
|
19 |
+
<compatible/>
|
20 |
+
<dependencies>
|
21 |
+
<required>
|
22 |
+
<php>
|
23 |
+
<min>5.2.0</min>
|
24 |
+
<max>6.0.0</max>
|
25 |
+
</php>
|
26 |
+
</required>
|
27 |
+
</dependencies>
|
28 |
+
<date>2013-05-31</date>
|
29 |
+
<time>13:51:54</time>
|
30 |
+
<contents>
|
31 |
+
<target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Aicod_ForceTranslate.xml" hash="b04dc04259d01d60b5ea0921ea816314"/></dir></dir><dir name="code"><dir name="community"><dir name="Aicod"><dir name="ForceTranslate"><dir name="Model"><file name="Translate.php" hash="58c1da8006807b7463f0de349f60437e"/></dir><dir name="etc"><file name="config.xml" hash="55bd4dcb8624550f709400aab414650b"/></dir><file name="README.TXT" hash="8f7371bb4b873b446ba20f4e5fdf4a33"/></dir></dir></dir></dir></dir></target>
|
32 |
+
</contents>
|
33 |
+
</package>
|