AI_Game / js /languages.js
ducnguyen1978's picture
Upload folder using huggingface_hub
815d041 verified
// Language management for AI Friends Talk
const languages = {
en: {
title: "AI Friends Talk",
subtitle: "Watch AI friends debate fun topics!",
instructions: "Choose a topic and watch Alex, Blake, and Charlie discuss it. You can also join the conversation!",
chooseTopic: "Choose a Topic",
selectTopic: "Select a fun topic for debate:",
customTopic: "Or enter your own topic:",
startConversation: "Start Conversation",
pauseConversation: "Pause",
continueConversation: "Continue",
clearChat: "Clear Chat",
addMessage: "Add Your Message",
typeMessage: "Type your message to join the conversation:",
sendMessage: "Send Message",
setTopic: "Set",
conversation: "Conversation",
topic: "Topic",
thinking: "is thinking...",
conversationComplete: "Conversation completed!",
you: "You",
madeBy: "Made by Digitized Brains",
// Characters
alex: "Alex - The witty debater (Groq AI)",
blake: "Blake - The creative optimist (Gemini 2.0)",
charlie: "Charlie - The logical analyst (Gemini 1.5)",
// Topics
topics: [
"If animals could use smartphones, which app would be most popular?",
"What would happen if gravity worked backwards for one day?",
"Should pineapple on pizza be considered a crime?",
"If you could add a 13th month to the year, what would you name it?",
"What's the most useless superpower you can think of?",
"If colors had personalities, what would each color be like?",
"Should robots have to pay taxes?",
"What would the world be like if everyone could read minds?",
"If you could make one rule that everyone had to follow, what would it be?",
"What's the weirdest food combination that actually tastes good?",
"If you could live inside any video game, which would you choose and why?",
"What would happen if all cats suddenly learned how to speak human language?",
"Should there be a maximum limit on how many selfies you can take per day?",
"If you could give any animal the ability to fly, which would be the funniest?",
"What's the most ridiculous thing humans do that aliens would find confusing?",
"If social media existed in medieval times, what would people post about?",
"Should there be professional competitions for everyday activities like making beds?",
"What would change if humans hibernated for 3 months every year?",
"If you could replace one everyday sound with any other sound, what would it be?",
"What's the most absurd job that could exist in the future?"
]
},
vi: {
title: "AI Friends Talk",
subtitle: "Xem các AI bạn tranh luận về những chủ đề vui vẻ!",
instructions: "Chọn một chủ đề và xem Alex, Blake và Charlie thảo luận về nó. Bạn cũng có thể tham gia cuộc trò chuyện!",
chooseTopic: "Chọn Chủ Đề",
selectTopic: "Chọn một chủ đề thú vị để tranh luận:",
customTopic: "Hoặc nhập chủ đề của riêng bạn:",
startConversation: "Bắt Đầu Trò Chuyện",
pauseConversation: "Tạm Dừng",
continueConversation: "Tiếp Tục",
clearChat: "Xóa Trò Chuyện",
addMessage: "Thêm Tin Nhắn Của Bạn",
typeMessage: "Nhập tin nhắn của bạn để tham gia cuộc trò chuyện:",
sendMessage: "Gửi Tin Nhắn",
setTopic: "Đặt",
conversation: "Cuộc Trò Chuyện",
topic: "Chủ đề",
thinking: "đang suy nghĩ...",
conversationComplete: "Cuộc trò chuyện hoàn thành!",
you: "Bạn",
madeBy: "Được tạo bởi Digitized Brains",
// Characters
alex: "Alex - Người tranh luận dí dỏm (Groq AI)",
blake: "Blake - Người lạc quan sáng tạo (Gemini 2.0)",
charlie: "Charlie - Nhà phân tích logic (Gemini 1.5)",
// Topics
topics: [
"Nếu động vật có thể sử dụng smartphone, ứng dụng nào sẽ phổ biến nhất?",
"Điều gì sẽ xảy ra nếu trọng lực hoạt động ngược lại trong một ngày?",
"Có nên coi dứa trên pizza là tội phạm không?",
"Nếu bạn có thể thêm tháng thứ 13 vào năm, bạn sẽ đặt tên gì?",
"Siêu năng lực vô dụng nhất mà bạn có thể nghĩ ra là gì?",
"Nếu màu sắc có tính cách, mỗi màu sẽ như thế nào?",
"Robot có nên phải trả thuế không?",
"Thế giới sẽ như thế nào nếu mọi người đều có thể đọc suy nghĩ?",
"Nếu bạn có thể đặt ra một quy tắc mà mọi người phải tuân theo, đó sẽ là gì?",
"Sự kết hợp thực phẩm kỳ lạ nhất mà thực sự ngon là gì?",
"Nếu bạn có thể sống trong bất kỳ trò chơi điện tử nào, bạn sẽ chọn cái nào và tại sao?",
"Điều gì sẽ xảy ra nếu tất cả mèo đột nhiên học được cách nói tiếng người?",
"Có nên có giới hạn tối đa về số lần selfie bạn có thể chụp mỗi ngày không?",
"Nếu bạn có thể cho bất kỳ động vật nào khả năng bay, con nào sẽ hài hước nhất?",
"Điều kỳ lạ nhất mà con người làm khiến người ngoài hành tinh cảm thấy khó hiểu là gì?",
"Nếu mạng xã hội tồn tại thời trung cổ, mọi người sẽ đăng gì?",
"Có nên có các cuộc thi chuyên nghiệp cho các hoạt động hàng ngày như dọn giường không?",
"Điều gì sẽ thay đổi nếu con người ngủ đông 3 tháng mỗi năm?",
"Nếu bạn có thể thay thế một âm thanh hàng ngày bằng âm thanh khác, đó sẽ là gì?",
"Công việc vô lý nhất có thể tồn tại trong tương lai là gì?"
]
},
de: {
title: "AI Friends Talk",
subtitle: "Schaue zu, wie AI-Freunde über lustige Themen diskutieren!",
instructions: "Wählen Sie ein Thema und schauen Sie zu, wie Alex, Blake und Charlie darüber diskutieren. Sie können auch am Gespräch teilnehmen!",
chooseTopic: "Wähle ein Thema",
selectTopic: "Wählen Sie ein lustiges Thema für die Diskussion:",
customTopic: "Oder geben Sie Ihr eigenes Thema ein:",
startConversation: "Gespräch Beginnen",
pauseConversation: "Pausieren",
continueConversation: "Fortsetzen",
clearChat: "Chat Löschen",
addMessage: "Ihre Nachricht Hinzufügen",
typeMessage: "Geben Sie Ihre Nachricht ein, um am Gespräch teilzunehmen:",
sendMessage: "Nachricht Senden",
setTopic: "Setzen",
conversation: "Unterhaltung",
topic: "Thema",
thinking: "denkt nach...",
conversationComplete: "Gespräch beendet!",
you: "Du",
madeBy: "Erstellt von Digitized Brains",
// Characters
alex: "Alex - Der witzige Debattierer (Groq AI)",
blake: "Blake - Der kreative Optimist (Gemini 2.0)",
charlie: "Charlie - Der logische Analyst (Gemini 1.5)",
// Topics
topics: [
"Wenn Tiere Smartphones benutzen könnten, welche App wäre am beliebtesten?",
"Was würde passieren, wenn die Schwerkraft einen Tag lang rückwärts wirken würde?",
"Sollte Ananas auf Pizza als Verbrechen betrachtet werden?",
"Wenn Sie einen 13. Monat zum Jahr hinzufügen könnten, wie würden Sie ihn nennen?",
"Was ist die nutzloseste Superkraft, die Sie sich vorstellen können?",
"Wenn Farben Persönlichkeiten hätten, wie wäre jede Farbe?",
"Sollten Roboter Steuern zahlen müssen?",
"Wie wäre die Welt, wenn jeder Gedanken lesen könnte?",
"Wenn Sie eine Regel aufstellen könnten, die jeder befolgen müsste, was wäre das?",
"Was ist die seltsamste Lebensmittelkombination, die tatsächlich gut schmeckt?",
"Wenn Sie in einem beliebigen Videospiel leben könnten, welches würden Sie wählen und warum?",
"Was würde passieren, wenn alle Katzen plötzlich die menschliche Sprache lernen würden?",
"Sollte es ein maximales Limit für Selfies geben, die man pro Tag machen kann?",
"Wenn Sie einem Tier die Fähigkeit zu fliegen geben könnten, welches wäre am lustigsten?",
"Was ist das Absurdeste, was Menschen tun und Außerirdische verwirrend finden würden?",
"Wenn soziale Medien im Mittelalter existiert hätten, worüber hätten die Leute gepostet?",
"Sollte es professionelle Wettbewerbe für alltägliche Aktivitäten wie Bettenmachen geben?",
"Was würde sich ändern, wenn Menschen 3 Monate im Jahr Winterschlaf halten würden?",
"Wenn Sie ein alltägliches Geräusch durch ein anderes ersetzen könnten, was wäre das?",
"Was ist der absurdeste Job, der in der Zukunft existieren könnte?"
]
}
};
// Language switching functionality
let currentLanguage = 'en';
function setLanguage(lang) {
currentLanguage = lang;
updateUI();
// Store language preference
localStorage.setItem('preferredLanguage', lang);
}
function updateUI() {
const lang = languages[currentLanguage];
// Update all text elements
document.querySelectorAll('[data-i18n]').forEach(element => {
const key = element.getAttribute('data-i18n');
if (lang[key]) {
element.textContent = lang[key];
}
});
// Update placeholders
document.querySelectorAll('[data-i18n-placeholder]').forEach(element => {
const key = element.getAttribute('data-i18n-placeholder');
if (lang[key]) {
element.placeholder = lang[key];
}
});
// Update topic options if exists
const topicSelect = document.getElementById('topicSelect');
if (topicSelect) {
topicSelect.innerHTML = '';
lang.topics.forEach((topic, index) => {
const option = document.createElement('option');
option.value = topic;
option.textContent = topic;
topicSelect.appendChild(option);
});
}
}
// Initialize language on page load
document.addEventListener('DOMContentLoaded', function() {
// Get saved language or use browser language
const savedLang = localStorage.getItem('preferredLanguage');
const browserLang = navigator.language.slice(0, 2);
if (savedLang && languages[savedLang]) {
currentLanguage = savedLang;
} else if (languages[browserLang]) {
currentLanguage = browserLang;
}
// Set language selector
const langSelector = document.getElementById('languageSelector');
if (langSelector) {
langSelector.value = currentLanguage;
langSelector.addEventListener('change', function() {
setLanguage(this.value);
});
}
updateUI();
});
// Export for use in other modules
if (typeof module !== 'undefined' && module.exports) {
module.exports = { languages, setLanguage, updateUI, currentLanguage };
}