MediaWiki:Common.js: Revizyonlar arasındaki fark
MediaWiki arayüz sayfası
More actions
C. Karakuş (mesaj | katkılar) Değişiklik özeti yok |
C. Karakuş (mesaj | katkılar) Değişiklik özeti yok |
||
| 1. satır: | 1. satır: | ||
// Citizen Komut Paleti Eksiksiz Türkçeleştirme | |||
// Citizen Komut Paleti | |||
const observer = new MutationObserver((mutations) => { | const observer = new MutationObserver((mutations) => { | ||
mutations.forEach((mutation) => { | mutations.forEach((mutation) => { | ||
| 119. satır: | 5. satır: | ||
if (palette) { | if (palette) { | ||
// 1. "Recent" Başlığı İçin Derin Arama | // 1. "Recent" Başlığı İçin Derin Arama | ||
const allElements = palette.querySelectorAll('*'); | const allElements = palette.querySelectorAll('*'); | ||
allElements.forEach(el => { | allElements.forEach(el => { | ||
if (el.childNodes.length === 1 && el.textContent.trim() === 'Recent') { | if (el.childNodes.length === 1 && el.textContent.trim() === 'Recent') { | ||
el.textContent = 'Son Aramalar'; | el.textContent = 'Son Aramalar'; | ||
| 128. satır: | 13. satır: | ||
}); | }); | ||
// 2. Sağ taraftaki "Page" ve "Action" Rozetleri | // 2. Sağ taraftaki "Page" ve "Action" Rozetleri (İnatçı Yapı İçin Kesin Çözüm) | ||
const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"]'); | const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"], .citizen-command-palette__item-badge'); | ||
badges.forEach(badge => { | badges.forEach(badge => { | ||
// İç elemanları temizleyip sadece saf metne odaklanarak değiştiriyoruz | |||
const text = badge.textContent.trim(); | const text = badge.textContent.trim(); | ||
if (text === 'Page') badge. | if (text === 'Page') { | ||
if (text === 'Action') badge. | badge.innerHTML = 'Sayfa'; | ||
} else if (text === 'Action') { | |||
badge.innerHTML = 'Eylem'; | |||
} | |||
}); | }); | ||
| 144. satır: | 33. satır: | ||
}); | }); | ||
// 4. Sol alttaki Alt Not | // 4. Sol alttaki Değişken Alt Not Alanları (Tüm Varyasyonlar) | ||
const note = palette.querySelector('[class*="footer-note"]'); | const note = palette.querySelector('[class*="footer-note"]'); | ||
if (note) { | if (note) { | ||
const noteHTML = note.innerHTML; | |||
if (noteHTML.includes('for all commands') || noteHTML.includes('all commands')) { | |||
note.innerHTML = 'Tüm komutlar için <code>/</code> yazın'; | note.innerHTML = 'Tüm komutlar için <code>/</code> yazın'; | ||
} else if ( | } else if (noteHTML.includes('for namespace') || noteHTML.includes('namespace')) { | ||
note.innerHTML = 'Ad alanlarında aramak için <code>:</code> yazın'; | note.innerHTML = 'Ad alanlarında aramak için <code>:</code> yazın'; | ||
} else if (noteHTML.includes('to search for users') || noteHTML.includes('for users')) { | |||
note.innerHTML = 'Kullanıcıları aramak için <code>@</code> yazın'; | |||
} else if (noteHTML.includes('to search for templates') || noteHTML.includes('for templates')) { | |||
note.innerHTML = 'Şablonları aramak için <code>{{</code> yazın'; | |||
} | } | ||
} | } | ||
10.47, 7 Temmuz 2026 tarihindeki hâli
// Citizen Komut Paleti Eksiksiz Türkçeleştirme
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
const palette = document.querySelector('.citizen-command-palette');
if (palette) {
// 1. "Recent" Başlığı İçin Derin Arama
const allElements = palette.querySelectorAll('*');
allElements.forEach(el => {
if (el.childNodes.length === 1 && el.textContent.trim() === 'Recent') {
el.textContent = 'Son Aramalar';
}
});
// 2. Sağ taraftaki "Page" ve "Action" Rozetleri (İnatçı Yapı İçin Kesin Çözüm)
const badges = palette.querySelectorAll('[class*="badge"], [class*="item-badge"], .citizen-command-palette__item-badge');
badges.forEach(badge => {
// İç elemanları temizleyip sadece saf metne odaklanarak değiştiriyoruz
const text = badge.textContent.trim();
if (text === 'Page') {
badge.innerHTML = 'Sayfa';
} else if (text === 'Action') {
badge.innerHTML = 'Eylem';
}
});
// 3. "Create or edit page" Açıklamaları
const descriptions = palette.querySelectorAll('[class*="description"], [class*="item-description"]');
descriptions.forEach(desc => {
if (desc.textContent.trim() === 'Create or edit page') {
desc.textContent = 'Sayfa oluştur veya düzenle';
}
});
// 4. Sol alttaki Değişken Alt Not Alanları (Tüm Varyasyonlar)
const note = palette.querySelector('[class*="footer-note"]');
if (note) {
const noteHTML = note.innerHTML;
if (noteHTML.includes('for all commands') || noteHTML.includes('all commands')) {
note.innerHTML = 'Tüm komutlar için <code>/</code> yazın';
} else if (noteHTML.includes('for namespace') || noteHTML.includes('namespace')) {
note.innerHTML = 'Ad alanlarında aramak için <code>:</code> yazın';
} else if (noteHTML.includes('to search for users') || noteHTML.includes('for users')) {
note.innerHTML = 'Kullanıcıları aramak için <code>@</code> yazın';
} else if (noteHTML.includes('to search for templates') || noteHTML.includes('for templates')) {
note.innerHTML = 'Şablonları aramak için <code>{{</code> yazın';
}
}
// 5. Alt taraftaki Tuş İpuçları
const hints = palette.querySelectorAll('[class*="keyboard-hint"]');
hints.forEach(hint => {
const label = hint.querySelector('[class*="label"]');
if (label) {
const text = label.textContent.trim();
if (text === 'Select') label.textContent = 'Seç';
else if (text === 'Navigate') label.textContent = 'Gezin';
else if (text === 'Actions') label.textContent = 'Eylemler';
else if (text === 'Close') label.textContent = 'Kapat';
}
});
}
});
});
// Sayfayı izlemeye al
observer.observe(document.body, { childList: true, subtree: true });