Index: branches/5.1.x/units/currencies/currencies_event_handler.php =================================================================== diff -u -r13100 -r13147 --- branches/5.1.x/units/currencies/currencies_event_handler.php (.../currencies_event_handler.php) (revision 13100) +++ branches/5.1.x/units/currencies/currencies_event_handler.php (.../currencies_event_handler.php) (revision 13147) @@ -1,6 +1,6 @@ getObject(); - $object->addFilter('current_lang', 'phr.LanguageId = '.$this->Application->GetVar('m_lang')); - - if($event->Special == 'active') - { + if ($event->Special == 'active') { $object =& $event->getObject(); $object->addFilter('status_filter', '%1$s.Status = 1'); } @@ -213,4 +210,24 @@ { $this->Application->StoreVar('curr_iso', $this->Application->GetVar('curr_iso')); } + + /** + * Changes default module to custom (when available) + * + * @param kEvent $event + */ + function OnAfterConfigRead(&$event) + { + parent::OnAfterConfigRead($event); + + // make sure, that currency Translation is on current language + $language_id = $this->Application->GetVar('m_lang'); + $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); + + foreach ($calculated_fields[''] as $field_name => $field_expression) { + $calculated_fields[''][$field_name] = str_replace('%4$s', $language_id, $field_expression); + } + + $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); + } } \ No newline at end of file