Commit ae6208a5 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Translate rule names after variable substitution, too. This allows users to...

Translate rule names after variable substitution, too. This allows users to collect translatable rule names in a variable and then insert it into the final rule name
parent eeb49d1f
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment