feat(localization): update and enhance localization files for multiple languages
- Updated localization files for various languages, including English, German, Spanish, Portuguese, and Chinese, to ensure consistency and accuracy across the application. - Added new keys and updated existing ones to support recent UI changes and features, particularly in project views, task lists, and admin center settings. - Enhanced the structure of localization files to improve maintainability and facilitate future updates. - Implemented performance optimizations in the frontend components to better handle localization data.
This commit is contained in:
@@ -66,7 +66,7 @@ class AnalyticsManager {
|
||||
|
||||
// Add event listener to button
|
||||
const btn = notice.querySelector('#analytics-notice-btn');
|
||||
btn.addEventListener('click', (e) => {
|
||||
btn.addEventListener('click', e => {
|
||||
e.preventDefault();
|
||||
localStorage.setItem('privacyNoticeShown', 'true');
|
||||
notice.remove();
|
||||
@@ -77,7 +77,7 @@ class AnalyticsManager {
|
||||
* Check if privacy notice should be shown
|
||||
*/
|
||||
checkPrivacyNotice() {
|
||||
const isProduction =
|
||||
const isProduction =
|
||||
window.location.hostname === 'worklenz.com' ||
|
||||
window.location.hostname === 'app.worklenz.com';
|
||||
const noticeShown = localStorage.getItem('privacyNoticeShown') === 'true';
|
||||
@@ -94,4 +94,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const analytics = new AnalyticsManager();
|
||||
analytics.init();
|
||||
analytics.checkPrivacyNotice();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,10 +24,10 @@ class HubSpotManager {
|
||||
script.async = true;
|
||||
script.defer = true;
|
||||
script.src = this.scriptSrc;
|
||||
|
||||
|
||||
// Configure dark mode after script loads
|
||||
script.onload = () => this.setupDarkModeSupport();
|
||||
|
||||
|
||||
document.body.appendChild(script);
|
||||
};
|
||||
|
||||
@@ -45,26 +45,26 @@ class HubSpotManager {
|
||||
setupDarkModeSupport() {
|
||||
const applyTheme = () => {
|
||||
const isDark = document.documentElement.classList.contains('dark');
|
||||
|
||||
|
||||
// Remove existing theme styles
|
||||
const existingStyle = document.getElementById(this.styleId);
|
||||
if (existingStyle) {
|
||||
existingStyle.remove();
|
||||
}
|
||||
|
||||
|
||||
if (isDark) {
|
||||
this.injectDarkModeCSS();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Apply initial theme after delay to ensure widget is loaded
|
||||
setTimeout(applyTheme, 1000);
|
||||
|
||||
|
||||
// Watch for theme changes
|
||||
const observer = new MutationObserver(applyTheme);
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['class']
|
||||
attributeFilter: ['class'],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class HubSpotManager {
|
||||
cleanup() {
|
||||
const script = document.getElementById(this.scriptId);
|
||||
const style = document.getElementById(this.styleId);
|
||||
|
||||
|
||||
if (script) script.remove();
|
||||
if (style) style.remove();
|
||||
}
|
||||
@@ -131,7 +131,7 @@ class HubSpotManager {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const hubspot = new HubSpotManager();
|
||||
hubspot.init();
|
||||
|
||||
|
||||
// Make available globally for potential cleanup
|
||||
window.HubSpotManager = hubspot;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user