Skip to content

Commit

Permalink
tag: add code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Mar 7, 2024
1 parent e5f2691 commit 8175362
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/friendlytag.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,14 +1440,22 @@ Twinkle.tag.callbacks = {
var templateText;

var text, summary;
// {{Rough translation}}
// Use {{subst:Duflu}}
// Place in section == Translated pages that could still use some cleanup ==
if (params.tags.indexOf('Rough translation') !== -1) {
templateText = '{{subst:duflu|pg=' + Morebits.pageNameNorm + '|Language=' +
(lang || 'uncertain') + '|Comments=' + reason.trim() + '}} ~~~~';
// Append to end of page
text = old_text + '\n\n' + templateText;
summary = 'Translation cleanup requested on ';
// {{Not English}}
// Use {{subst:Needtrans}}
// Place in section == Pages for consideration ==
} else {
templateText = '{{subst:needtrans|pg=' + Morebits.pageNameNorm + '|Language=' +
(lang || 'uncertain') + '|Comments=' + reason.trim() + '}} ~~~~';
// Place above section "Translated pages that could still use some cleanup"
text = old_text.replace(/\n+(==\s?Translated pages that could still use some cleanup\s?==)/,
'\n\n' + templateText + '\n\n$1');
summary = 'Translation' + (lang ? ' from ' + lang : '') + ' requested on ';
Expand Down

0 comments on commit 8175362

Please sign in to comment.