Skip to content

Commit

Permalink
LO: Replaced @s{n} with %{n} in translations (#5820)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémie Tabet authored and mickaelandrieu committed Jul 1, 2016
1 parent b4108de commit 0418978
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@

<script type="text/javascript">
var summary_translation_undefined = '{l s='[undefined]' js=1}';
var summary_translation_meta_informations = '{l s='This carrier is @s1 and the delivery announced is: @s2.' js=1}';
var summary_translation_meta_informations = '{l s='This carrier is %1$s and the delivery announced is: %2$s.' js=1}';
var summary_translation_free = '<strong>{l s='free' js=1}</strong>';
var summary_translation_paid = '<strong>{l s='not free' js=1}</strong>';
var summary_translation_range = '<span class="is_free">{l s='This carrier can deliver orders from @s1 to @s2.' js=1}</span>';
var summary_translation_range_limit = '{l s='If the order is out of range, the behavior is to @s3.' js=1}';
var summary_translation_shipping_cost = '{l s='The shipping cost is calculated @s1 and the tax rule @s2 will be applied.' js=1}';
var summary_translation_range = '<span class="is_free">{l s='This carrier can deliver orders from %1$s to %2$s.' js=1}</span>';
var summary_translation_range_limit = '{l s='If the order is out of range, the behavior is to %3$s.' js=1}';
var summary_translation_shipping_cost = '{l s='The shipping cost is calculated %1$s and the tax rule %2$s will be applied.' js=1}';
var summary_translation_price = '<strong>{l s='according to the price' js=1}</strong>';
var summary_translation_weight = '<strong>{l s='according to the weight' js=1}</strong>';
</script>
Expand Down
20 changes: 10 additions & 10 deletions js/admin/carrier_wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,22 @@ function displaySummary()
$('#summary_name').text($('#name').val());

// Delay and pricing
tmp = summary_translation_meta_informations.replace('@s2', '<strong>' + delay_text + '</strong>');
tmp = summary_translation_meta_informations.replace('%2$s', '<strong>' + delay_text + '</strong>');
if ($('#is_free_on').attr('checked'))
tmp = tmp.replace('@s1', summary_translation_free);
tmp = tmp.replace('%1$s', summary_translation_free);
else
tmp = tmp.replace('@s1', summary_translation_paid);
tmp = tmp.replace('%1$s', summary_translation_paid);
$('#summary_meta_informations').html(tmp);

// Tax and calculation mode for the shipping cost
tmp = summary_translation_shipping_cost.replace('@s2', '<strong>' + $('#id_tax_rules_group option:selected').text() + '</strong>');
tmp = summary_translation_shipping_cost.replace('%2$s', '<strong>' + $('#id_tax_rules_group option:selected').text() + '</strong>');

if ($('#billing_price').attr('checked'))
tmp = tmp.replace('@s1', summary_translation_price);
tmp = tmp.replace('%1$s', summary_translation_price);
else if ($('#billing_weight').attr('checked'))
tmp = tmp.replace('@s1', summary_translation_weight);
tmp = tmp.replace('%1$s', summary_translation_weight);
else
tmp = tmp.replace('@s1', '<strong>' + summary_translation_undefined + '</strong>');
tmp = tmp.replace('%1$s', '<strong>' + summary_translation_undefined + '</strong>');



Expand Down Expand Up @@ -232,9 +232,9 @@ function displaySummary()

$('#summary_range').html(
$('#summary_range').html()
.replace('@s1', '<strong>' + range_inf +' '+ unit + '</strong>')
.replace('@s2', '<strong>' + range_sup +' '+ unit + '</strong>')
.replace('@s3', '<strong>' + $('#range_behavior option:selected').text().toLowerCase() + '</strong>')
.replace('%1$s', '<strong>' + range_inf +' '+ unit + '</strong>')
.replace('%2$s', '<strong>' + range_sup +' '+ unit + '</strong>')
.replace('%3$s', '<strong>' + $('#range_behavior option:selected').text().toLowerCase() + '</strong>')
);
if ($('#is_free_on').attr('checked'))
$('span.is_free').hide();
Expand Down

0 comments on commit 0418978

Please sign in to comment.