diff --git a/library/rules_shipping_framework.php b/library/rules_shipping_framework.php index 792e691d2c7ab0f6f52e683458d248829f18afae..f7e64c8073af4bcba16890304e1ad3dda7966ed1 100644 --- a/library/rules_shipping_framework.php +++ b/library/rules_shipping_framework.php @@ -1136,14 +1136,14 @@ class ShippingRule { $this->match = True; foreach ($this->messages as $k=>$msgs) { foreach ($msgs as $i=>$m) { - // First translate the messge before replacing variables! - $this->messages[$k][$i] = $this->stringReplaceVariables($this->framework->__($m), $vals); + // First translate the messge before replacing variables! Then translate once more. This allows one to collect translatable identifiers for rule names and then insert them into the rule name. These identifiers cannot include any variables, though. + $this->messages[$k][$i] = $this->framework->__($this->stringReplaceVariables($this->framework->__($m), $vals)); } } // Calculate the value (i.e. shipping cost or modifier) $this->value = $this->calculateShipping($vals, $products, $cartvals_callback); - $this->rulename = $this->stringReplaceVariables($this->framework->__($this->name), $vals); + $this->rulename = $this->framework->__($this->stringReplaceVariables($this->framework->__($this->name), $vals)); } function matches(&$vals, $products, $cartvals_callback) {