Add i18n keys for multiple terms

This commit is contained in:
Nariman Jelveh
2024-07-03 13:05:39 -07:00
parent de7e2adabd
commit dcbca2f829
4 changed files with 22 additions and 14 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export default {
// search
h += `<div class="search-container" style="margin-bottom: 10px;">
<input type="text" class="search search-language" placeholder="Search">
<input type="text" class="search search-language" placeholder="${i18n('search')}">
</div>`;
// list of languages
+11 -11
View File
@@ -263,13 +263,13 @@ async function UIWindow(options) {
draggable="false"
>`;
// favorites
h += `<h2 class="window-sidebar-title disable-user-select">Favorites</h2>`;
h += `<div draggable="false" title="Home" class="window-sidebar-item disable-user-select ${options.path === window.home_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.home_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-home.svg'])}">Home</div>`;
h += `<div draggable="false" title="Documents" class="window-sidebar-item disable-user-select ${options.path === window.docs_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.docs_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-documents.svg'])}">Documents</div>`;
h += `<div draggable="false" title="Public" class="window-sidebar-item disable-user-select ${options.path === window.public_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.public_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-public.svg'])}">Public</div>`;
h += `<div draggable="false" title="Pictures" class="window-sidebar-item disable-user-select ${options.path === window.pictures_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.pictures_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-pictures.svg'])}">Pictures</div>`;
h += `<div draggable="false" title="Desktop" class="window-sidebar-item disable-user-select ${options.path === window.desktop_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.desktop_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-desktop.svg'])}">Desktop</div>`;
h += `<div draggable="false" title="Videos" class="window-sidebar-item disable-user-select ${options.path === window.videos_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.videos_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-videos.svg'])}">Videos</div>`;
h += `<h2 class="window-sidebar-title disable-user-select">${i18n('favorites')}</h2>`;
h += `<div draggable="false" title="${i18n('home')}" class="window-sidebar-item disable-user-select ${options.path === window.home_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.home_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-home.svg'])}">${i18n('home')}</div>`;
h += `<div draggable="false" title="${i18n('documents')}" class="window-sidebar-item disable-user-select ${options.path === window.docs_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.docs_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-documents.svg'])}">${i18n('documents')}</div>`;
h += `<div draggable="false" title="${i18n('public')}" class="window-sidebar-item disable-user-select ${options.path === window.public_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.public_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-public.svg'])}">${i18n('public')}</div>`;
h += `<div draggable="false" title="${i18n('pictures')}" class="window-sidebar-item disable-user-select ${options.path === window.pictures_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.pictures_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-pictures.svg'])}">${i18n('pictures')}</div>`;
h += `<div draggable="false" title="${i18n('desktop')}" class="window-sidebar-item disable-user-select ${options.path === window.desktop_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.desktop_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-desktop.svg'])}">${i18n('desktop')}</div>`;
h += `<div draggable="false" title="${i18n('videos')}" class="window-sidebar-item disable-user-select ${options.path === window.videos_path ? 'window-sidebar-item-active' : ''}" data-path="${html_encode(window.videos_path)}"><img draggable="false" class="window-sidebar-item-icon" src="${html_encode(window.icons['folder-videos.svg'])}">${i18n('videos')}</div>`;
h += `</div>`;
}
@@ -862,7 +862,7 @@ async function UIWindow(options) {
// build item for context menu
items.push({
html: `<span>${history_item === window.home_path ? 'Home' : path.basename(history_item)}</span>`,
html: `<span>${history_item === window.home_path ? i18n('home') : path.basename(history_item)}</span>`,
val: index,
onClick: async function(e){
let history_index = e.value;
@@ -2828,10 +2828,10 @@ window.update_window_path = async function(el_window, target_path){
$(el_window).find('.window-head-title').text('Desktop')
}else if (target_path === window.home_path){
$(el_window).find('.window-head-icon').attr('src', window.icons['folder-home.svg']);
$(el_window).find('.window-head-title').text('Home')
$(el_window).find('.window-head-title').text(i18n('home'))
}else if (target_path === window.docs_path){
$(el_window).find('.window-head-icon').attr('src', window.icons['folder-documents.svg']);
$(el_window).find('.window-head-title').text('Documents')
$(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')
@@ -2864,7 +2864,7 @@ window.update_window_path = async function(el_window, target_path){
$(el_window_item_container).attr('data-uid', fsentry.id);
// title
if (target_path === window.home_path)
$(el_window).find('.window-head-title').text('Home')
$(el_window).find('.window-head-title').text(i18n('home'))
else
$(el_window).find('.window-head-title').text(fsentry.name);
// data-name
+1 -1
View File
@@ -108,7 +108,7 @@ const launch_app = async (options)=>{
const svc_process = globalThis.services.get('process');
svc_process.register(process);
if(options.path === window.home_path){
title = 'Home';
title = i18n('home');
icon = window.icons['folder-home.svg'];
}
else if(options.path === window.trash_path){
+9 -1
View File
@@ -46,7 +46,6 @@ const en = {
close_all_windows_and_log_out: 'Close Windows and Log Out',
change_always_open_with: "Do you want to always open this type of file with",
color: 'Color',
hue: 'Hue',
confirm_2fa_setup: 'I have added the code to my authenticator app',
confirm_2fa_recovery: 'I have saved my recovery codes in a secure location',
confirm_account_for_free_referral_storage_c2a: 'Create an account and confirm your email address to receive 1 GB of free storage. Your friend will get 1 GB of free storage too.',
@@ -92,6 +91,7 @@ const en = {
deleting_file: "Deleting %%",
deploy_as_app: 'Deploy as app',
descending: 'Descending',
desktop: 'Desktop',
desktop_background_fit: "Fit",
developers: "Developers",
dir_published_as_website: `%strong% has been published to:`,
@@ -99,6 +99,7 @@ const en = {
disable_2fa_confirm: "Are you sure you want to disable 2FA?",
disable_2fa_instructions: "Enter your password to disable 2FA.",
disassociate_dir: "Disassociate Directory",
documents: 'Documents',
download: 'Download',
download_file: 'Download File',
downloading: "Downloading",
@@ -118,6 +119,7 @@ const en = {
enter_password_to_confirm_delete_user: "Enter your password to confirm account deletion",
error_unknown_cause: "An unknown error occurred.",
error_uploading_files: "Failed to upload files",
favorites: "Favorites",
feedback: "Feedback",
feedback_c2a: "Please use the form below to send us your feedback, comments, and bug reports.",
feedback_sent_confirmation: "Thank you for contacting us. If you have an email associated with your account, you will hear back from us as soon as possible.",
@@ -129,7 +131,9 @@ const en = {
get_a_copy_of_on_puter: `Get a copy of '%%' on Puter.com!`,
get_copy_link: 'Get Copy Link',
hide_all_windows: "Hide All Windows",
home: 'Home',
html_document: 'HTML document',
hue: 'Hue',
image: 'Image',
incorrect_password: "Incorrect password",
invite_link: "Invite Link",
@@ -188,6 +192,7 @@ const en = {
personalization: "Personalization",
pick_name_for_website: "Pick a name for your website:",
picture: "Picture",
pictures: 'Pictures',
plural_suffix: 's',
powered_by_puter_js: `Powered by {{link=docs}}Puter.js{{/link}}`,
preparing: "Preparing...",
@@ -202,6 +207,7 @@ const en = {
process_type_init: 'Init',
process_type_ui: 'UI',
properties: "Properties",
public: 'Public',
publish: "Publish",
publish_as_website: 'Publish as website',
puter_description: `Puter is a privacy-first personal cloud to keep all your files, apps, and games in one secure place, accessible from anywhere at any time.`,
@@ -231,6 +237,7 @@ const en = {
scan_qr_c2a: 'Scan the code below\nto log into this session from other devices',
scan_qr_2fa: 'Scan the QR code with your authenticator app',
scan_qr_generic: 'Scan this QR code using your phone or another device',
search: 'Search',
seconds: 'seconds',
security: "Security",
select: "Select",
@@ -284,6 +291,7 @@ const en = {
username_changed: 'Username updated successfully.',
username_required: 'Username is required.',
versions: "Versions",
videos: 'Videos',
visibility: 'Visibility',
yes: 'Yes',
yes_release_it: 'Yes, Release It',