Skip to main content
added 3 characters in body
Source Link

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Updated answer

As you said, the above solution is a tedious process if this needs to be done for all the .phtml files. For that we can rewrite the Translate class which is responsible for doing this translation process.

Class to be rewritten - Mage_Core_Model_Translate

File path - app/code/core/Mage/Core/Model/Translate.php

Method to be rewritten - public function translate($args)

This method is translating the text. Wrap all the lines of this method with an if condition to check the customer group.

If you are not aware about the Model rewrite mechanism, follow this tutorial - http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Updated answer

As you said, the above solution is a tedious process if this needs to be done for all the .phtml files. For that we can rewrite the Translate class which responsible for doing this translation process.

Class to be rewritten - Mage_Core_Model_Translate

File path - app/code/core/Mage/Core/Model/Translate.php

Method to be rewritten - public function translate($args)

This method is translating the text. Wrap all the lines of this method with an if condition to check the customer group.

If you are not aware about the Model rewrite mechanism, follow this tutorial - http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Updated answer

As you said, the above solution is a tedious process if this needs to be done for all the .phtml files. For that we can rewrite the Translate class which is responsible for doing this translation process.

Class to be rewritten - Mage_Core_Model_Translate

File path - app/code/core/Mage/Core/Model/Translate.php

Method to be rewritten - public function translate($args)

This method is translating the text. Wrap all the lines of this method with an if condition to check the customer group.

If you are not aware about the Model rewrite mechanism, follow this tutorial - http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

added 698 characters in body
Source Link

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Updated answer

As you said, the above solution is a tedious process if this needs to be done for all the .phtml files. For that we can rewrite the Translate class which responsible for doing this translation process.

Class to be rewritten - Mage_Core_Model_Translate

File path - app/code/core/Mage/Core/Model/Translate.php

Method to be rewritten - public function translate($args)

This method is translating the text. Wrap all the lines of this method with an if condition to check the customer group.

If you are not aware about the Model rewrite mechanism, follow this tutorial - http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Updated answer

As you said, the above solution is a tedious process if this needs to be done for all the .phtml files. For that we can rewrite the Translate class which responsible for doing this translation process.

Class to be rewritten - Mage_Core_Model_Translate

File path - app/code/core/Mage/Core/Model/Translate.php

Method to be rewritten - public function translate($args)

This method is translating the text. Wrap all the lines of this method with an if condition to check the customer group.

If you are not aware about the Model rewrite mechanism, follow this tutorial - http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/

deleted 2 characters in body
Source Link

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you neededneed. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you needed. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}

Translation works only if you use the helper class for printing a string.

Mage::helper('xxxxxx')->__('Text to be translated')

Before this line of code add an if condition to check if the current customer belongs to the group you need. If so, use the above line of code, else, simply use PHP's echo function. So, the code may look like this:

if (customer belongs to group) {
    echo Mage::helper('xxxxxx')->__('Text to be translated');
} else {
    echo 'Text without translation';
}
Source Link
Loading