1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

i18n section types

This commit is contained in:
McMatts 2022-03-10 12:10:39 -05:00
parent bca7794c00
commit f735ae1278
11 changed files with 61 additions and 44 deletions

View file

@ -15,6 +15,7 @@ export default Component.extend({
data: "", data: "",
didReceiveAttrs() { didReceiveAttrs() {
this._super();
this.set("data", this.get("meta.rawBody")); this.set("data", this.get("meta.rawBody"));
}, },

View file

@ -34,7 +34,7 @@ export default Component.extend(Modals, Notifier, {
pageTitle: '', pageTitle: '',
didReceiveAttrs() { didReceiveAttrs() {
this._super(...arguments); this._super();
this.set('pageTitle', this.get('page.title')); this.set('pageTitle', this.get('page.title'));
}, },

View file

@ -21,7 +21,9 @@ export default Component.extend(ModalMixin, {
hasNameError: empty('page.title'), hasNameError: empty('page.title'),
hasDescError: empty('page.excerpt'), hasDescError: empty('page.excerpt'),
didRender() { didRender(...args) {
this._super(...args);
let self = this; let self = this;
Mousetrap.bind('esc', function () { Mousetrap.bind('esc', function () {
self.send('onCancel'); self.send('onCancel');

View file

@ -67,7 +67,8 @@ export default Component.extend({
} }
}, },
didInsertElement() { didInsertElement(...args) {
this._super(...args);
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), { var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
theme: "material", theme: "material",
lineNumbers: true, lineNumbers: true,
@ -91,7 +92,8 @@ export default Component.extend({
this.set('codeEditor', editor); this.set('codeEditor', editor);
}, },
willDestroyElement() { willDestroyElement(...args) {
this._super(...args);
let editor = this.get('codeEditor'); let editor = this.get('codeEditor');
if (!_.isNull(editor)) { if (!_.isNull(editor)) {

View file

@ -17,13 +17,14 @@ import Component from '@ember/component';
export default Component.extend({ export default Component.extend({
appMeta: service(), appMeta: service(),
sectionSvc: service('section'), sectionSvc: service('section'),
i18n: service(),
isDirty: false, isDirty: false,
waiting: false, waiting: false,
diagram: '', diagram: '',
diagramXML: '', diagramXML: '',
title: '', title: '',
readyToSave: false, readyToSave: false,
previewButtonCaption: 'Preview', previewButtonCaption: '',
flowCallback: null, flowCallback: null,
editorId: computed('page', function () { editorId: computed('page', function () {
let page = this.get('page'); let page = this.get('page');
@ -40,6 +41,8 @@ export default Component.extend({
didInsertElement() { didInsertElement() {
this._super(...arguments); this._super(...arguments);
this.previewButtonCaption = this.i18n.localize('preview');
schedule('afterRender', () => { schedule('afterRender', () => {
this.setupEditor(); this.setupEditor();
}); });
@ -125,7 +128,7 @@ export default Component.extend({
action: 'export', action: 'export',
format: 'xmlpng', format: 'xmlpng',
xml: this.get('diagramXML'), xml: this.get('diagramXML'),
spin: 'Updating' spin: this.i18n.localize('updating')
} }
), '*'); ), '*');
}, },

View file

@ -1,12 +1,11 @@
{{layout/logo-heading {{layout/logo-heading
title="Airtable" title=(localize 'section_airtable')
desc="Part spreadsheet, part database, and entirely flexible (https://airtable.com)" desc=(localize 'section_airtable_explain')
icon=constants.Icon.Integrations}} icon=constants.Icon.Integrations}}
{{#section/base-editor document=document folder=folder page=page isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}} {{#section/base-editor document=document folder=folder page=page isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
<div class="form-group"> <div class="form-group">
<label for="airtable-embed-code">Airtable embed code</label> <label for="airtable-embed-code">{{localize 'section_airtable_code'}}</label>
{{textarea value=data rows="3" id="airtable-embed-code" class="form-control mousetrap" placeholder="Enter code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}} {{textarea value=data rows="3" id="airtable-embed-code" class="form-control mousetrap" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}}
<small class="form-text text-muted">Paste the Airtable embed code snippet</small>
</div> </div>
{{/section/base-editor}} {{/section/base-editor}}

View file

@ -5,15 +5,15 @@
<form> <form>
{{#if blockMode}} {{#if blockMode}}
<div class="form-group"> <div class="form-group">
{{focus-input id="page-id-{{pageId}}" value=pageTitle placeholder="Enter name" {{focus-input id="page-id-{{pageId}}" value=pageTitle placeholder=(localize 'name')
class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap")}} class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap")}}
</div> </div>
<div class="form-group"> <div class="form-group">
{{textarea id="page-excerpt-{{pageId}}" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter description"}} {{textarea id="page-excerpt-{{pageId}}" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'description')}}
</div> </div>
{{else}} {{else}}
<div class="form-group"> <div class="form-group">
{{focus-input type="text" id=pageId value=pageTitle class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter name"}} {{focus-input type="text" id=pageId value=pageTitle class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'name')}}
</div> </div>
{{/if}} {{/if}}
</form> </form>
@ -25,15 +25,13 @@
{{/if}} {{/if}}
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}} {{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
{{#if contentLinkerButton}} {{#if contentLinkerButton}}
{{ui/ui-toolbar-icon icon=constants.Icon.Link color=constants.Color.Gray {{ui/ui-toolbar-icon icon=constants.Icon.Link color=constants.Color.Gray tooltip=(localize 'link_insert') onClick=(action "onShowLinkModal")}}
tooltip="Insert Link" onClick=(action "onShowLinkModal")}}
{{/if}} {{/if}}
{{#if previewButton}} {{#if previewButton}}
{{ui/ui-toolbar-icon icon=previewIcon color=constants.Color.Gray {{ui/ui-toolbar-icon icon=previewIcon color=constants.Color.Gray tooltip=previewText onClick=(action "onPreview")}}
tooltip=previewText onClick=(action "onPreview")}}
{{/if}} {{/if}}
{{ui/ui-toolbar-icon icon=constants.Icon.Tick color=constants.Color.Green tooltip="Save changes" onClick=(action "onAction")}} {{ui/ui-toolbar-icon icon=constants.Icon.Tick color=constants.Color.Green tooltip=(localize 'save') onClick=(action "onAction")}}
{{ui/ui-toolbar-icon icon=constants.Icon.Cross color=constants.Color.Red tooltip="Cancel editing" onClick=(action "onCancel")}} {{ui/ui-toolbar-icon icon=constants.Icon.Cross color=constants.Color.Red tooltip=(localize 'cancel') onClick=(action "onCancel")}}
{{/ui/ui-toolbar}} {{/ui/ui-toolbar}}
</div> </div>
</div> </div>
@ -47,13 +45,13 @@
<div id={{concat "discard-modal-" page.id}} class="modal" tabindex="-1" role="dialog"> <div id={{concat "discard-modal-" page.id}} class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header">Discard Changes</div> <div class="modal-header">{{localize 'discard_changes'}}</div>
<div class="modal-body"> <div class="modal-body">
<p>You have made changes to the section - continue editing or discard changes?</p> <p>{{localize 'discard_confirm'}}</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label="Continue editing" dismiss=true}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'continue') dismiss=true}}
{{ui/ui-button color=constants.Color.Red light=true label="Discard changes" onClick=(action "onDiscard")}} {{ui/ui-button color=constants.Color.Red light=true label=(localize 'discard') onClick=(action "onDiscard")}}
</div> </div>
</div> </div>
</div> </div>

View file

@ -2,11 +2,11 @@
<div class="grid-cell-1 grid-cell-width-100"> <div class="grid-cell-1 grid-cell-width-100">
<div class="section-editor"> <div class="section-editor">
<div class="form-group"> <div class="form-group">
{{focus-input type="text" id="page-title" value=page.title class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter name"}} {{focus-input type="text" id="page-title" value=page.title class=(if hasNameError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'name')}}
</div> </div>
{{#if hasExcerpt}} {{#if hasExcerpt}}
<div class="form-group"> <div class="form-group">
{{textarea id="page-excerpt" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder="Enter description"}} {{textarea id="page-excerpt" value=page.excerpt rows="2" class=(if hasDescError "form-control mousetrap form-control-lg is-invalid" "form-control form-control-lg mousetrap") placeholder=(localize 'description')}}
</div> </div>
{{/if}} {{/if}}
</div> </div>
@ -30,13 +30,13 @@
<div id={{concat "discard-modal"}} class="modal" tabindex="-1" role="dialog"> <div id={{concat "discard-modal"}} class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header">Discard Changes</div> <div class="modal-header">{{localize 'discard_changes'}}</div>
<div class="modal-body"> <div class="modal-body">
<p>You have made changes - continue editing or discard changes?</p> <p>{{localize 'discard_confirm'}}</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
{{ui/ui-button color=constants.Color.Gray light=true label="Continue editing" dismiss=true}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'continue') dismiss=true}}
{{ui/ui-button color=constants.Color.Red light=true label="Discard changes" onClick=(action "onDiscard")}} {{ui/ui-button color=constants.Color.Red light=true label=(localize 'discard') onClick=(action "onDiscard")}}
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,4 +1,4 @@
{{#section/base-editor-inline document=document folder=folder page=page tip="Concise name that describes code snippet" isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}} {{#section/base-editor-inline document=document folder=folder page=page tip=(localize 'section_code_tip') isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
<div class="section-code-editor"> <div class="section-code-editor">
<div class="syntax-selector"> <div class="syntax-selector">
{{ui/ui-select id=syntaxId {{ui/ui-select id=syntaxId

View file

@ -1,6 +1,6 @@
{{layout/logo-heading {{layout/logo-heading
title="Draw.io" title=(localize 'section_drawio')
desc="For making flowcharts, process diagrams, org charts, UML, ER diagrams, network diagrams and much more (https://about.draw.io)" desc=(localize 'section_drawio_explain')
icon=constants.Icon.Integrations}} icon=constants.Icon.Integrations}}
{{#section/base-editor document=document folder=folder page=page busy=waiting isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}} {{#section/base-editor document=document folder=folder page=page busy=waiting isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}

View file

@ -47,6 +47,8 @@
"search": "Search", "search": "Search",
"send": "Send", "send": "Send",
"share": "Share", "share": "Share",
"discard": "Discard",
"continue": "Continue",
"signin": "Sign In", "signin": "Sign In",
"sort": "Sort", "sort": "Sort",
"sort_ascending": "Ascending", "sort_ascending": "Ascending",
@ -56,6 +58,7 @@
"sort_by_revised": "Last updated", "sort_by_revised": "Last updated",
"unassigned": "Unassigned", "unassigned": "Unassigned",
"update": "Update", "update": "Update",
"updating": "Updating",
"viewed": "Viewed", "viewed": "Viewed",
"edited": "Edited", "edited": "Edited",
"draft": "Draft", "draft": "Draft",
@ -237,16 +240,6 @@
"doc_delete_confirm": "Are you sure you want to delete this document?", "doc_delete_confirm": "Are you sure you want to delete this document?",
"attachment_delete": "Delete Attachment", "attachment_delete": "Delete Attachment",
"attachment_delete_confirm": "Are you sure you want to delete this attachment?", "attachment_delete_confirm": "Are you sure you want to delete this attachment?",
"section_insert": "Insert Section",
"section_insert_here": "Insert section here",
"section_copy_explain": "This section and all nested sections will be copied to the selected document.",
"section_move_explain": "This section and all nested sections will be moved to the selected document.",
"section_delete": "Are you sure you want to delete this section?",
"section_delete_children": "Also delete child sections",
"section_publish": "Publish Re-usable Content Block",
"section_publish_name_explain": "Provide a short title for the reusable content block",
"section_publish_desc_explain": "Short description to help others understand the reusable content block",
"link_insert": "Insert Link", "link_insert": "Insert Link",
"link_type_section": "Section", "link_type_section": "Section",
"link_type_section_explain": "Link to content within this document", "link_type_section_explain": "Link to content within this document",
@ -257,6 +250,8 @@
"link_type_network": "Network", "link_type_network": "Network",
"link_type_network_explain": "Specify network drive/share/folder location", "link_type_network_explain": "Specify network drive/share/folder location",
"link_type_network_example": "e.g. //share/folder", "link_type_network_example": "e.g. //share/folder",
"discard_changes": "Discard changes",
"discard_confirm": "You have made changes - continue editing or discard changes?",
"space_permissions": "Space Permissions", "space_permissions": "Space Permissions",
"space_permissions_explain": "Assign permissions to users or groups and invite new users to this space", "space_permissions_explain": "Assign permissions to users or groups and invite new users to this space",
@ -288,6 +283,23 @@
"space_permission_invite_user": "Invite users to this space", "space_permission_invite_user": "Invite users to this space",
"space_permission_invite_explain": "Comma separate multiple email addresses", "space_permission_invite_explain": "Comma separate multiple email addresses",
"section_insert": "Insert Section",
"section_insert_here": "Insert section here",
"section_copy_explain": "This section and all nested sections will be copied to the selected document.",
"section_move_explain": "This section and all nested sections will be moved to the selected document.",
"section_delete": "Are you sure you want to delete this section?",
"section_delete_children": "Also delete child sections",
"section_publish": "Publish Re-usable Content Block",
"section_publish_name_explain": "Provide a short title for the reusable content block",
"section_publish_desc_explain": "Short description to help others understand the reusable content block",
"section_airtable": "Airtable",
"section_airtable_explain": "Part spreadsheet, part database, and entirely flexible (https://airtable.com)",
"section_airtable_code": "Airtable embed code",
"section_code_tip": "Concise name that describes code snippet",
"section_drawio": "Draw.io",
"section_drawio_explain": "For making flowcharts, process diagrams, org charts, UML, ER diagrams, network diagrams and much more (https://about.draw.io)",
"login_cas": "Authenticating with CAS...", "login_cas": "Authenticating with CAS...",
"login_cass_error": "CAS authentication failure", "login_cass_error": "CAS authentication failure",
"login_keycloak": "Authenticating with Keycloak...", "login_keycloak": "Authenticating with Keycloak...",