I've created module and I want to add translations to core_translate
database table. I created array with original string and translation in form:
$words = array(
'MyCustomModule::StringToTranslate' => 'String translation'
...
);
and in install PHP file I tried with:
foreach ($words as $source => $translate) {
$model = Mage::getModel('core/translate');
$model->setString($source);
$model->setTranslate($translate);
$model->setLocale('pl_PL');
$model->save();
}
and with:
foreach ($words as $source => $translate) {
$model = Mage::getModel('core/translate');
$model->setData('string', $source);
$model->setData('translate', $translate);
$model->setData('locale', 'pl_PL');
$model->save();
}
but I still get an error. As I see in Mage/Core/Model/Translate it just a simple class.
How can I add my translations into that table?