FORGET ABOUT ME - Streetwear Artigianale Made in Italy
ABOUT US
FORGET ABOUT ME
Made in Italy. Limited drops. No compromises.
FW25 DROP
GLOBAL TAKE OFF - AVAILABLE NOW
// Detect browser language
function detectLanguage() {
const browserLang = navigator.language || navigator.userLanguage;
const langCode = browserLang.split('-')[0];
if (translations[langCode]) {
return langCode;
}
return 'it';
}
// Update page content
function updateContent(lang) {
const t = translations[lang];
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (t[key]) {
if (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA') {
el.placeholder = t[key];
} else {
el.textContent = t[key];
}
}
});
document.title = t['page-title'];
document.getElementById('page-title').textContent = t['page-title'];
document.getElementById('meta-title').setAttribute('content', t['page-title']);
document.getElementById('meta-description').setAttribute('content', t['meta-description']);
document.getElementById('meta-keywords').setAttribute('content', t['meta-keywords']);
document.getElementById('og-title').setAttribute('content', t['page-title']);
document.getElementById('og-description').setAttribute('content', t['meta-description']);
document.getElementById('og-locale').setAttribute('content', t['og-locale']);
document.getElementById('twitter-title').setAttribute('content', t['page-title']);
document.getElementById('twitter-description').setAttribute('content', t['meta-description']);
document.documentElement.lang = lang;
document.getElementById('language-select').value = lang;
// Use sessionStorage instead of localStorage for Shopify compatibility
try {
sessionStorage.setItem('preferredLanguage', lang);
} catch(e) {
console.log('Session storage not available');
}
}
// Change language function
function changeLanguage(lang) {
updateContent(lang);
const newUrl = lang === 'it' ? '/' : `/${lang}/`;
window.history.pushState({lang: lang}, '', newUrl);
}
// Initialize on page load
document.addEventListener('DOMContentLoaded', function() {
let lang;
try {
lang = sessionStorage.getItem('preferredLanguage');
} catch(e) {
lang = null;
}
if (!lang) {
lang = detectLanguage();
}
updateContent(lang);
// Smooth scroll
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
});
});
});
// Shopify Analytics tracking (if needed)
const heroVideo = document.getElementById('hero-video');
if (heroVideo) {
heroVideo.addEventListener('loadedmetadata', function() {
this.currentTime = 10;
});
}
// Shopify Analytics tracking (if needed)
if (typeof Shopify !== 'undefined' && Shopify.analytics) {
document.querySelectorAll('.product-card').forEach(card => {
card.addEventListener('click', function() {
const productHandle = this.getAttribute('data-product-handle');
if (productHandle && Shopify.analytics.publish) {
Shopify.analytics.publish('product_clicked', {
productHandle: productHandle
});
}
});
});
}