From a03d1171fed37cd7f1fdbcc3330dbc1bbbb326e0 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Sun, 28 Feb 2021 09:45:53 +0100 Subject: [PATCH 01/43] feat: init i18n --- .../app/components/core/app-signin/app-signin.tsx | 5 +++-- .../editor/app-close-menu/app-close-menu.tsx | 4 +++- .../publish/app-publish-tags/app-publish-tags.tsx | 6 ++++-- .../editor/styles/app-color/app-color.tsx | 2 +- .../core/app-deck-delete/app-deck-delete.tsx | 6 ++++-- .../app/modals/core/app-template/app-template.tsx | 5 +++-- .../core/app-user-delete/app-user-delete.tsx | 6 ++++-- .../app-code-languages/app-code-languages.tsx | 6 ++++-- .../editor/app-custom-data/app-custom-data.tsx | 6 ++++-- .../app-custom-images/app-custom-images.tsx | 6 ++++-- .../src/app/modals/editor/app-demo/app-demo.tsx | 6 ++++-- .../src/app/modals/editor/app-embed/app-embed.tsx | 5 +++-- studio/src/app/modals/editor/app-gif/app-gif.tsx | 6 ++++-- .../src/app/modals/editor/app-notes/app-notes.tsx | 6 ++++-- .../app/modals/editor/app-offline/app-offline.tsx | 10 ++++++---- .../src/app/modals/editor/app-photo/app-photo.tsx | 10 ++++++---- .../editor/app-playground/app-playground.tsx | 7 +++++-- .../editor/app-poll-options/app-poll-options.tsx | 6 ++++-- .../app/modals/editor/app-publish/app-publish.tsx | 6 ++++-- .../app-remote-connect/app-remote-connect.tsx | 5 +++-- .../src/app/modals/editor/app-waves/app-waves.tsx | 6 ++++-- .../app/modals/editor/app-youtube/app-youtube.tsx | 6 ++++-- studio/src/app/stores/i18n.store.ts | 15 +++++++++++++++ studio/src/assets/i18n/en.json | 5 +++++ 24 files changed, 105 insertions(+), 46 deletions(-) create mode 100644 studio/src/app/stores/i18n.store.ts create mode 100644 studio/src/assets/i18n/en.json diff --git a/studio/src/app/components/core/app-signin/app-signin.tsx b/studio/src/app/components/core/app-signin/app-signin.tsx index 4d75a4644..377a03bb8 100644 --- a/studio/src/app/components/core/app-signin/app-signin.tsx +++ b/studio/src/app/components/core/app-signin/app-signin.tsx @@ -7,6 +7,7 @@ import {User as FirebaseUser, UserCredential, AuthCredential, OAuthCredential} f import navStore, {NavDirection} from '../../../stores/nav.store'; import authStore from '../../../stores/auth.store'; import tokenStore from '../../../stores/token.store'; +import i18n from '../../../stores/i18n.store'; import {AuthUser} from '../../../models/auth/auth.user'; @@ -312,8 +313,8 @@ export class AppSignIn { } else { return ( - this.navigateBack()} color="dark"> - + this.navigateBack()} color="dark" aria-label={i18n.state.core.close}> + ); diff --git a/studio/src/app/components/editor/app-close-menu/app-close-menu.tsx b/studio/src/app/components/editor/app-close-menu/app-close-menu.tsx index dd18941a5..0d7778332 100644 --- a/studio/src/app/components/editor/app-close-menu/app-close-menu.tsx +++ b/studio/src/app/components/editor/app-close-menu/app-close-menu.tsx @@ -1,5 +1,7 @@ import {Component, EventEmitter, h, Host, Event} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-close-menu', styleUrl: 'app-close-menu.scss', @@ -13,7 +15,7 @@ export class AppCloseMenu { diff --git a/studio/src/app/components/editor/publish/app-publish-tags/app-publish-tags.tsx b/studio/src/app/components/editor/publish/app-publish-tags/app-publish-tags.tsx index 2e936cdab..55e20d68e 100644 --- a/studio/src/app/components/editor/publish/app-publish-tags/app-publish-tags.tsx +++ b/studio/src/app/components/editor/publish/app-publish-tags/app-publish-tags.tsx @@ -1,5 +1,7 @@ import {Component, EventEmitter, Prop, Event, h} from '@stencil/core'; +import i18n from '../../../../stores/i18n.store'; + @Component({ tag: 'app-publish-tags', styleUrl: 'app-publish-tags.scss', @@ -41,8 +43,8 @@ export class AppPublishTags { private renderCloseTags(tag: string) { return ( - ); } diff --git a/studio/src/app/components/editor/styles/app-color/app-color.tsx b/studio/src/app/components/editor/styles/app-color/app-color.tsx index a0da4f3ad..97fa758db 100644 --- a/studio/src/app/components/editor/styles/app-color/app-color.tsx +++ b/studio/src/app/components/editor/styles/app-color/app-color.tsx @@ -252,7 +252,7 @@ export class AppColor { this.onColorPickerChange($event)}> {this.renderColorInput()} {this.renderColorSwitcher()} diff --git a/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx b/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx index 33bbf6fb4..7c3e57651 100644 --- a/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx +++ b/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, Prop, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-deck-delete', styleUrl: 'app-deck-delete.scss', @@ -37,8 +39,8 @@ export class AppDeckDelete { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Are you absolutely sure? diff --git a/studio/src/app/modals/core/app-template/app-template.tsx b/studio/src/app/modals/core/app-template/app-template.tsx index 37e2a73d2..c85348e17 100644 --- a/studio/src/app/modals/core/app-template/app-template.tsx +++ b/studio/src/app/modals/core/app-template/app-template.tsx @@ -2,6 +2,7 @@ import {Component, Element, Fragment, h, Listen, Prop, State} from '@stencil/cor import authStore from '../../../stores/auth.store'; import navStore, {NavDirection} from '../../../stores/nav.store'; +import i18n from '../../../stores/i18n.store'; import {Template, TemplateData} from '../../../models/data/template'; @@ -154,8 +155,8 @@ export class AppTemplate { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Template diff --git a/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx b/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx index 9252c2614..4c6592e91 100644 --- a/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx +++ b/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, Prop, State, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {UserUtils} from '../../../utils/core/user.utils'; @Component({ @@ -53,8 +55,8 @@ export class AppUserDelete { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Are you absolutely sure? diff --git a/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx b/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx index 8977fcb0b..07d8ef50d 100644 --- a/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx +++ b/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx @@ -1,5 +1,7 @@ import {Component, Element, EventEmitter, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {filterCodeLanguages} from '../../../utils/editor/prism.utils'; import {PrismLanguage} from '../../../types/editor/prism-language'; @@ -97,8 +99,8 @@ export class AppCodeLanguages { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Languages diff --git a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx index 9aa77af92..876ef8a98 100644 --- a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx +++ b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, State, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {Constants} from '../../../types/core/constants'; import {StorageService} from '../../../services/storage/storage.service'; @@ -163,8 +165,8 @@ export class AppCustomData { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Your data diff --git a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx index 4518b4fc4..12a55308c 100644 --- a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx +++ b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, State, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {Constants} from '../../../types/core/constants'; import {ImageHistoryService} from '../../../services/editor/image-history/image-history.service'; @@ -180,8 +182,8 @@ export class AppCustomImages { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Your images diff --git a/studio/src/app/modals/editor/app-demo/app-demo.tsx b/studio/src/app/modals/editor/app-demo/app-demo.tsx index 646e1b6ad..62bb35c11 100644 --- a/studio/src/app/modals/editor/app-demo/app-demo.tsx +++ b/studio/src/app/modals/editor/app-demo/app-demo.tsx @@ -1,5 +1,7 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {DemoAction} from '../../../types/editor/demo-action'; @Component({ @@ -62,8 +64,8 @@ export class AppDemo { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Demo diff --git a/studio/src/app/modals/editor/app-embed/app-embed.tsx b/studio/src/app/modals/editor/app-embed/app-embed.tsx index d7e2c393a..82e7d24d8 100644 --- a/studio/src/app/modals/editor/app-embed/app-embed.tsx +++ b/studio/src/app/modals/editor/app-embed/app-embed.tsx @@ -2,6 +2,7 @@ import {Component, Element, h, Listen, State} from '@stencil/core'; import deckStore from '../../../stores/deck.store'; import errorStore from '../../../stores/error.store'; +import i18n from '../../../stores/i18n.store'; import {getPublishedUrl} from '../../../utils/core/share.utils'; @@ -67,8 +68,8 @@ export class AppEmbed { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Embed diff --git a/studio/src/app/modals/editor/app-gif/app-gif.tsx b/studio/src/app/modals/editor/app-gif/app-gif.tsx index 2eef72259..9d66c5087 100644 --- a/studio/src/app/modals/editor/app-gif/app-gif.tsx +++ b/studio/src/app/modals/editor/app-gif/app-gif.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, State, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {GifService} from '../../../services/tenor/gif/gif.service'; import {ImageHistoryService} from '../../../services/editor/image-history/image-history.service'; @@ -261,8 +263,8 @@ export class AppGif { ); } else { return ( - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + ); } diff --git a/studio/src/app/modals/editor/app-notes/app-notes.tsx b/studio/src/app/modals/editor/app-notes/app-notes.tsx index 50e5b304e..c3a9fb381 100644 --- a/studio/src/app/modals/editor/app-notes/app-notes.tsx +++ b/studio/src/app/modals/editor/app-notes/app-notes.tsx @@ -1,5 +1,7 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-notes', styleUrl: 'app-notes.scss', @@ -90,8 +92,8 @@ export class AppNotes { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Notes diff --git a/studio/src/app/modals/editor/app-offline/app-offline.tsx b/studio/src/app/modals/editor/app-offline/app-offline.tsx index 0e301b580..339bef22a 100644 --- a/studio/src/app/modals/editor/app-offline/app-offline.tsx +++ b/studio/src/app/modals/editor/app-offline/app-offline.tsx @@ -1,8 +1,10 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-offline', - styleUrl: 'app-offline.scss' + styleUrl: 'app-offline.scss', }) export class AppNotes { @Element() el: HTMLElement; @@ -43,8 +45,8 @@ export class AppNotes { - this.closeModal()} disabled={this.jobInProgress}> - + this.closeModal()} disabled={this.jobInProgress} aria-label={i18n.state.core.close}> + {this.offline ? 'Go Online' : 'Go Offline'} @@ -52,7 +54,7 @@ export class AppNotes { ,
{this.renderContent()}
-
+ , ]; } diff --git a/studio/src/app/modals/editor/app-photo/app-photo.tsx b/studio/src/app/modals/editor/app-photo/app-photo.tsx index 08f2909d3..20e7e86c0 100644 --- a/studio/src/app/modals/editor/app-photo/app-photo.tsx +++ b/studio/src/app/modals/editor/app-photo/app-photo.tsx @@ -1,12 +1,14 @@ import {Component, Element, Listen, State, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {ApiPhotoService} from '../../../services/api/photo/api.photo.service'; import {ApiPhotoFactoryService} from '../../../services/api/photo/api.photo.factory.service'; import {ImageHistoryService} from '../../../services/editor/image-history/image-history.service'; @Component({ tag: 'app-photo', - styleUrl: 'app-photo.scss' + styleUrl: 'app-photo.scss', }) export class AppPhoto { @Element() el: HTMLElement; @@ -216,15 +218,15 @@ export class AppPhoto { this.search(); }}>
- + , ]; } private renderCloseButton() { if (!this.searchTerm || this.searchTerm.length <= 0 || this.searching) { return ( - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + ); } else { diff --git a/studio/src/app/modals/editor/app-playground/app-playground.tsx b/studio/src/app/modals/editor/app-playground/app-playground.tsx index 04714d368..50a16afff 100644 --- a/studio/src/app/modals/editor/app-playground/app-playground.tsx +++ b/studio/src/app/modals/editor/app-playground/app-playground.tsx @@ -1,6 +1,9 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import {DeckdeckgoPlaygroundTheme} from '@deckdeckgo/slide-playground'; + +import i18n from '../../../stores/i18n.store'; + import {PlaygroundAction} from '../../../types/editor/playground-action'; @Component({ @@ -78,8 +81,8 @@ export class AppPlayground { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Playground diff --git a/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx b/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx index f918b49dc..e10538944 100644 --- a/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx +++ b/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx @@ -1,5 +1,7 @@ import {Component, Element, EventEmitter, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-poll-options', styleUrl: 'app-poll-options.scss', @@ -223,8 +225,8 @@ export class AppPollOptions { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Poll diff --git a/studio/src/app/modals/editor/app-publish/app-publish.tsx b/studio/src/app/modals/editor/app-publish/app-publish.tsx index 91944ff58..9e21dc528 100644 --- a/studio/src/app/modals/editor/app-publish/app-publish.tsx +++ b/studio/src/app/modals/editor/app-publish/app-publish.tsx @@ -1,5 +1,7 @@ import {Component, Element, Listen, h, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + import {PublishService} from '../../../services/editor/publish/publish.service'; @Component({ @@ -78,8 +80,8 @@ export class AppPublish { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + {this.renderTitle()} diff --git a/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx b/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx index 336966e45..b6a244432 100644 --- a/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx +++ b/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx @@ -1,6 +1,7 @@ import {Component, Element, State, h, Listen, Fragment} from '@stencil/core'; import remoteStore from '../../../stores/remote.store'; +import i18n from '../../../stores/i18n.store'; import {RemoteService} from '../../../services/editor/remote/remote.service'; @@ -102,8 +103,8 @@ export class AppRemoteConnect { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + Remote control diff --git a/studio/src/app/modals/editor/app-waves/app-waves.tsx b/studio/src/app/modals/editor/app-waves/app-waves.tsx index 7bc15abec..a283b32f5 100644 --- a/studio/src/app/modals/editor/app-waves/app-waves.tsx +++ b/studio/src/app/modals/editor/app-waves/app-waves.tsx @@ -2,6 +2,8 @@ import {Component, Element, Listen, State, h, Fragment} from '@stencil/core'; import {RangeChangeEventDetail} from '@ionic/core'; +import i18n from '../../../stores/i18n.store'; + import {ColorUtils, InitStyleColor} from '../../../utils/editor/color.utils'; import {WavesUtils} from '../../../utils/editor/waves.utils'; @@ -151,8 +153,8 @@ export class AppWaves { private renderCloseButton() { return ( - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + ); } diff --git a/studio/src/app/modals/editor/app-youtube/app-youtube.tsx b/studio/src/app/modals/editor/app-youtube/app-youtube.tsx index 55462b955..163a1a511 100644 --- a/studio/src/app/modals/editor/app-youtube/app-youtube.tsx +++ b/studio/src/app/modals/editor/app-youtube/app-youtube.tsx @@ -1,5 +1,7 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-youtube', styleUrl: 'app-youtube.scss', @@ -45,8 +47,8 @@ export class AppYoutube { - this.closeModal()}> - + this.closeModal()} aria-label={i18n.state.core.close}> + YouTube diff --git a/studio/src/app/stores/i18n.store.ts b/studio/src/app/stores/i18n.store.ts new file mode 100644 index 000000000..409c20057 --- /dev/null +++ b/studio/src/app/stores/i18n.store.ts @@ -0,0 +1,15 @@ +import {createStore} from '@stencil/store'; + +import en from '../../assets/i18n/en.json'; + +interface I18n { + lang: 'en'; + [index: string]: any; +} + +const {state} = createStore({ + lang: en, + ...(en as any), +} as I18n); + +export default {state}; diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json new file mode 100644 index 000000000..6ade7d0ad --- /dev/null +++ b/studio/src/assets/i18n/en.json @@ -0,0 +1,5 @@ +{ + "core": { + "close": "Close" + } +} From f4d3dc909fbc92fde374eb3be9a1f8137705ada7 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Sun, 28 Feb 2021 12:41:58 +0100 Subject: [PATCH 02/43] build: generate i18n type declarations --- studio/package.json | 4 +++- studio/scripts/i18n.types.js | 37 +++++++++++++++++++++++++++++ studio/src/app/definitions/i18.d.ts | 8 +++++++ studio/src/app/stores/i18n.store.ts | 7 +----- 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 studio/scripts/i18n.types.js create mode 100644 studio/src/app/definitions/i18.d.ts diff --git a/studio/package.json b/studio/package.json index f17c4dd45..535da732b 100644 --- a/studio/package.json +++ b/studio/package.json @@ -8,7 +8,9 @@ "dist/" ], "scripts": { - "prebuild": "node ./scripts/rm-www.js", + "clean": "node ./scripts/rm-www.js", + "i18n": "node ./scripts/i18n.types.js", + "prebuild": "npm run clean && npm run i18n", "build": "stencil build", "build:staging": "npm run build -- --staging", "postbuild": "./scripts/config.index.js", diff --git a/studio/scripts/i18n.types.js b/studio/scripts/i18n.types.js new file mode 100644 index 000000000..ef80660c0 --- /dev/null +++ b/studio/scripts/i18n.types.js @@ -0,0 +1,37 @@ +const {writeFileSync, readFileSync} = require('fs'); + +const prettier = require('prettier'); + +const generate = async () => { + const buffer = readFileSync('./src/assets/i18n/en.json'); + const i18n = JSON.parse(buffer.toString()); + + const data = Object.keys(i18n).map((key) => { + const properties = Object.keys(i18n[key]).map((prop) => `${prop}: string;`); + + return { + key, + name: `I18n${key.charAt(0).toUpperCase()}${key.slice(1)}`, + properties, + }; + }); + + const lang = `lang: 'en';`; + + const main = `\n\ninterface I18n {${lang}${data.map((i) => `${i.key}: ${i.name};`).join('')}}`; + const interfaces = data.map((i) => `\n\ninterface ${i.name} {${i.properties.join('')}}`).join(''); + + const output = prettier.format(`${interfaces}${main}`, {semi: false, parser: 'babel', singleQuote: true}); + + writeFileSync('./src/app/definitions/i18.d.ts', output); +}; + +(async () => { + try { + await generate(); + + console.log(`i18n type declarations generated!`); + } catch (err) { + console.error(`Error while generating i18n types.`, err); + } +})(); diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts new file mode 100644 index 000000000..038d3d04a --- /dev/null +++ b/studio/src/app/definitions/i18.d.ts @@ -0,0 +1,8 @@ +interface I18nCore { + close: string; +} + +interface I18n { + lang: 'en'; + core: I18nCore; +} diff --git a/studio/src/app/stores/i18n.store.ts b/studio/src/app/stores/i18n.store.ts index 409c20057..6d76448cc 100644 --- a/studio/src/app/stores/i18n.store.ts +++ b/studio/src/app/stores/i18n.store.ts @@ -2,14 +2,9 @@ import {createStore} from '@stencil/store'; import en from '../../assets/i18n/en.json'; -interface I18n { - lang: 'en'; - [index: string]: any; -} - const {state} = createStore({ lang: en, - ...(en as any), + ...(en as Partial), } as I18n); export default {state}; From 41a153e45c75860f943697c3f7b1f3613c34cbc1 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Sun, 28 Feb 2021 12:50:54 +0100 Subject: [PATCH 03/43] feat: i18n links --- .../components/core/app-footer/app-links.tsx | 39 ++++++++++--------- studio/src/app/definitions/i18.d.ts | 20 ++++++++++ studio/src/assets/i18n/en.json | 18 +++++++++ 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/studio/src/app/components/core/app-footer/app-links.tsx b/studio/src/app/components/core/app-footer/app-links.tsx index 4c7fc017a..f34f5eb74 100644 --- a/studio/src/app/components/core/app-footer/app-links.tsx +++ b/studio/src/app/components/core/app-footer/app-links.tsx @@ -1,5 +1,7 @@ import {Component, h} from '@stencil/core'; +import i18n from '../../../stores/i18n.store'; + @Component({ tag: 'app-links', styleUrl: 'app-links.scss', @@ -13,78 +15,79 @@ export class AppLinks { DeckDeckGo - Home + {i18n.state.footer.home} - Discover + {i18n.state.footer.discover} - Enterprise + {i18n.state.footer.enterprise} - About + {i18n.state.footer.about} - Team + {i18n.state.footer.team} - Newsletter + {i18n.state.footer.newsletter} - Contact + {i18n.state.footer.contact} - Press + {i18n.state.footer.press} - FAQ + {i18n.state.footer.faq}
- Developers + {i18n.state.footer.developers} - Open source + {i18n.state.footer.open_source} - Services + {i18n.state.footer.services} - Developer + {i18n.state.footer.developer}
- Terms + {i18n.state.footer.terms} - Terms of use + {i18n.state.footer.terms_of_use} - Privacy Policy + {i18n.state.footer.privacy_policy}
, @@ -159,7 +160,7 @@ export class AppTemplatesCharts { smooth={'false'} src={assetsStore.state.chart.lineSrc} custom-loader={true}> -

Sharp area

+

{i18n.state.templates.sharp_area}

, @@ -180,7 +181,7 @@ export class AppTemplatesCharts { area={'false'} src={assetsStore.state.chart.lineNoDatesSrc} custom-loader={true}> -

Lines

+

{i18n.state.templates.lines}

, @@ -203,7 +204,7 @@ export class AppTemplatesCharts { animation={true} src={assetsStore.state.chart.lineMultipleSrc} custom-loader={true}> -

Line graph comparison

+

{i18n.state.templates.line_graph_comparison}

, @@ -220,7 +221,7 @@ export class AppTemplatesCharts { height={68} src={assetsStore.state.chart.pieSrc} custom-loader={true}> -

Bar

+

{i18n.state.templates.bar}

, @@ -242,7 +243,7 @@ export class AppTemplatesCharts { '--deckgo-chart-fill-color-3': 'var(--ion-color-tertiary)', }} custom-loader={true}> -

Grouped bars

+

{i18n.state.templates.grouped_bars}

, @@ -268,7 +269,7 @@ export class AppTemplatesCharts { '--deckgo-chart-fill-color-3': 'var(--ion-color-tertiary)', }} custom-loader={true}> -

Bar comparison

+

{i18n.state.templates.bar_comparison}

, ]; diff --git a/studio/src/app/components/editor/templates/platform/app-templates-default/app-templates-default.tsx b/studio/src/app/components/editor/templates/platform/app-templates-default/app-templates-default.tsx index 570fa83f7..3a9a0b5c7 100644 --- a/studio/src/app/components/editor/templates/platform/app-templates-default/app-templates-default.tsx +++ b/studio/src/app/components/editor/templates/platform/app-templates-default/app-templates-default.tsx @@ -2,6 +2,7 @@ import {Component, Element, Event, EventEmitter, Fragment, h, State} from '@sten import userStore from '../../../../../stores/user.store'; import assetsStore from '../../../../../stores/assets.store'; +import i18n from '../../../../../stores/i18n.store'; import {SlideAttributes, SlideSplitType, SlideTemplate} from '../../../../../models/data/slide'; import {Template} from '../../../../../models/data/template'; @@ -126,11 +127,11 @@ export class AppTemplatesDefault { poll-server={EnvironmentConfigService.getInstance().get('deckdeckgo').pollServerUrl} count-answers={3} connectPollSocket={false}> -

Engage Your Audience / Poll

-

Yes

-

No

-

Don't know

-

Live Votes With Mobile Devices

+

{i18n.state.templates.poll}

+

{i18n.state.core.yes}

+

{i18n.state.core.no}

+

{i18n.state.templates.do_not_know}

+

{i18n.state.templates.live_votes}

); @@ -152,7 +153,7 @@ export class AppTemplatesDefault { height={68} src={assetsStore.state.chart.lineCompareSrc} custom-loader={true}> -

Charts

+

{i18n.state.templates.charts}

); @@ -162,21 +163,39 @@ export class AppTemplatesDefault { return (
this.addSlideAspectRatio.emit()}> - - - - + + + + - - - Diagrams + + + {i18n.state.templates.diagrams}
); @@ -190,7 +209,7 @@ export class AppTemplatesDefault { return (
this.selectedTemplate.emit({template: SlideTemplate.GIF})}> - +

@@ -229,7 +248,7 @@ export class AppTemplatesDefault { return (
this.selectedTemplate.emit({template: SlideTemplate.PLAYGROUND})}> -

Playground

+

{i18n.state.templates.playground}

@@ -252,7 +271,7 @@ export class AppTemplatesDefault { : 'https://pbs.twimg.com/profile_images/941274539979366400/bTKGkd-O_400x400.jpg' } img-alt="Author"> -

Author

+

{i18n.state.templates.author}

@@ -271,7 +290,7 @@ export class AppTemplatesDefault { class="showcase" content={EnvironmentConfigService.getInstance().get('deckdeckgo').appUrl} img-src={`${EnvironmentConfigService.getInstance().get('deckdeckgo').globalAssetsUrl}/img/deckdeckgo-logo.svg`}> -

QR Code Deep Linking

+

{i18n.state.templates.qr_code}

); @@ -288,7 +307,7 @@ export class AppTemplatesDefault {

- Showcase Your Apps + {i18n.state.templates.showcase}
diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 134a2d81d..1a1c95fad 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -286,6 +286,41 @@ interface I18nWarning { overflow: string; } +interface I18nTemplates { + no_personal_templates: string; + no_personal_templates_guide: string; + set_of_default: string; + sign_in_to_add: string; + pie: string; + donut: string; + pie_comparison: string; + area: string; + sharp_area: string; + lines: string; + line_graph_comparison: string; + bar: string; + grouped_bars: string; + bar_comparison: string; + poll: string; + do_not_know: string; + live_votes: string; + charts: string; + diagrams: string; + playground: string; + author: string; + qr_code: string; + showcase: string; +} + +interface I18nShapes { + robot: string; + desktop: string; + arrow: string; + cloud: string; + database: string; + envelope: string; +} + interface I18n { lang: 'en'; core: I18nCore; @@ -301,4 +336,6 @@ interface I18n { publish_done: I18nPublish_done; publish_edit: I18nPublish_edit; warning: I18nWarning; + templates: I18nTemplates; + shapes: I18nShapes; } diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index 9d9c63945..32571fd7f 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -273,5 +273,38 @@ "warning": { "low_contrast": "Low contrast", "overflow": "Overflow" + }, + "templates": { + "no_personal_templates": "You do not have any personal templates yet. Follow this {0} to get started.", + "no_personal_templates_guide": "guide", + "set_of_default": "DeckDeckGo provides a set of default and community templates for your slides but, you can also use your own.", + "sign_in_to_add": "{0} to add yours.", + "pie": "Pie", + "donut": "Donut", + "pie_comparison": "Pie comparison", + "area": "Area", + "sharp_area": "Sharp area", + "lines": "Lines", + "line_graph_comparison": "Line graph comparison", + "bar": "Bar", + "grouped_bars": "Grouped bars", + "bar_comparison": "Bar comparison", + "poll": "Engage Your Audience / Poll", + "do_not_know": "Don't know", + "live_votes": "Live Votes With Mobile Devices", + "charts": "Charts", + "diagrams": "Diagrams", + "playground": "Playground", + "author": "Author", + "qr_code": "QR Code Deep Linking", + "showcase": "Showcase Your Apps" + }, + "shapes": { + "robot": "Robot", + "desktop": "Desktop", + "arrow": "Arrow", + "cloud": "Cloud", + "database": "Database", + "envelope": "Envelope" } } From 94bec2d9dc0b37acf6e961a6cb0ee56fb10e62af Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Wed, 3 Mar 2021 18:15:27 +0100 Subject: [PATCH 26/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 15 +++++++++ .../core/app-deck-delete/app-deck-delete.tsx | 10 ++++-- .../modals/core/app-template/app-template.tsx | 32 ++++++++++++++----- .../core/app-user-delete/app-user-delete.tsx | 12 ++++--- studio/src/assets/i18n/en.json | 23 ++++++++++--- 5 files changed, 73 insertions(+), 19 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 1a1c95fad..ada410e76 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -6,6 +6,8 @@ interface I18nCore { no: string; reset: string; ok: string; + save: string; + sure: string; } interface I18nNav { @@ -62,6 +64,9 @@ interface I18nSign_in { interface I18nSettings { un_publish: string; + cannot_undone: string; + type_to_confirm: string; + i_understand: string; } interface I18nDashboard { @@ -72,6 +77,8 @@ interface I18nDashboard { no_slides: string; copy: string; delete: string; + cannot_undone: string; + understand: string; } interface I18nEditor { @@ -310,6 +317,14 @@ interface I18nTemplates { author: string; qr_code: string; showcase: string; + template: string; + tag: string; + definition: string; + cdn: string; + get_in_touch: string; + url: string; + tag_format: string; + upload_definition: string; } interface I18nShapes { diff --git a/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx b/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx index 7c3e57651..17e498498 100644 --- a/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx +++ b/studio/src/app/modals/core/app-deck-delete/app-deck-delete.tsx @@ -1,6 +1,7 @@ import {Component, Element, Listen, Prop, h} from '@stencil/core'; import i18n from '../../../stores/i18n.store'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-deck-delete', @@ -43,17 +44,20 @@ export class AppDeckDelete {
- Are you absolutely sure? + {i18n.state.core.sure}
,

- This action cannot be undone. This will permanently delete your presentation {this.deckName}. + {renderI18n(i18n.state.dashboard.cannot_undone, { + placeholder: '{0}', + value: {this.deckName}, + })}

this.handleSubmit($event)}> - I understand, delete my presentation + {i18n.state.dashboard.understand}
diff --git a/studio/src/app/modals/core/app-template/app-template.tsx b/studio/src/app/modals/core/app-template/app-template.tsx index c85348e17..e04d3efff 100644 --- a/studio/src/app/modals/core/app-template/app-template.tsx +++ b/studio/src/app/modals/core/app-template/app-template.tsx @@ -5,6 +5,7 @@ import navStore, {NavDirection} from '../../../stores/nav.store'; import i18n from '../../../stores/i18n.store'; import {Template, TemplateData} from '../../../models/data/template'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-template', @@ -159,7 +160,7 @@ export class AppTemplate {
- Template + {i18n.state.templates.template}
@@ -185,7 +186,7 @@ export class AppTemplate { - Tag 2 + {i18n.state.templates.tag} 2 @@ -202,7 +203,7 @@ export class AppTemplate { - Definition 3 + {i18n.state.templates.definition} 3 @@ -216,7 +217,7 @@ export class AppTemplate { - Save + {i18n.state.core.save} @@ -231,19 +232,34 @@ export class AppTemplate { return (

- 1 URL to the ES Modules as for example https://unpkg.com/my-component@latest/dist/my-component/my-component.esm.js. + 1{' '} + {renderI18n(i18n.state.templates.url, { + placeholder: '{0}', + value: https://unpkg.com/my-component@latest/dist/my-component/my-component.esm.js, + })}

- We support Unpkg, Cloudfare and jsDelivr. If you would like to use another CDN, this.navigateContact()}>get in touch. + {renderI18n(i18n.state.templates.cdn, { + placeholder: '{0}', + value: this.navigateContact()}>get in touch, + })}

- 2 The tag should not contain any of the reserved keywords deckdeckgo, deckgo or ddg. + 2{' '} + {renderI18n(i18n.state.templates.tag_format, { + placeholder: '{0}', + value: deckdeckgo, deckgo or ddg, + })}

- 3 Upload the definition which was automatically generated when you built your template ./src/components.desc.json. + 3{' '} + {renderI18n(i18n.state.templates.upload_definition, { + placeholder: '{0}', + value: ./src/components.desc.json, + })}

); diff --git a/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx b/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx index 4c6592e91..aea6df720 100644 --- a/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx +++ b/studio/src/app/modals/core/app-user-delete/app-user-delete.tsx @@ -3,6 +3,7 @@ import {Component, Element, Listen, Prop, State, h} from '@stencil/core'; import i18n from '../../../stores/i18n.store'; import {UserUtils} from '../../../utils/core/user.utils'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-user-delete', @@ -59,16 +60,19 @@ export class AppUserDelete { - Are you absolutely sure? + {i18n.state.core.sure}
,

- This action cannot be undone. This will permanently delete your user {this.username}. + {renderI18n(i18n.state.settings.cannot_undone, { + placeholder: '{0}', + value: {this.username}, + })}

this.handleSubmit(e)}> -

Please type your username to confirm.

+

{i18n.state.settings.type_to_confirm}

- I understand, delete my user + {i18n.state.settings.i_understand} diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index 32571fd7f..68fd49824 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -6,7 +6,9 @@ "yes": "Yes", "no": "No", "reset": "Reset", - "ok": "Ok" + "ok": "Ok", + "save": "Save", + "sure": "Are you absolutely sure?" }, "nav": { "menu": "Menu", @@ -56,7 +58,10 @@ "additionally": "Additionally, push the source code of your slides to repos with the GitHub {0} logging." }, "settings": { - "un_publish": "Please note that currently, the presentations you have shared are not automatically removed from internet. If you wish to un-publish them, drop us a message on one of our {0} channels." + "un_publish": "Please note that currently, the presentations you have shared are not automatically removed from internet. If you wish to un-publish them, drop us a message on one of our {0} channels.", + "cannot_undone": "This action cannot be undone. This will permanently delete your presentation {0}.", + "type_to_confirm": "Please type your username to confirm.", + "i_understand": "I understand, delete my user" }, "dashboard": { "welcome": "Welcome to DeckDeckGo 👋", @@ -65,7 +70,9 @@ "filter": "Filter your presentations", "no_slides": "You don't have any slides yet. Go for it, create your first deck now!", "copy": "Copy presentation", - "delete": "Delete presentation" + "delete": "Delete presentation", + "cannot_undone": "This action cannot be undone. This will permanently delete your presentation {0}.", + "understand": "I understand, delete my presentation" }, "editor": { "add_slide": "Add slide", @@ -297,7 +304,15 @@ "playground": "Playground", "author": "Author", "qr_code": "QR Code Deep Linking", - "showcase": "Showcase Your Apps" + "showcase": "Showcase Your Apps", + "template": "Template", + "tag": "Tag", + "definition": "Definition", + "cdn": "We support Unpkg, Cloudfare and jsDelivr. If you would like to use another CDN, {0}.", + "get_in_touch": "get in touch", + "url": "URL to the ES Modules as for example {0}.", + "tag_format": "The tag should not contain any of the reserved keywords {0}.", + "upload_definition": "Upload the definition which was automatically generated when you built your template {0}." }, "shapes": { "robot": "Robot", From 085496414ebaae669c5580371efe50ea8b1cdaa9 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Wed, 3 Mar 2021 18:22:06 +0100 Subject: [PATCH 27/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 6 ++++++ .../editor/app-code-languages/app-code-languages.tsx | 4 ++-- .../app/modals/editor/app-custom-data/app-custom-data.tsx | 8 ++++---- .../modals/editor/app-custom-images/app-custom-images.tsx | 8 ++++---- studio/src/assets/i18n/en.json | 8 +++++++- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index ada410e76..4bcb7b79d 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -233,6 +233,12 @@ interface I18nEditor { font: string; axis: string; grid: string; + languages: string; + filter_languages: string; + your_data: string; + your_collection_empty: string; + upload_data: string; + upload_image: string; } interface I18nOffline { diff --git a/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx b/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx index 07d8ef50d..3db981b69 100644 --- a/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx +++ b/studio/src/app/modals/editor/app-code-languages/app-code-languages.tsx @@ -103,7 +103,7 @@ export class AppCodeLanguages { - Languages + {i18n.state.editor.languages}
, @@ -115,7 +115,7 @@ export class AppCodeLanguages { this.clear()} onIonInput={(e: CustomEvent) => this.handleInput(e)} diff --git a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx index 876ef8a98..c762bcb5f 100644 --- a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx +++ b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx @@ -169,7 +169,7 @@ export class AppCustomData { - Your data + {i18n.state.editor.your_data}
, @@ -178,7 +178,7 @@ export class AppCustomData { this.upload()} /> ) => this.searchNext(e)}> - + , @@ -221,7 +221,7 @@ export class AppCustomData {
- Your collection of data is empty + {i18n.state.editor.your_collection_empty}
); @@ -232,7 +232,7 @@ export class AppCustomData { return ( this.openFilePicker()} shape="round" color="tertiary"> - Upload a new data + {i18n.state.editor.upload_data} ); } else { diff --git a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx index 12a55308c..ac965cd02 100644 --- a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx +++ b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx @@ -186,7 +186,7 @@ export class AppCustomImages { - Your images + {i18n.state.editor.your_images}
, @@ -200,7 +200,7 @@ export class AppCustomImages { this.upload()} /> ) => this.searchNext(e)}> - + , @@ -221,7 +221,7 @@ export class AppCustomImages {
- Your collection of images is empty + {i18n.state.editor.your_collection_empty}
); @@ -235,7 +235,7 @@ export class AppCustomImages { return ( this.openFilePicker()} shape="round" color="tertiary"> - Upload a new image + {i18n.state.editor.upload_image} ); } else { diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index 68fd49824..e2635c3c6 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -225,7 +225,13 @@ "stroke": "Stroke", "font": "Font", "axis": "Axis", - "grid": "Grid" + "grid": "Grid", + "languages": "Languages", + "filter_languages": "Filter languages", + "your_data": "Your data", + "your_collection_empty": "Your collection is empty", + "upload_data": "Upload a new data", + "upload_image": "Upload a new image" }, "offline": { "editing": "You are editing offline.", From d57e5df94b1222f4f9c6d80ef312d2757f44862e Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Wed, 3 Mar 2021 18:22:58 +0100 Subject: [PATCH 28/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 1 + .../src/app/modals/editor/app-custom-data/app-custom-data.tsx | 2 +- .../app/modals/editor/app-custom-images/app-custom-images.tsx | 2 +- studio/src/assets/i18n/en.json | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 4bcb7b79d..4f1e4232b 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -2,6 +2,7 @@ interface I18nCore { close: string; free_open_source: string; loading: string; + in_progress: string; yes: string; no: string; reset: string; diff --git a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx index c762bcb5f..338e5134a 100644 --- a/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx +++ b/studio/src/app/modals/editor/app-custom-data/app-custom-data.tsx @@ -236,7 +236,7 @@ export class AppCustomData { ); } else { - return [, Upload in progress]; + return [, {i18n.state.core.in_progress}]; } } } diff --git a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx index ac965cd02..e01d6b469 100644 --- a/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx +++ b/studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx @@ -239,7 +239,7 @@ export class AppCustomImages { ); } else { - return [, Upload in progress]; + return [, {i18n.state.core.in_progress}]; } } } diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index e2635c3c6..f298d0129 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -3,6 +3,7 @@ "close": "Close", "free_open_source": "DeckDeckGo is free and open source 😃.", "loading": "Loading...", + "in_progress": "In progress...", "yes": "Yes", "no": "No", "reset": "Reset", From f7f3159155f0def2bb9514d482904ffb0fe0b183 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Wed, 3 Mar 2021 18:27:42 +0100 Subject: [PATCH 29/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 5 +++++ studio/src/app/modals/editor/app-demo/app-demo.tsx | 6 +++--- studio/src/app/modals/editor/app-embed/app-embed.tsx | 6 +++--- studio/src/assets/i18n/en.json | 7 ++++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 4f1e4232b..3ebc09520 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -240,6 +240,11 @@ interface I18nEditor { your_collection_empty: string; upload_data: string; upload_image: string; + demo: string; + enter_demo_url: string; + embed: string; + copy_embed_code: string; + copy_to_clipboard: string; } interface I18nOffline { diff --git a/studio/src/app/modals/editor/app-demo/app-demo.tsx b/studio/src/app/modals/editor/app-demo/app-demo.tsx index 62bb35c11..c3ea09d11 100644 --- a/studio/src/app/modals/editor/app-demo/app-demo.tsx +++ b/studio/src/app/modals/editor/app-demo/app-demo.tsx @@ -68,7 +68,7 @@ export class AppDemo { - Demo + {i18n.state.editor.demo}
, @@ -76,7 +76,7 @@ export class AppDemo { ) => this.handleInput(e)}> @@ -90,7 +90,7 @@ export class AppDemo { shape="round" onClick={() => this.save()} class="ion-margin-top"> - Save + {i18n.state.core.save} , ]; diff --git a/studio/src/app/modals/editor/app-embed/app-embed.tsx b/studio/src/app/modals/editor/app-embed/app-embed.tsx index 82e7d24d8..05d59fa1a 100644 --- a/studio/src/app/modals/editor/app-embed/app-embed.tsx +++ b/studio/src/app/modals/editor/app-embed/app-embed.tsx @@ -72,13 +72,13 @@ export class AppEmbed { - Embed + {i18n.state.editor.embed}
, - Copy the following code to embed your presentation. + {i18n.state.editor.copy_embed_code} this.copyEmbedCode()}> - Copy to clipboard + {i18n.state.editor.copy_to_clipboard} , ]; diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index f298d0129..ffe5de361 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -232,7 +232,12 @@ "your_data": "Your data", "your_collection_empty": "Your collection is empty", "upload_data": "Upload a new data", - "upload_image": "Upload a new image" + "upload_image": "Upload a new image", + "demo": "Demo", + "enter_demo_url": "Enter the URL of your app or website", + "embed": "Embed", + "copy_embed_code": "Copy the following code to embed your presentation.", + "copy_to_clipboard": "Copy to clipboard" }, "offline": { "editing": "You are editing offline.", From 36ee5a6feef881abf48ddaf0c7f88709c7847b43 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 4 Mar 2021 07:22:48 +0100 Subject: [PATCH 30/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 2 ++ studio/src/app/modals/editor/app-gif/app-gif.tsx | 6 +++--- studio/src/assets/i18n/en.json | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 3ebc09520..f4716b4c0 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -245,6 +245,8 @@ interface I18nEditor { embed: string; copy_embed_code: string; copy_to_clipboard: string; + gifs: string; + search_tenor: string; } interface I18nOffline { diff --git a/studio/src/app/modals/editor/app-gif/app-gif.tsx b/studio/src/app/modals/editor/app-gif/app-gif.tsx index 9d66c5087..84bb15d54 100644 --- a/studio/src/app/modals/editor/app-gif/app-gif.tsx +++ b/studio/src/app/modals/editor/app-gif/app-gif.tsx @@ -223,7 +223,7 @@ export class AppGif { {this.renderCloseButton()} - GIFs + {i18n.state.editor.gifs} , @@ -235,14 +235,14 @@ export class AppGif { onSelectImage={($event: CustomEvent) => this.selectGif($event)}> ) => this.searchNext(e)}> - + , this.clear()} onIonInput={(e: CustomEvent) => this.handleInput(e)} diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index ffe5de361..9b3b6ac99 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -237,7 +237,9 @@ "enter_demo_url": "Enter the URL of your app or website", "embed": "Embed", "copy_embed_code": "Copy the following code to embed your presentation.", - "copy_to_clipboard": "Copy to clipboard" + "copy_to_clipboard": "Copy to clipboard", + "gifs": "GIFs", + "search_tenor": "Search Tenor" }, "offline": { "editing": "You are editing offline.", From 5be46c3270149c1841b85fb299d6b731bd6b3799 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 4 Mar 2021 08:48:15 +0100 Subject: [PATCH 31/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 7 ++++++ .../modals/editor/app-notes/app-notes.scss | 4 ---- .../app/modals/editor/app-notes/app-notes.tsx | 20 ++++++++++------- .../modals/editor/app-offline/app-offline.tsx | 2 +- .../app/modals/editor/app-photo/app-photo.tsx | 8 +++---- .../editor/app-playground/app-playground.tsx | 22 +++++++++++-------- studio/src/assets/i18n/en.json | 9 +++++++- 7 files changed, 45 insertions(+), 27 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index f4716b4c0..e8d7c58c4 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -8,6 +8,7 @@ interface I18nCore { reset: string; ok: string; save: string; + delete: string; sure: string; } @@ -98,6 +99,7 @@ interface I18nEditor { backup: string; delete: string; notes: string; + notes_display: string; copy: string; format: string; options: string; @@ -149,6 +151,8 @@ interface I18nEditor { history: string; history_details: string; stock_photo: string; + photos_by_unsplash: string; + searching: string; gif: string; your_images: string; waves: string; @@ -247,6 +251,9 @@ interface I18nEditor { copy_to_clipboard: string; gifs: string; search_tenor: string; + url_playground: string; + embed_codepen: string; + youtube_video: string; } interface I18nOffline { diff --git a/studio/src/app/modals/editor/app-notes/app-notes.scss b/studio/src/app/modals/editor/app-notes/app-notes.scss index 96d3f8a8e..f4bf4f0cf 100644 --- a/studio/src/app/modals/editor/app-notes/app-notes.scss +++ b/studio/src/app/modals/editor/app-notes/app-notes.scss @@ -4,10 +4,6 @@ app-notes { p { margin-top: 8px; - - ion-icon { - vertical-align: text-bottom; - } } ion-item.item-input ion-textarea[class*="sc-ion-textarea"] { diff --git a/studio/src/app/modals/editor/app-notes/app-notes.tsx b/studio/src/app/modals/editor/app-notes/app-notes.tsx index c3a9fb381..df2b8412f 100644 --- a/studio/src/app/modals/editor/app-notes/app-notes.tsx +++ b/studio/src/app/modals/editor/app-notes/app-notes.tsx @@ -1,6 +1,7 @@ import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import i18n from '../../../stores/i18n.store'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-notes', @@ -96,16 +97,19 @@ export class AppNotes { - Notes + {i18n.state.editor.notes}
,

- Your notes are displayed in the{' '} - - remote control - - . Markdown is supported 😉 + {renderI18n(i18n.state.editor.notes_display, { + placeholder: '{0}', + value: ( + + {i18n.state.menu.remote_control} + + ), + })}

@@ -123,11 +127,11 @@ export class AppNotes {
this.save()}> - Save + {i18n.state.core.save} this.delete()} fill="outline"> - Delete + {i18n.state.core.delete}
, diff --git a/studio/src/app/modals/editor/app-offline/app-offline.tsx b/studio/src/app/modals/editor/app-offline/app-offline.tsx index 339bef22a..bd2c81bf9 100644 --- a/studio/src/app/modals/editor/app-offline/app-offline.tsx +++ b/studio/src/app/modals/editor/app-offline/app-offline.tsx @@ -49,7 +49,7 @@ export class AppNotes { - {this.offline ? 'Go Online' : 'Go Offline'} + {this.offline ? i18n.state.editor.go_online : i18n.state.editor.go_offline} , diff --git a/studio/src/app/modals/editor/app-photo/app-photo.tsx b/studio/src/app/modals/editor/app-photo/app-photo.tsx index 20e7e86c0..0a7a244c6 100644 --- a/studio/src/app/modals/editor/app-photo/app-photo.tsx +++ b/studio/src/app/modals/editor/app-photo/app-photo.tsx @@ -191,7 +191,7 @@ export class AppPhoto { {this.renderCloseButton()} - Stock photo + {i18n.state.editor.stock_photo} , @@ -203,7 +203,7 @@ export class AppPhoto { {this.renderPhotosPlaceHolder()} ) => this.searchNext(e)}> - + , @@ -244,7 +244,7 @@ export class AppPhoto {
- Photos by Unsplash + {i18n.state.editor.photos_by_unsplash} {this.renderPlaceHolderSearching()}
@@ -258,7 +258,7 @@ export class AppPhoto { if (this.searching) { return (

- Searching + {i18n.state.editor.searching}

); } else { diff --git a/studio/src/app/modals/editor/app-playground/app-playground.tsx b/studio/src/app/modals/editor/app-playground/app-playground.tsx index 50a16afff..80cdba2e1 100644 --- a/studio/src/app/modals/editor/app-playground/app-playground.tsx +++ b/studio/src/app/modals/editor/app-playground/app-playground.tsx @@ -5,6 +5,7 @@ import {DeckdeckgoPlaygroundTheme} from '@deckdeckgo/slide-playground'; import i18n from '../../../stores/i18n.store'; import {PlaygroundAction} from '../../../types/editor/playground-action'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-playground', @@ -85,7 +86,7 @@ export class AppPlayground { - Playground + {i18n.state.templates.playground} , @@ -93,7 +94,7 @@ export class AppPlayground { ) => this.handleInput(e)}> @@ -103,7 +104,7 @@ export class AppPlayground { this.toggleTheme($event)} interface="popover" mode="md" @@ -124,15 +125,18 @@ export class AppPlayground { shape="round" class="ion-margin-top" onClick={() => this.save()}> - Save + {i18n.state.core.save}

- Embed your best CodePen, JSFiddle or WebComponents.dev. All you need is to enter their full links. Check out this{' '} - - YouTube video - {' '} - for a quick tutorial. + {renderI18n(i18n.state.editor.embed_codepen, { + placeholder: '{0}', + value: ( + + {i18n.state.editor.youtube_video} + + ), + })}

, ]; diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index 9b3b6ac99..69460c6b6 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -9,6 +9,7 @@ "reset": "Reset", "ok": "Ok", "save": "Save", + "delete": "Delete", "sure": "Are you absolutely sure?" }, "nav": { @@ -91,6 +92,7 @@ "backup": "Backup", "delete": "Delete", "notes": "Notes", + "notes_display": "Your notes are displayed in the {0}. Markdown is supported 😉", "copy": "Copy", "format": "Format", "options": "Options", @@ -142,6 +144,8 @@ "history": "History", "history_details": "The editor keeps track of the last 10 images you would have use in any of your presentations. Select one to add it again quickly.", "stock_photo": "Stock photo", + "photos_by_unsplash": "Photos by Unsplash", + "searching": "Seaching", "gif": "GIF", "your_images": "Your images", "waves": "Waves", @@ -239,7 +243,10 @@ "copy_embed_code": "Copy the following code to embed your presentation.", "copy_to_clipboard": "Copy to clipboard", "gifs": "GIFs", - "search_tenor": "Search Tenor" + "search_tenor": "Search Tenor", + "url_playground": "Enter the URL of the playground", + "embed_codepen": "Embed your best CodePen, JSFiddle or WebComponents.dev. All you need is to enter their full links. Check out this {0} for a quick tutorial.", + "youtube_video": "Youtube video" }, "offline": { "editing": "You are editing offline.", From 7e92a4bf84cea29476d2ebb5e10ce2a5986c06d1 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 4 Mar 2021 15:21:07 +0100 Subject: [PATCH 32/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 10 ++++++++++ .../app-poll-options/app-poll-options.tsx | 10 +++++----- .../modals/editor/app-publish/app-publish.tsx | 4 ++-- .../app-remote-connect/app-remote-connect.tsx | 17 +++++++++++------ .../app/modals/editor/app-waves/app-waves.tsx | 12 ++++++------ .../modals/editor/app-youtube/app-youtube.tsx | 4 ++-- studio/src/assets/i18n/en.json | 14 ++++++++++++-- 7 files changed, 48 insertions(+), 23 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index e8d7c58c4..db9a187ff 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -10,6 +10,7 @@ interface I18nCore { save: string; delete: string; sure: string; + add: string; } interface I18nNav { @@ -254,6 +255,15 @@ interface I18nEditor { url_playground: string; embed_codepen: string; youtube_video: string; + question: string; + enter_question: string; + add_answer: string; + published: string; + remote: string; + scan: string; + direction_up: string; + direction_down: string; + enter_youtube_url: string; } interface I18nOffline { diff --git a/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx b/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx index e10538944..2faedb9cd 100644 --- a/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx +++ b/studio/src/app/modals/editor/app-poll-options/app-poll-options.tsx @@ -229,16 +229,16 @@ export class AppPollOptions { - Poll + {i18n.state.menu.poll} , -

Question

+

{i18n.state.editor.question}

) => this.handleQuestionInput(e)}> @@ -250,13 +250,13 @@ export class AppPollOptions {
this.addAnswer()} disabled={this.editDisabled}> - Add an answer + {i18n.state.editor.add_answer}
this.save()}> - Save + {i18n.state.core.save}
, ]; diff --git a/studio/src/app/modals/editor/app-publish/app-publish.tsx b/studio/src/app/modals/editor/app-publish/app-publish.tsx index 9e21dc528..b38a7f045 100644 --- a/studio/src/app/modals/editor/app-publish/app-publish.tsx +++ b/studio/src/app/modals/editor/app-publish/app-publish.tsx @@ -97,9 +97,9 @@ export class AppPublish { private renderTitle() { if (this.publishedUrl && this.publishedUrl !== undefined && this.publishedUrl !== '') { - return Published; + return {i18n.state.editor.published}; } else { - return Ready to share?; + return {i18n.state.nav.ready_to_share}; } } diff --git a/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx b/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx index b6a244432..34697b414 100644 --- a/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx +++ b/studio/src/app/modals/editor/app-remote-connect/app-remote-connect.tsx @@ -4,6 +4,7 @@ import remoteStore from '../../../stores/remote.store'; import i18n from '../../../stores/i18n.store'; import {RemoteService} from '../../../services/editor/remote/remote.service'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-remote-connect', @@ -107,16 +108,20 @@ export class AppRemoteConnect { - Remote control + {i18n.state.menu.remote_control} -

Control your presentation from your phone, tablet or any devices where you can also see your notes, set a timer and draw over your slides.

+

{i18n.state.editor.remote}

- Scan the QR-Code or get the Progressive Web Apps at{' '} - - https://deckdeckgo.app - + {renderI18n(i18n.state.editor.scan, { + placeholder: '{0}', + value: ( + + https://deckdeckgo.app + + ), + })}

diff --git a/studio/src/app/modals/editor/app-waves/app-waves.tsx b/studio/src/app/modals/editor/app-waves/app-waves.tsx index a283b32f5..415131e5a 100644 --- a/studio/src/app/modals/editor/app-waves/app-waves.tsx +++ b/studio/src/app/modals/editor/app-waves/app-waves.tsx @@ -123,7 +123,7 @@ export class AppWaves { {this.renderCloseButton()} - Waves + {i18n.state.editor.waves} @@ -134,17 +134,17 @@ export class AppWaves {
- Waves + {i18n.state.editor.waves} {this.renderOptions()} - Color + {i18n.state.editor.color} {this.renderColor()} this.selectWave()} color="dark" shape="round"> - Add + {i18n.state.core.add}
@@ -170,7 +170,7 @@ export class AppWaves { size="small" onClick={() => this.setOrientation('upward')} color={this.orientation === 'upward' ? 'quaternary' : 'medium'} - aria-label="Direction up"> + aria-label={i18n.state.editor.direction_up}> @@ -178,7 +178,7 @@ export class AppWaves { size="small" onClick={() => this.setOrientation('downward')} color={this.orientation === 'downward' ? 'quaternary' : 'medium'} - aria-label="Direction down"> + aria-label={i18n.state.editor.direction_down}> diff --git a/studio/src/app/modals/editor/app-youtube/app-youtube.tsx b/studio/src/app/modals/editor/app-youtube/app-youtube.tsx index 163a1a511..0008612c2 100644 --- a/studio/src/app/modals/editor/app-youtube/app-youtube.tsx +++ b/studio/src/app/modals/editor/app-youtube/app-youtube.tsx @@ -59,7 +59,7 @@ export class AppYoutube { ) => this.handleInput(e)}> @@ -70,7 +70,7 @@ export class AppYoutube { color="dark" shape="round" onClick={() => this.save()}> - Save + {i18n.state.core.save}
, ]; diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index 69460c6b6..cef41b320 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -10,7 +10,8 @@ "ok": "Ok", "save": "Save", "delete": "Delete", - "sure": "Are you absolutely sure?" + "sure": "Are you absolutely sure?", + "add": "Add" }, "nav": { "menu": "Menu", @@ -246,7 +247,16 @@ "search_tenor": "Search Tenor", "url_playground": "Enter the URL of the playground", "embed_codepen": "Embed your best CodePen, JSFiddle or WebComponents.dev. All you need is to enter their full links. Check out this {0} for a quick tutorial.", - "youtube_video": "Youtube video" + "youtube_video": "Youtube video", + "question": "Question", + "enter_question": "Enter your question", + "add_answer": "Add an answer", + "published": "Published", + "remote": "Control your presentation from your phone, tablet or any devices where you can also see your notes, set a timer and draw over your slides.", + "scan": " Scan the QR-Code or get the Progressive Web Apps at {0}", + "direction_up": "Direction up", + "direction_down": "Direction down", + "enter_youtube_url": "Enter the URL of the video" }, "offline": { "editing": "You are editing offline.", From 9a74924e91f02486abf359ecf2b7866c36a0a74f Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 4 Mar 2021 15:42:46 +0100 Subject: [PATCH 33/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 12 +++++++ .../src/app/pages/core/app-poll/app-poll.tsx | 34 ++++++++++++------- studio/src/assets/i18n/en.json | 12 ++++++- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index db9a187ff..9b7754dc1 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -11,6 +11,8 @@ interface I18nCore { delete: string; sure: string; add: string; + submit: string; + cancel: string; } interface I18nNav { @@ -367,6 +369,15 @@ interface I18nShapes { envelope: string; } +interface I18nPoll { + vote_now: string; + scan: string; + vote_cast: string; + enjoy: string; + vote_again: string; + created_with: string; +} + interface I18n { lang: 'en'; core: I18nCore; @@ -384,4 +395,5 @@ interface I18n { warning: I18nWarning; templates: I18nTemplates; shapes: I18nShapes; + poll: I18nPoll; } diff --git a/studio/src/app/pages/core/app-poll/app-poll.tsx b/studio/src/app/pages/core/app-poll/app-poll.tsx index eeb05099b..cde85d472 100644 --- a/studio/src/app/pages/core/app-poll/app-poll.tsx +++ b/studio/src/app/pages/core/app-poll/app-poll.tsx @@ -2,12 +2,14 @@ import {Component, h, Prop, State} from '@stencil/core'; import errorStore from '../../../stores/error.store'; import pollStore from '../../../stores/poll.store'; +import i18n from '../../../stores/i18n.store'; import {get, set} from 'idb-keyval'; import {DeckdeckgoPoll, DeckdeckgoPollAnswer} from '@deckdeckgo/types'; import {PollService} from '../../../services/poll/poll.service'; +import {renderI18n} from '../../../utils/core/i18n.utils'; @Component({ tag: 'app-poll', @@ -185,7 +187,7 @@ export class AppPoll { return undefined; } - return [

Vote now!

,

Scan the QR-Code displayed on screen or enter the code to make your voice heard.

, this.renderJoinPollForm()]; + return [

{i18n.state.poll.vote_now}

,

{i18n.state.poll.scan}

, this.renderJoinPollForm()]; } private renderJoinPollForm() { @@ -216,7 +218,7 @@ export class AppPoll { disabled={!this.pollKey || this.pollKey === undefined || this.pollKey === '' || this.connecting} color="primary" shape="round"> - Submit + {i18n.state.core.submit} ); } @@ -225,10 +227,10 @@ export class AppPoll { return (
- Submit + {i18n.state.core.submit} this.cancel()}> - Cancel + {i18n.state.core.cancel}
); @@ -243,21 +245,27 @@ export class AppPoll {
-

{this.keywords[this.keywordIndex]}! Your vote has been cast.

+

+ {this.keywords[this.keywordIndex]}! {i18n.state.poll.vote_cast} +

-

Enjoy the presentation and watch out the screen for the real-time polling.

+

{i18n.state.poll.enjoy}

this.cancel()} color="primary" shape="round" class="ion-margin-top"> - Vote for another poll + {i18n.state.poll.vote_again}
- Created with{' '} - -
- DeckDeckGo -
-
+ {renderI18n(i18n.state.poll.created_with, { + placeholder: '{0}', + value: ( + +
+ DeckDeckGo +
+
+ ), + })}
); diff --git a/studio/src/assets/i18n/en.json b/studio/src/assets/i18n/en.json index cef41b320..79292826a 100644 --- a/studio/src/assets/i18n/en.json +++ b/studio/src/assets/i18n/en.json @@ -11,7 +11,9 @@ "save": "Save", "delete": "Delete", "sure": "Are you absolutely sure?", - "add": "Add" + "add": "Add", + "submit": "Submit", + "cancel": "Cancel" }, "nav": { "menu": "Menu", @@ -352,5 +354,13 @@ "cloud": "Cloud", "database": "Database", "envelope": "Envelope" + }, + "poll": { + "vote_now": "Vote now!", + "scan": "Scan the QR-Code displayed on screen or enter the code to make your voice heard.", + "vote_cast": "Your vote has been cast.", + "enjoy": "Enjoy the presentation and watch out the screen for the real-time polling.", + "vote_again": "Vote for another poll", + "created_with": "Created with {0}" } } From da28a67c7c0adda26744934f1252ef921029b2ef Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 4 Mar 2021 18:30:55 +0100 Subject: [PATCH 34/43] feat: i18n --- studio/src/app/definitions/i18.d.ts | 25 ++++++++ .../app-customization/app-customization.tsx | 7 ++- .../core/settings/app-profile/app-profile.tsx | 58 ++++++++++--------- .../settings/app-templates/app-templates.tsx | 31 +++++----- studio/src/assets/i18n/en.json | 27 ++++++++- 5 files changed, 104 insertions(+), 44 deletions(-) diff --git a/studio/src/app/definitions/i18.d.ts b/studio/src/app/definitions/i18.d.ts index 9b7754dc1..7250a6e31 100644 --- a/studio/src/app/definitions/i18.d.ts +++ b/studio/src/app/definitions/i18.d.ts @@ -72,6 +72,31 @@ interface I18nSettings { cannot_undone: string; type_to_confirm: string; i_understand: string; + customization: string; + edit_mode: string; + properties: string; + profile: string; + access_settings: string; + access_templates: string; + profile_note: string; + name: string; + email: string; + newsletter: string; + username: string; + danger_zone: string; + no_way_back: string; + delete_user: string; + profile_picture: string; + profile_picture_tips: string; + summary: string; + bio: string; + custom: string; + custom_url: string; + logo_address: string; + custom_logo: string; + contribute_community: string; + contact: string; + add_a_template: string; } interface I18nDashboard { diff --git a/studio/src/app/pages/core/settings/app-customization/app-customization.tsx b/studio/src/app/pages/core/settings/app-customization/app-customization.tsx index 06e3b3aca..847c4838b 100644 --- a/studio/src/app/pages/core/settings/app-customization/app-customization.tsx +++ b/studio/src/app/pages/core/settings/app-customization/app-customization.tsx @@ -2,6 +2,7 @@ import {Component, Fragment, h} from '@stencil/core'; import themeStore from '../../../../stores/theme.store'; import settingsStore from '../../../../stores/settings.store'; +import i18n from '../../../../stores/i18n.store'; import {ThemeService} from '../../../../services/theme/theme.service'; @@ -33,7 +34,7 @@ export class AppCustomization { ,
-

Customization

+

{i18n.state.settings.customization}

{this.renderDarkLightToggle()} @@ -60,13 +61,13 @@ export class AppCustomization { return ( - Edit mode + {i18n.state.settings.edit_mode} this.toggleEditMode()}> - Properties + {i18n.state.settings.properties} diff --git a/studio/src/app/pages/core/settings/app-profile/app-profile.tsx b/studio/src/app/pages/core/settings/app-profile/app-profile.tsx index b910ed1ce..2ac6d4c61 100644 --- a/studio/src/app/pages/core/settings/app-profile/app-profile.tsx +++ b/studio/src/app/pages/core/settings/app-profile/app-profile.tsx @@ -10,6 +10,7 @@ import navStore, {NavDirection} from '../../../../stores/nav.store'; import authStore from '../../../../stores/auth.store'; import userStore from '../../../../stores/user.store'; import apiUserStore from '../../../../stores/api.user.store'; +import i18n from '../../../../stores/i18n.store'; import {ApiUser} from '../../../../models/api/api.user'; import {User} from '../../../../models/data/user'; @@ -26,6 +27,8 @@ import {ApiUserFactoryService} from '../../../../services/api/user/api.user.fact import {EnvironmentDeckDeckGoConfig} from '../../../../types/core/environment-config'; import {EnvironmentConfigService} from '../../../../services/core/environment/environment-config.service'; +import {renderI18n} from '../../../../utils/core/i18n.utils'; + @Component({ tag: 'app-profile', styleUrl: 'app-profile.scss', @@ -446,7 +449,7 @@ export class AppProfile { ,
-

Profile

+

{i18n.state.settings.profile}

{this.renderGuardedContent()}
, @@ -462,14 +465,14 @@ export class AppProfile { } private renderNotLoggedInContent() { - return [ -

+ return renderI18n(i18n.state.settings.access_settings, { + placeholder: '{0}', + value: ( - to access your profile and settings. -

, - ]; + ), + }); } private renderUserContent() { @@ -489,14 +492,14 @@ export class AppProfile { {this.renderSubmitForm()} , -

Note that your update has no effect on the presentations you would have already published.

, +

{i18n.state.settings.profile_note}

, ]; } private renderName() { return [ - Name + {i18n.state.settings.name} , - Email + {i18n.state.settings.email} , this.validateEmailInput()}> ,