Common English Phrases in Urdu | Daily Conversation - Urdupro.info
Common English Phrases in Urdu
Master daily conversation with essential phrases
// Render each category
Object.keys(groupedPhrases).forEach(category => {
const categoryTitle = category.charAt(0).toUpperCase() + category.slice(1);
const categoryPhrases = groupedPhrases[category];
const categorySection = document.createElement('div');
categorySection.className = 'mb-5';
categorySection.innerHTML = `
${categoryPhrases.map(phrase => `
${phrase.english}
${phrase.urdu}
${phrase.roman}
`).join('')}
`;
container.appendChild(categorySection);
});
}
function getCategoryIcon(category) {
const icons = {
'greetings': 'hand-wave',
'courtesy': 'heart',
'questions': 'question-circle',
'daily': 'calendar-day',
'emotions': 'smile',
'time': 'clock',
'food': 'utensils',
'travel': 'plane',
'work': 'briefcase',
'shopping': 'shopping-cart',
'emergency': 'exclamation-triangle',
'education': 'book',
'socializing': 'users'
};
return icons[category] || 'comment';
}
function speakPhrase(text) {
if ('speechSynthesis' in window) {
const utterance = new SpeechSynthesisUtterance(text);
utterance.lang = 'en-US';
speechSynthesis.speak(utterance);
}
}
function filterPhrases() {
const searchTerm = document.getElementById('phrase-search').value.toLowerCase();
const category = document.getElementById('category-filter').value;
filteredPhrases = commonPhrases.filter(phrase => {
const matchesSearch = phrase.english.toLowerCase().includes(searchTerm) ||
phrase.urdu.includes(searchTerm) ||
phrase.roman.toLowerCase().includes(searchTerm);
const matchesCategory = !category || phrase.category === category;
return matchesSearch && matchesCategory;
});
renderPhrases();
}
// Event listeners
document.getElementById('phrase-search').addEventListener('input', filterPhrases);
document.getElementById('category-filter').addEventListener('change', filterPhrases);
// Initialize
document.addEventListener('DOMContentLoaded', function() {
renderPhrases();
});