Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New language translation: Urdu #329

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,7 @@ <h1>Material You NewTab</h1>
<option value="tr">Türkçe (Turkish)</option>
<option value="uz">O'zbek (Uzbek)</option>
<option value="vi">Tiếng Việt (Vietnamese)</option>
<option value="ur">اردو (Urdu)</option>
<!-- Place new language alphabetically -->
</select>
<!-- end of languageSelector -->
Expand Down
133 changes: 131 additions & 2 deletions languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,135 @@ const translations = {
"failedbackup": "Échec de la sauvegarde: ",
"restorecompleted": "Restauration terminée avec succès!",
"restorefailed": "Échec de la restauration: ",
}
},

// Urdu
"ur": {
// Menu Items
"feedback": "فیڈ بیک",
"resetsettings": "ترتیبات ری سیٹ کریں",
"menuCloseText": "بند کریں",
// Shortcuts
"shortcutsText": "شارٹ کٹس",
"enableShortcutsText": "محفوظ کردہ شارٹ کٹس دکھائیں",
"editShortcutsText": "شارٹ کٹس میں ترمیم کریں",
"shortcutsInfoText": "انتخاب کریں کہ کون سے شارٹ کٹس دکھائے جائیں",
"editShortcutsList": "محفوظ کردہ شارٹ کٹس",
"editShortcutsListInfo": "آپ '+' آئیکن پر کلک کرکے نئے شارٹ کٹس شامل کرسکتے ہیں، یا موجودہ شارٹ کٹس کے نام یا یو آر ایل پر کلک کرکے ترمیم کرسکتے ہیں۔",
"adaptiveIconText": "موافقت پذیر آئیکن کی شکلیں",
"adaptiveIconInfoText": "شارٹ کٹ آئیکنز چھوٹے نظر آئیں گے",
"ai_tools_button": "اے آئی ٹولز",
"enable_ai_tools": "اے آئی ٹولز کے لیے شارٹ کٹس دکھائیں",
"googleAppsMenuText": "Google Apps",
prem-k-r marked this conversation as resolved.
Show resolved Hide resolved
"googleAppsMenuInfo": "گوگل ایپس کے لیے شارٹ کٹس دکھائیں",
"todoListText": "To Do List",
prem-k-r marked this conversation as resolved.
Show resolved Hide resolved
"todoListInfo": "یومیہ ٹو ڈو لسٹ دکھائیں",
// Digital Clock
"digitalclocktittle": "ڈیجیٹل گھڑی",
"digitalclockinfo": "ڈیجیٹل گھڑی پر جائیں",
"timeformattittle": "12 گھنٹوں کی شکل",
"timeformatinfo": "12 گھنٹے کی شکل استعمال کریں",
"greetingtittle": "سلام",
"greetinginfo": "کسٹم ٹیکسٹ کے نیچے سلام دکھائیں",
// Misc
"userTextTitle": "حسب ضرورت ٹیکسٹ",
"userTextInfo": "گھڑی کے نیچے اپنا ٹیکسٹ دکھائیں",
"fahrenheitCelsiusCheckbox": "فارن ہائیٹ پر تبدیل کریں",
"fahrenheitCelsiusText": "تبدیلیوں کے لیے صفحہ ریفریش کریں",
"micIconTitle": "مائیکروفون آئیکن چھپائیں",
"micIconInfo": "اگر آواز سے ٹائپنگ کام نہیں کر رہی",
"hideSearchWith": "سرچ انجن چھپائیں",
"hideSearchWithInfo": "سرچ انجن تبدیل کرنے کے لیے آئیکن پر کلک کریں",
"search_suggestions_button": "سرچ تجاویز",
"search_suggestions_text": "سرچ تجاویز فعال کریں",
// Proxy
"useproxytitletext": "پراکسی بائی پاس",
"useproxyText": "اگر سرچ تجاویز کام نہیں کر رہیں",
"ProxyText": "CORS بائی پاس پراکسی",
"ProxySubtext": "اپنی CORS بائی پاس پراکسی شامل کریں",
"HostproxyButton": "اپنی پراکسی ہوسٹ کریں",
"saveproxy": "محفوظ کریں",
// Location
"UserLocText": "اپنا مقام درج کریں",
"UserLocSubtext": "اگر موسم کا مقام درست نہیں ہے",
"userLoc": "آپ کا شہر یا نقاط (عرض البلد، طول البلد)",
"InputOptionsButton": "اندراج کے اختیارات",
"saveLoc": "محفوظ کریں",
// Weather
"WeatherApiText": "اپنی WeatherAPI کلید درج کریں",
"WeatherApiSubtext": "اگر موسم کی فعالیت کام نہیں کر رہی",
"userAPI": "آپ کی weatherAPI کلید",
"LearnMoreButton": "مزید جانیں",
"saveAPI": "محفوظ کریں",
// End of Menu Items

// Body Items
// Calendar
"days": ["اتوار", "پیر", "منگل", "بدھ", "جمعرات", "جمعہ", "ہفتہ"],
"months": ["جنوری", "فروری", "مارچ", "اپریل", "مئی", "جون", "جولائی", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"],
// End of Calendar

// Weather
"humidityLevel": "نمی",
"feelsLike": "محسوس",
"location": "زمین",
// End of Weather

// New Tab Item
"conditionText": "ہیلو! آج آپ کیسے ہیں؟",
"enterBtn": "تلاش کریں",
"searchPlaceholder": "یہاں لکھیں...",
"listenPlaceholder": "سن رہا ہے...",
"todoPlaceholder": "کام شامل کریں...",
"searchWithHint": "کے ساتھ تلاش کریں",
"ai_tools": "اے آئی ٹولز",
"userText": "ترمیم کے لیے یہاں کلک کریں",
"googleAppsHover": "Google Apps",
"todoListHover": "ToDo List",
prem-k-r marked this conversation as resolved.
Show resolved Hide resolved
// End of Body and New Tab Items

// Greeting
"greeting": {
"morning": "صبح بخیر!",
"afternoon": "دوپہر بخیر!",
"evening": "شام بخیر!"
},

// Search Engines and rest
"googleEngine": "گوگل",
"duckEngine": "ڈَک",
"bingEngine": "بِنگ",
"braveEngine": "بریو",
"youtubeEngine": "یوٹیوب",
"chatGPT": "چیٹ جی پی ٹی",
"gemini": "جیمنائی",
"copilot": "کوپائلٹ",
"perplexity": "پرپلکسیٹی",
"firefly": "اڈوب فائر فلائی",
"metaAI": "میٹا اے آئی",
"github": "گٹ ہب",

// Wallpaper and alerts
"uploadWallpaperText": "وال پیپر اپلوڈ کریں",
"backupText": "بیک اپ",
"restoreText": "بحال کریں",
"rangColor": "رنگ چنیں",
"reloadHint": "تھیمز لاگو کرنے کے بعد صفحہ دوبارہ لوڈ کریں",

// Dialog boxes (alerts)
"confirmWallpaper": "کیا آپ آج کے لیے ایک نئی تصویر کو وال پیپر کے طور پر سیٹ کرنا چاہتے ہیں؟",
"confirmRestore": "کیا آپ واقعی اپنی ترتیبات ری سیٹ کرنا چاہتے ہیں؟ یہ عمل واپس نہیں ہو سکے گا۔",
"Nobackgroundset": "اس وقت کوئی پس منظر تصویر سیٹ نہیں ہے۔",
"clearbackgroundimage": "کیا آپ واقعی پس منظر کی تصویر کو ہٹانا چاہتے ہیں؟",
"confirmbackup": "کیا آپ واقعی اپنی ترتیبات کا بیک اپ لینا چاہتے ہیں؟",
"ProxyDisclaimer": "تمام پراکسی فیچرز ڈیفالٹ طور پر بند ہیں۔\n\nاگر آپ سرچ تجاویز اور CORS بائی پاس پراکسی کو فعال کرتے ہیں تو بہتر رازداری کے لیے اپنی پراکسی کو ہوسٹ کرنا سختی سے مشورہ دیا جاتا ہے۔\n\nڈیفالٹ طور پر پراکسی https://mynt-proxy.rhythmcorehq.com پر سیٹ ہوگی، اس کا مطلب ہے کہ آپ کا سارا ڈیٹا اس سروس کے ذریعے گزرے گا، جو رازداری کے مسائل پیدا کر سکتا ہے۔",
"endlink": "لنک کے آخر میں / نہیں ہونا چاہیے",
"onlylinks": "صرف لنکس (http:// یا https:// سے شروع) کی اجازت ہے۔",
"imagedimensions": "انتباہ: اپلوڈ کی گئی تصویر کے سائز ({width}x{height}) 1920x1080 پکسلز سے زیادہ ہیں۔ \n\nاس سے کارکردگی متاثر ہو سکتی ہے یا تصویر مناسب طور پر لوڈ نہیں ہو پائے گی۔",
"failedbackup": "بیک اپ ناکام ہوگیا: ",
"restorecompleted": "بحالی کامیابی سے مکمل ہوگئی!",
"restorefailed": "بحالی ناکام ہوگئی: "
},
};

// Define the width of the menu container for each language
Expand All @@ -1822,6 +1950,7 @@ const menuWidths = {
idn: '415px',
tr: '418px',
fr: '490px',
ur: '450px',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, please remove

// Add more languages and widths as needed
};

Expand All @@ -1835,7 +1964,7 @@ function localizeNumbers(text, language) {
const map = numberMappings[language]; // Get the numeral map for the current language

// Define languages that use a comma as the decimal separator instead of a dot
const specialDecimalLanguages = ['cs', 'it', 'pt', 'ru', 'tr', 'vi', 'uz', 'es', 'ko', 'idn', 'fr']; // Add more languages here as needed
const specialDecimalLanguages = ['cs', 'it', 'pt', 'ru', 'tr', 'vi', 'uz', 'es', 'ko', 'idn', 'fr', 'ur']; // Add more languages here as needed
Copy link
Collaborator

@prem-k-r prem-k-r Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please confirm for decimal separator (28.6), comma is used (=28,6)
isn't dot or ۔ (Arabic decimal separator) used?


if (specialDecimalLanguages.includes(language)) {
// Replace decimal point with a comma for specific languages
Expand Down
2 changes: 2 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ function updateDate() {
vi: `${dayName}, Ngày ${dayOfMonth} ${monthName}`,
idn: `${dayName}, ${dayOfMonth} ${monthName}`,
fr: `${dayName.substring(0, 3)}, ${dayOfMonth} ${monthName.substring(0, 3)}`, //Jeudi, 5 avril
ur: `${dayName}, ${dayOfMonth} ${monthName}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urdu version comma ، will be used, no?

default: `${dayName.substring(0, 3)}, ${monthName.substring(0, 3)} ${localizedDayOfMonth}`
};
document.getElementById("date").innerText = dateDisplay[currentLanguage] || dateDisplay.default;
Expand Down Expand Up @@ -630,6 +631,7 @@ function updatedigiClock() {
vi: `${dayOfMonth} ${dayName}`,
idn: `${dayOfMonth} ${dayName}`,
fr: `${dayName} ${dayOfMonth}`, //Mardi 11
ur: `${dayName}, ${dayOfMonth}`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here ،

default: `${localizedDayOfMonth} ${dayName.substring(0, 3)}`, // e.g., "24 Thu"
};
const dateString = dateFormats[currentLanguage] || dateFormats.default;
Expand Down