Skip to content

Commit

Permalink
i18n edits
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Oct 21, 2024
1 parent a26f5ea commit 012f1e6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/livecodes/UI/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ const createAssetItem = (
const actions = document.createElement('div');
actions.classList.add('actions');
li.appendChild(actions);
// todo i18n
const deleteButton = document.createElement('div');
deleteButton.innerHTML = deleteIcon;
deleteButton.classList.add('action-button', 'delete-button', 'hint--left');
deleteButton.dataset.hint = 'Delete';
deleteButton.dataset.hint = window.deps.translateString('assets.action.delete', 'Delete');
actions.appendChild(deleteButton);

return { link, deleteButton };
Expand Down
1 change: 1 addition & 0 deletions src/livecodes/UI/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const createOpenItem = (
const deleteButton = document.createElement('button');
deleteButton.classList.add('delete-button');
const iconCSS = '<i class="icon-delete"></i>';
deleteButton.dataset.hint = window.deps.translateString('open.action.delete', 'Delete');
deleteButton.innerHTML = `<span id="delete-button">${iconCSS}</span>`;
actions.appendChild(deleteButton);

Expand Down
8 changes: 8 additions & 0 deletions src/livecodes/i18n/locales/en/translation.lokalise.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@
"notes": "",
"translation": "Untitled Project"
},
"assets.action.delete": {
"notes": "",
"translation": "Delete"
},
"assets.add.dataURL.desc": {
"notes": "### <tag-1> ###\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\" target=\"_blank\" rel=\"noopener\" />\n\n",
"translation": "Add asset as a base64-encoded <tag-1>data url</tag-1>."
Expand Down Expand Up @@ -1444,6 +1448,10 @@
"notes": "",
"translation": "Welcome …"
},
"open.action.delete": {
"notes": "",
"translation": "Delete"
},
"open.defaultTemplate": {
"notes": "",
"translation": "Default template "
Expand Down
6 changes: 6 additions & 0 deletions src/livecodes/i18n/locales/en/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ const translation = {
untitledProject: 'Untitled Project',
},
assets: {
action: {
delete: 'Delete',
},
add: {
dataURL: {
desc: 'Add asset as a base64-encoded <1>data url</1>.',
Expand Down Expand Up @@ -588,6 +591,9 @@ const translation = {
},
},
open: {
action: {
delete: 'Delete',
},
defaultTemplate: 'Default template ',
delete: {
all: 'Delete {{projects}} projects?',
Expand Down

0 comments on commit 012f1e6

Please sign in to comment.