Remy Nagelmaeker
Remy Nagelmaeker

Reputation: 215

Change country name in Magento

I'm trying to replace 'United Kingdom' on my address labels with 'Great Britain'

We notice that shipments to the United Kingdom (believe it or not) often arrive in the United States.

This is the code so far:

if ($value!=='') {
    if ($value =='United Kingdom') {
    $page->drawText(Mage::helper('addresslabel')->__('Great Britain'), $this->x, $this->y, 'UTF-8');
    }
    else {                          
    $page->drawText(strip_tags(ltrim($value)), $this->x, $this->y, 'UTF-8');
    }
}

But it's not working. Could anybody help me get this right?

Upvotes: 0

Views: 2445

Answers (2)

Remy Nagelmaeker
Remy Nagelmaeker

Reputation: 215

The error was in this line of code:

$page->drawText(Mage::helper('addresslabel')->__('Great Britain'), $this->x, $this->y, 'UTF-8');
}

I replaced it with the following:

$gb='Great Britain';
$page->drawText(strip_tags(ltrim($gb)), $this->x, $this->y, 'UTF-8');

This works great!

Upvotes: 0

Lucas Moeskops
Lucas Moeskops

Reputation: 5443

I don't think there will be any trouble modifying the country name, although it is unusual. As long as you change only the name and not the codes linked to them.

They are stored in (what I could find):

lib/Zend/Locale/Data/Translation.php
lib/Zend/Locale/Data/fil.xml
lib/Zend/Locale/Data/en.xml
lib/Zend/Locale/Data/id.xml
lib/Zend/Locale/Data/ms.xml

I'm not sure of any other way other than just editing them in these files.

Upvotes: 3

Related Questions