User:DR/common.js: Difference between revisions
< User:DR
Content deleted Content added
test |
restore Tag: Manual revert |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
importScript('User:DR/UserInfoEN.js'); // Backlink: [[User:DR/UserInfoEN.js]] |
|||
function displayUserInfo(user, language = 'en') { |
|||
const translations = { |
|||
en: { |
|||
registered: "registered", |
|||
edits: "edits", |
|||
contributions: "contributions", |
|||
userPage: "user page", |
|||
talkPage: "talk page", |
|||
}, |
|||
fr: { |
|||
registered: "enregistré", |
|||
edits: "modifications", |
|||
contributions: "contributions", |
|||
userPage: "page utilisateur", |
|||
talkPage: "page de discussion", |
|||
}, |
|||
}; |
|||
const userInfo = { |
|||
registered: `${user.registrationDate} - ${translations[language].registered}`, |
|||
edits: `${user.editCount} ${translations[language].edits}`, |
|||
contributions: `<a href="https://fr.vikidia.org/wiki/Spécial:Contributions/${user.name}">${translations[language].contributions}</a>`, |
|||
userPage: `<a href="https://fr.vikidia.org/wiki/${user.name}">${translations[language].userPage}</a>`, |
|||
talkPage: `<a href="https://fr.vikidia.org/wiki/Discussion_utilisateur:${user.name}">${translations[language].talkPage}</a>`, |
|||
}; |
|||
console.log(userInfo); |
|||
} |