Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: Translation popup showing HTML rather then rendering (#133)
Browse files Browse the repository at this point in the history
* fix: Translation popup showing HTML rather then rendering

* chore: Exclude CSS/JS from PHPCS

* fix: Update phpcs.xml.dist

Co-authored-by: JoshuaLicense <JoshuaLicense@users.noreply.github.com>

* fix: remove unused args

* fix: Accidental line removal

---------

Co-authored-by: JoshuaLicense <JoshuaLicense@users.noreply.github.com>
  • Loading branch information
wadedvsa and JoshuaLicense authored Mar 27, 2024
1 parent abd5b1a commit 235e61f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions module/Admin/assets/js/inline/forms/translation-key-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ $(function () {
var current = " current";
$.each(result.languages, function (idx, lang) {
var hideClass = (idx === "en_GB") ? "" : " js-hidden";
var tabTemplate =
` < li id = "tab{idx}" class = "horizontal-navigation__item transKeyTab${current}" data - lang = "${idx}" style = "padding: 0px; margin: 0px;" >
< a class = "govuk-link" id = "transKeyEnGB" href = "#" > ${lang.label} < / a >
< / li > `;
var textAreaTemplate =
` < div class = "langFields field ${hideClass}" >
< textarea name = "fields[translationsArray][${idx}]" id = "input-${idx}" class = "extra-long" > < / textarea >
< / div > `;
var tabTemplate = `
<li id="tab{idx}" class="horizontal-navigation__item transKeyTab${current}" data-lang="${idx}" style="padding: 0px; margin: 0px;">
<a class="govuk-link" id="transKeyEnGB" href="#">${lang.label}</a>
</li>
`;
var textAreaTemplate = `
<div class="langFields field ${hideClass}">
<textarea name="fields[translationsArray][${idx}]" id="input-${idx}" class="extra-long"></textarea>
</div>
`;
$("#languageTabs").append(tabTemplate);
fieldset.prepend(textAreaTemplate);
current = "";
});
fieldset.removeClass("hidden");
if (addedit == "edit") {
if (addedit === "edit") {
getTranslatedText();
} else {
$("#mainForm").removeClass("js-hidden");
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<file>./config</file>
<file>./test</file>

<extensions>php</extensions>
<arg name="extensions" value="php" />
<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="./vendor-bin/phpcs/vendor/dvsa/coding-standards/src/Profiles/DVSA/CS/ruleset.xml" />
Expand Down

0 comments on commit 235e61f

Please sign in to comment.