diff --git a/src/gui/src/UI/UIAlert.js b/src/gui/src/UI/UIAlert.js index 370d6321d..2ab565ae7 100644 --- a/src/gui/src/UI/UIAlert.js +++ b/src/gui/src/UI/UIAlert.js @@ -42,11 +42,11 @@ function UIAlert(options) { } // Define alert types const alertTypes = { - error: { icon: "danger.svg", title: "Error!", color: "#D32F2F" }, - warning: { icon: "warning-sign.svg", title: "Warning!", color: "#FFA000" }, - info: { icon: "reminder.svg", title: "Info", color: "#1976D2" }, - success: { icon: "c-check.svg", title: "Success!", color: "#388E3C" }, - confirm: { icon: "question.svg", title: "Are you sure?", color: "#555555" } + error: { icon: "danger.svg", title: i18n('alert_error_title'), color: "#D32F2F" }, + warning: { icon: "warning-sign.svg", title: i18n('alert_warning_title'), color: "#FFA000" }, + info: { icon: "reminder.svg", title: i18n('alert_info_title'), color: "#1976D2" }, + success: { icon: "c-check.svg", title: i18n('alert_success_title'), color: "#388E3C" }, + confirm: { icon: "question.svg", title: i18n('alert_confirm_title'), color: "#555555" } }; // Set default values @@ -60,14 +60,14 @@ function UIAlert(options) { switch (options.type) { case "confirm": options.buttons = [ - { label: "Yes", value: true, type: "primary" }, - { label: "No", value: false, type: "secondary" } + { label: i18n('alert_yes'), value: true, type: "primary" }, + { label: i18n('alert_no'), value: false, type: "secondary" } ]; break; case "error": options.buttons = [ - { label: "Retry", value: "retry", type: "danger" }, - { label: "Cancel", value: "cancel", type: "secondary" } + { label: i18n('alert_retry'), value: "retry", type: "danger" }, + { label: i18n('alert_cancel'), value: "cancel", type: "secondary" } ]; break; default: diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index a7fc9097a..326a42441 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -1163,7 +1163,7 @@ async function UIDesktop(options) { ht += ``; // 'Show Desktop' - ht += ``; + ht += ``; // refer if (window.user.referral_code) { @@ -1772,24 +1772,24 @@ $(document).on('contextmenu taphold', '.taskbar', function (event) { // Only show position submenu on desktop devices if (!isMobile.phone && !isMobile.tablet) { menuItems.push({ - html: "Position", + html: i18n('desktop_position'), items: [ { - html: "Left", + html: i18n('desktop_position_left'), checked: currentPosition === 'left', onClick: function() { window.update_taskbar_position('left'); } }, { - html: "Bottom", + html: i18n('desktop_position_bottom'), checked: currentPosition === 'bottom', onClick: function() { window.update_taskbar_position('bottom'); } }, { - html: "Right", + html: i18n('desktop_position_right'), checked: currentPosition === 'right', onClick: function() { window.update_taskbar_position('right'); @@ -1802,7 +1802,7 @@ $(document).on('contextmenu taphold', '.taskbar', function (event) { // Add the "Show open windows" option for all devices menuItems.push({ - html: "Show open windows", + html: i18n('desktop_show_open_windows'), onClick: function () { $(`.window`).showWindow(); } @@ -1810,7 +1810,7 @@ $(document).on('contextmenu taphold', '.taskbar', function (event) { // Add the "Show the desktop" option for all devices menuItems.push({ - html: "Show the desktop", + html: i18n('desktop_show_desktop'), onClick: function () { $(`.window`).hideWindow(); } @@ -2209,11 +2209,11 @@ document.addEventListener('fullscreenchange', (event) => { if (document.fullscreenElement) { $('.fullscreen-btn').css('background-image', `url(${window.icons['shrink.svg']})`); - $('.fullscreen-btn').attr('title', 'Exit Full Screen'); + $('.fullscreen-btn').attr('title', i18n('desktop_exit_full_screen')); window.user_preferences.clock_visible === 'auto' && $('#clock').show(); } else { $('.fullscreen-btn').css('background-image', `url(${window.icons['fullscreen.svg']})`); - $('.fullscreen-btn').attr('title', 'Enter Full Screen'); + $('.fullscreen-btn').attr('title', i18n('desktop_enter_full_screen')); window.user_preferences.clock_visible === 'auto' && $('#clock').hide(); } }) diff --git a/src/gui/src/UI/UIItem.js b/src/gui/src/UI/UIItem.js index 20a34d2fa..494cf302f 100644 --- a/src/gui/src/UI/UIItem.js +++ b/src/gui/src/UI/UIItem.js @@ -141,7 +141,7 @@ function UIItem(options){ background-color: #ffffff; padding: 2px;" src="${html_encode(window.icons['shared.svg'])}" data-item-id="${item_id}" - title="A user has shared this item with you.">`; + title="${i18n('item_shared_with_you')}">`; // owner-shared badge h += ``; // shortcut badge h += ``; h += ``; @@ -784,7 +784,7 @@ function UIItem(options){ } if(!are_trashed){ menu_items.push({ - html: 'Share With…', + html: i18n('Share With…'), onClick: async function(){ if(window.user.is_temp && !await UIWindowSaveAccount({ @@ -1050,7 +1050,7 @@ function UIItem(options){ } }else{ items.push({ - html: 'No suitable apps found', + html: i18n('no_suitable_apps_found'), disabled: true, }); } @@ -1090,7 +1090,7 @@ function UIItem(options){ // ------------------------------------------- if(!is_trashed && !is_trash){ menu_items.push({ - html: 'Share With…', + html: i18n('Share With…'), onClick: async function(){ if(window.user.is_temp && !await UIWindowSaveAccount({ @@ -1517,7 +1517,7 @@ $(document).on('long-hover', '.item-has-website-badge', function(e){ if(fsentry.subdomains){ let h = `
`; - h += `
Associated website${ fsentry.subdomains.length > 1 ? 's':''}
`; + h += `
${i18n(fsentry.subdomains.length > 1 ? 'item_associated_websites_plural' : 'item_associated_websites')}
`; fsentry.subdomains.forEach(subdomain => { h += ` ${subdomain.address.replace('https://', '')} diff --git a/src/gui/src/UI/UITaskbarItem.js b/src/gui/src/UI/UITaskbarItem.js index ccb3978aa..4377e64e1 100644 --- a/src/gui/src/UI/UITaskbarItem.js +++ b/src/gui/src/UI/UITaskbarItem.js @@ -176,7 +176,7 @@ function UITaskbarItem(options){ //------------------------------------------ if(options.app && options.app !== 'trash'){ menu_items.push({ - html: 'New Window', + html: i18n('new_window'), val: $(this).attr('data-id'), onClick: function(){ // is trash? @@ -192,7 +192,7 @@ function UITaskbarItem(options){ //------------------------------------------ else if(options.app && options.app === 'trash'){ menu_items.push({ - html: 'Open Trash', + html: i18n('open_trash'), val: $(this).attr('data-id'), onClick: function(){ launch_app({ diff --git a/src/gui/src/UI/UIWindow.js b/src/gui/src/UI/UIWindow.js index bcc2df94f..46e311206 100644 --- a/src/gui/src/UI/UIWindow.js +++ b/src/gui/src/UI/UIWindow.js @@ -340,11 +340,11 @@ async function UIWindow(options) { h += `
`; h += `
`; // Back - h += ``; + h += ``; // Forward - h += ``; + h += ``; // Up - h += ``; + h += ``; h += `
`; // Path h += `
${window.navbar_path(options.path, window.user.username)}
`; @@ -403,7 +403,7 @@ async function UIWindow(options) { h += window.explore_table_headers(); // Add 'This folder is empty' message by default - h += `
This folder is empty
`; + h += `
${i18n('window_folder_empty')}
`; h += `
${i18n('error_message_is_missing')}
`; @@ -2206,7 +2206,7 @@ async function UIWindow(options) { } }); menu_items.push({ - html: 'Minimize', + html: i18n('minimize'), onClick: function(){ $(el_window).hideWindow(); } @@ -2219,7 +2219,7 @@ async function UIWindow(options) { //------------------------------------------- if(el_window_app_iframe !== null){ menu_items.push({ - html: 'Reload App', + html: i18n('reload_app'), onClick: function(){ $(el_window_app_iframe).attr('src', $(el_window_app_iframe).attr('src')); } @@ -2231,7 +2231,7 @@ async function UIWindow(options) { // Close // ------------------------------------------- menu_items.push({ - html: 'Close', + html: i18n('close'), onClick: function(){ $(el_window).close(); } @@ -2720,7 +2720,7 @@ $(document).on('contextmenu taphold', '.window-sidebar-item', function(event){ // Open //-------------------------------------------------- { - html: "Open", + html: i18n('open'), onClick: function(){ $(item).trigger('click'); } @@ -2729,7 +2729,7 @@ $(document).on('contextmenu taphold', '.window-sidebar-item', function(event){ // Open in New Window //-------------------------------------------------- { - html: "Open in New Window", + html: i18n('open_in_new_window'), onClick: async function(){ let item_path = $(item).attr('data-path'); @@ -2901,7 +2901,7 @@ $(document).on('contextmenu taphold', '.window-navbar-path-dirname', function(ev // Open // ------------------------------------------- menu_items.push({ - html: 'Open', + html: i18n('open'), onClick: ()=>{ $(this).trigger('click'); } @@ -2911,7 +2911,7 @@ $(document).on('contextmenu taphold', '.window-navbar-path-dirname', function(ev // (only if the item is on a window) // ------------------------------------------- menu_items.push({ - html: 'Open in New Window', + html: i18n('open_in_new_window'), onClick: function(){ UIWindow({ path: $(el).attr('data-path'), @@ -2931,7 +2931,7 @@ $(document).on('contextmenu taphold', '.window-navbar-path-dirname', function(ev // Paste // ------------------------------------------- menu_items.push({ - html: "Paste", + html: i18n('paste'), disabled: window.clipboard.length > 0 ? false : true, onClick: function(){ if(window.clipboard_op === 'copy') @@ -3133,13 +3133,13 @@ window.update_window_path = async function(el_window, target_path){ $(el_window).find('.window-head-title').text(i18n('documents')) }else if (target_path === window.public_path){ $(el_window).find('.window-head-icon').attr('src', window.icons['folder-public.svg']); - $(el_window).find('.window-head-title').text('Public') + $(el_window).find('.window-head-title').text(i18n('window_title_public')) }else if (target_path === window.videos_path){ $(el_window).find('.window-head-icon').attr('src', window.icons['folder-videos.svg']); - $(el_window).find('.window-head-title').text('Videos') + $(el_window).find('.window-head-title').text(i18n('window_title_videos')) }else if (target_path === window.pictures_path){ $(el_window).find('.window-head-icon').attr('src', window.icons['folder-pictures.svg']); - $(el_window).find('.window-head-title').text('Pictures') + $(el_window).find('.window-head-title').text(i18n('window_title_pictures')) }// root folder of a shared user? else if((target_path.split('/').length - 1) === 1 && target_path !== '/'+window.user.username) $(el_window).find('.window-head-icon').attr('src', window.icons['shared.svg']); @@ -3360,18 +3360,18 @@ $.fn.close = async function(options) { // otherwise, change URL/Title to desktop else{ window.history.replaceState(null, document.title, '/'); - document.title = 'Puter'; + document.title = i18n('window_title_puter'); } // if it's explore if($last_window_in_stack.attr('data-app') && $last_window_in_stack.attr('data-app').toLowerCase() === 'explorer'){ window.history.replaceState(null, document.title, '/'); - document.title = 'Puter'; + document.title = i18n('window_title_puter'); } } // otherwise, change URL/Title to desktop else{ window.history.replaceState(null, document.title, '/'); - document.title = 'Puter'; + document.title = i18n('window_title_puter'); } } // close child windows @@ -3753,7 +3753,7 @@ $.fn.hideWindow = async function(options) { // update title and window URL window.history.replaceState(null, document.title, '/'); - document.title = 'Puter'; + document.title = i18n('window_title_puter'); } }) return this; diff --git a/src/gui/src/UI/UIWindowChangePassword.js b/src/gui/src/UI/UIWindowChangePassword.js index a10f2ba9c..557946bf5 100644 --- a/src/gui/src/UI/UIWindowChangePassword.js +++ b/src/gui/src/UI/UIWindowChangePassword.js @@ -51,7 +51,7 @@ async function UIWindowChangePassword(options){ h += `
`; const el_window = await UIWindow({ - title: 'Change Password', + title: i18n('window_title_change_password'), app: 'change-passowrd', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowDesktopBGSettings.js b/src/gui/src/UI/UIWindowDesktopBGSettings.js index f499593b1..77534e775 100644 --- a/src/gui/src/UI/UIWindowDesktopBGSettings.js +++ b/src/gui/src/UI/UIWindowDesktopBGSettings.js @@ -199,7 +199,7 @@ async function UIWindowDesktopBGSettings(options){ allowed_file_types: ['image/*'], show_maximize_button: false, show_minimize_button: false, - title: 'Open', + title: i18n('window_title_open'), is_dir: true, is_openFileDialog: true, selectable_body: false, diff --git a/src/gui/src/UI/UIWindowFontPicker.js b/src/gui/src/UI/UIWindowFontPicker.js index 406dd9523..ae326e338 100644 --- a/src/gui/src/UI/UIWindowFontPicker.js +++ b/src/gui/src/UI/UIWindowFontPicker.js @@ -66,7 +66,7 @@ async function UIWindowFontPicker(options){ h += `
`; const el_window = await UIWindow({ - title: 'Select font…', + title: i18n('window_title_select_font'), app: 'font-picker', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowLogin.js b/src/gui/src/UI/UIWindowLogin.js index 65ded877f..2d98d4523 100644 --- a/src/gui/src/UI/UIWindowLogin.js +++ b/src/gui/src/UI/UIWindowLogin.js @@ -153,13 +153,13 @@ async function UIWindowLogin(options){ // Basic validation for email/username and password if(!email_username) { - $(el_window).find('.login-error-msg').html(i18n('email_or_username_required') || 'Email or username is required'); + $(el_window).find('.login-error-msg').html(i18n('login_email_username_required')); $(el_window).find('.login-error-msg').fadeIn(); return; } if(!password) { - $(el_window).find('.login-error-msg').html(i18n('password_required') || 'Password is required'); + $(el_window).find('.login-error-msg').html(i18n('login_password_required')); $(el_window).find('.login-error-msg').fadeIn(); return; } diff --git a/src/gui/src/UI/UIWindowLoginInProgress.js b/src/gui/src/UI/UIWindowLoginInProgress.js index 65e74633b..419d47eb7 100644 --- a/src/gui/src/UI/UIWindowLoginInProgress.js +++ b/src/gui/src/UI/UIWindowLoginInProgress.js @@ -47,7 +47,7 @@ async function UIWindowLoginInProgress(options){ h += ``; const el_window = await UIWindow({ - title: 'Authenticating...', + title: i18n('window_title_authenticating'), app: 'change-passowrd', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowNewPassword.js b/src/gui/src/UI/UIWindowNewPassword.js index bf2d1c41d..8ec45ca38 100644 --- a/src/gui/src/UI/UIWindowNewPassword.js +++ b/src/gui/src/UI/UIWindowNewPassword.js @@ -82,7 +82,7 @@ async function UIWindowNewPassword(options){ const el_window = await UIWindow({ - title: 'Set New Password', + title: i18n('window_title_set_new_password'), app: 'change-passowrd', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowPublishWebsite.js b/src/gui/src/UI/UIWindowPublishWebsite.js index 3e0ca3a81..f3e2a21c5 100644 --- a/src/gui/src/UI/UIWindowPublishWebsite.js +++ b/src/gui/src/UI/UIWindowPublishWebsite.js @@ -48,7 +48,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di h += ``; const el_window = await UIWindow({ - title: 'Publish Website', + title: i18n('window_title_publish_website'), icon: null, uid: null, is_dir: false, @@ -114,7 +114,7 @@ async function UIWindowPublishWebsite(target_dir_uid, target_dir_name, target_di $(el_window).find('.publish-website-error-msg').html( err.message + ( err.code === 'subdomain_limit_reached' ? - ' Manage Your Subdomains' : '' + ' ' + i18n('manage_your_subdomains') + '' : '' ) ); $(el_window).find('.publish-website-error-msg').fadeIn(); diff --git a/src/gui/src/UI/UIWindowQR.js b/src/gui/src/UI/UIWindowQR.js index ab67d6c66..b3275327f 100644 --- a/src/gui/src/UI/UIWindowQR.js +++ b/src/gui/src/UI/UIWindowQR.js @@ -40,7 +40,7 @@ async function UIWindowQR(options){ h += placeholder_qr.html; const el_window = await UIWindow({ - title: 'Instant Login!', + title: i18n('window_title_instant_login'), app: 'instant-login', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowRefer.js b/src/gui/src/UI/UIWindowRefer.js index bb7d4d28c..89fb09a41 100644 --- a/src/gui/src/UI/UIWindowRefer.js +++ b/src/gui/src/UI/UIWindowRefer.js @@ -36,7 +36,7 @@ async function UIWindowRefer(options){ h += ``; const el_window = await UIWindow({ - title: `Refer a friend!`, + title: i18n('window_title_refer_friend'), window_class: 'window-refer-friend', icon: null, uid: null, diff --git a/src/gui/src/UI/UIWindowSessionList.js b/src/gui/src/UI/UIWindowSessionList.js index ac5b3457a..77f6eab9c 100644 --- a/src/gui/src/UI/UIWindowSessionList.js +++ b/src/gui/src/UI/UIWindowSessionList.js @@ -47,7 +47,7 @@ async function UIWindowSessionList(options){ h += ``; const el_window = await UIWindow({ - title: 'Session List!', + title: i18n('window_title_session_list'), app: 'session-list', single_instance: true, icon: null, diff --git a/src/gui/src/UI/UIWindowSignup.js b/src/gui/src/UI/UIWindowSignup.js index 595a72696..64ccda61f 100644 --- a/src/gui/src/UI/UIWindowSignup.js +++ b/src/gui/src/UI/UIWindowSignup.js @@ -69,7 +69,7 @@ function UIWindowSignup(options){ h += ``; // confirm password h += `
`; - h += ``; + h += ``; h += ``; // show/hide icon h += ` diff --git a/src/gui/src/UI/UIWindowWelcome.js b/src/gui/src/UI/UIWindowWelcome.js index 92c56646f..bd9ced237 100644 --- a/src/gui/src/UI/UIWindowWelcome.js +++ b/src/gui/src/UI/UIWindowWelcome.js @@ -31,20 +31,20 @@ async function UIWindowWelcome(options){ h += ``; h += `
`; h += `
`; - h += `

Welcome to your
Personal Internet Computer

`; - h += `

Store files, play games, find awesome apps, and much more! All in one place, accessible from anywhere at any time.

`; - h += ``; + h += `

${i18n('welcome_title')}

`; + h += `

${i18n('welcome_description')}

`; + h += ``; h += ``; h += `
`; h += ``; const el_window = await UIWindow({ - title: 'Instant Login!', + title: i18n('welcome_instant_login_title'), app: 'instant-login', single_instance: true, icon: null, diff --git a/src/gui/src/i18n/translations/en.js b/src/gui/src/i18n/translations/en.js index 51ec6c0b5..abfe3a5f7 100644 --- a/src/gui/src/i18n/translations/en.js +++ b/src/gui/src/i18n/translations/en.js @@ -171,6 +171,8 @@ const en = { move: 'Move', moving_file: "Moving %%", my_websites: "My Websites", + minimize: "Minimize", + reload_app: "Reload App", name: 'Name', name_cannot_be_empty: 'Name cannot be empty.', name_cannot_contain_double_period: "Name can not be the '..' character.", @@ -188,8 +190,10 @@ const en = { no_websites_published: "You have not published any websites yet. Right click on a folder to get started.", ok: 'OK', open: "Open", + new_window: "New Window", open_in_new_tab: "Open in New Tab", open_in_new_window: "Open in New Window", + open_trash: "Open Trash", open_with: "Open With", original_name: 'Original Name', original_path: 'Original Path', @@ -419,7 +423,76 @@ const en = { 'billing.enjoy_msg': 'Enjoy %% of Cloud Storage plus other benefits.', 'too_many_attempts': 'Too many attempts. Please try again later.', 'server_timeout': 'The server took too long to respond. Please try again.', - 'signup_error': 'An error occurred during signup. Please try again.' + 'signup_error': 'An error occurred during signup. Please try again.', + + // Welcome Window + 'welcome_title': 'Welcome to your Personal Internet Computer', + 'welcome_description': 'Store files, play games, find awesome apps, and much more! All in one place, accessible from anywhere at any time.', + 'welcome_get_started': 'Get Started', + 'welcome_terms': 'Terms', + 'welcome_privacy': 'Privacy', + 'welcome_developers': 'Developers', + 'welcome_open_source': 'Open Source', + 'welcome_instant_login_title': 'Instant Login!', + + // Alert Window + 'alert_error_title': 'Error!', + 'alert_warning_title': 'Warning!', + 'alert_info_title': 'Info', + 'alert_success_title': 'Success!', + 'alert_confirm_title': 'Are you sure?', + 'alert_yes': 'Yes', + 'alert_no': 'No', + 'alert_retry': 'Retry', + 'alert_cancel': 'Cancel', + + // Signup Window + 'signup_confirm_password': 'Confirm Password', + + // Login Window + 'login_email_username_required': 'Email or username is required', + 'login_password_required': 'Password is required', + + // Various Window Titles + 'window_title_open': 'Open', + 'window_title_change_password': 'Change Password', + 'window_title_select_font': 'Select font…', + 'window_title_session_list': 'Session List!', + 'window_title_set_new_password': 'Set New Password', + 'window_title_instant_login': 'Instant Login!', + 'window_title_publish_website': 'Publish Website', + 'window_title_authenticating': 'Authenticating...', + 'window_title_refer_friend': 'Refer a friend!', + + // Desktop UI + 'desktop_show_desktop': 'Show Desktop', + 'desktop_show_open_windows': 'Show Open Windows', + 'desktop_exit_full_screen': 'Exit Full Screen', + 'desktop_enter_full_screen': 'Enter Full Screen', + 'desktop_position': 'Position', + 'desktop_position_left': 'Left', + 'desktop_position_bottom': 'Bottom', + 'desktop_position_right': 'Right', + // Item UI + 'item_shared_with_you': 'A user has shared this item with you.', + 'item_shared_by_you': 'You have shared this item with at least one other user.', + 'item_shortcut': 'Shortcut', + 'item_associated_websites': 'Associated website', + 'item_associated_websites_plural': 'Associated websites', + 'no_suitable_apps_found': 'No suitable apps found', + + // Window UI + 'window_click_to_go_back': 'Click to go back.', + 'window_click_to_go_forward': 'Click to go forward.', + 'window_click_to_go_up': 'Click to go one directory up.', + 'window_title_public': 'Public', + 'window_title_videos': 'Videos', + 'window_title_pictures': 'Pictures', + 'window_title_puter': 'Puter', + 'window_folder_empty': 'This folder is empty', + + // Website Management + 'manage_your_subdomains': 'Manage Your Subdomains' } };