Skip to content

Commit

Permalink
Fix eslint warnings in rosetta.js
Browse files Browse the repository at this point in the history
  • Loading branch information
balazs-endresz committed Sep 21, 2024
1 parent b0cdc82 commit 853ba79
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions rosetta/static/admin/rosetta/js/rosetta.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ $(document).ready(function () {
$("a.suggest").click(function (e) {
e.preventDefault();
var a = $(this);
var str = a.html();
var orig = $(".original .message", a.parents("tr")).html();
var trans = $("textarea", a.parent());
var sourceLang = rosetta_settings.MESSAGES_SOURCE_LANGUAGE_CODE;
Expand All @@ -44,7 +43,7 @@ $(document).ready(function () {
unescape(data.translation)
.replace(/'/g, "'")
.replace(/"/g, '"')
.replace(/%\s+(\([^\)]+\))\s*s/g, " %$1s "),
.replace(/%\s+(\([^)]+\))\s*s/g, " %$1s "),
);
a.hide();
} else {
Expand All @@ -57,7 +56,6 @@ $(document).ready(function () {
$("a.suggest").click(function (e) {
e.preventDefault();
var a = $(this);
var str = a.html();
var orig = $(".original .message", a.parents("tr")).html();
var trans = $("textarea", a.parent());
var apiUrl = "https://translate.yandex.net/api/v1.5/tr.json/translate";
Expand Down Expand Up @@ -101,7 +99,7 @@ $(document).ready(function () {
}
}

$("td.plural").each(function (i) {
$("td.plural").each(function () {
var td = $(this);
var trY = parseInt(td.closest("tr").offset().top);
$("textarea", $(this).closest("tr")).each(function (j) {
Expand All @@ -114,7 +112,7 @@ $(document).ready(function () {
.blur(function () {
if ($(this).val()) {
$(".alert", $(this).parents("tr")).remove();
var RX = /%(?:\([^\s\)]*\))?[sdf]|\{[\w\d_]+?\}/g;
var RX = /%(?:\([^\s)]*\))?[sdf]|\{[\w\d_]+?\}/g;
var origs = $(this).parents("tr").find(".original span").html().match(RX);
var trads = $(this).val().match(RX);
var error = $('<span class="alert">Unmatched variables</span>');
Expand Down

0 comments on commit 853ba79

Please sign in to comment.