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

i18n section strings

This commit is contained in:
McMatts 2022-03-10 15:21:25 -05:00
parent ce9c635fb4
commit 20c9168140
7 changed files with 79 additions and 39 deletions

View file

@ -28,6 +28,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
}, },
didReceiveAttrs() { didReceiveAttrs() {
this._super();
let config = {}; let config = {};
try { try {

View file

@ -28,6 +28,8 @@ export default Component.extend({
}, },
didReceiveAttrs() { didReceiveAttrs() {
this._super();
let pdfOption = {}; let pdfOption = {};
try { try {

View file

@ -17,11 +17,12 @@ 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,
diagramText: '', diagramText: '',
diagramPreview: null, diagramPreview: null,
previewButtonCaption: 'Preview', previewButtonCaption: '',
editorId: computed('page', function () { editorId: computed('page', function () {
let page = this.get('page'); let page = this.get('page');
return `plantuml-editor-${page.id}`; return `plantuml-editor-${page.id}`;
@ -34,9 +35,14 @@ export default Component.extend({
return _.isEmpty(this.get('diagramText')); return _.isEmpty(this.get('diagramText'));
}), }),
init(...args) {
this._super(...args);
this.previewButtonCaption = this.i18n.localize('preview');
},
generatePreview() { generatePreview() {
this.set('waiting', true); this.set('waiting', true);
this.set('previewButtonCaption', 'Generating preview...'); this.set('previewButtonCaption', this.i18n.localize('preview_wait'));
let self = this; let self = this;
let data = { data: this.get('diagramText') }; let data = { data: this.get('diagramText') };
@ -45,11 +51,11 @@ export default Component.extend({
this.get('sectionSvc').fetch(this.get('page'), 'preview', data).then(function (response) { this.get('sectionSvc').fetch(this.get('page'), 'preview', data).then(function (response) {
self.set('diagramPreview', response.data); self.set('diagramPreview', response.data);
self.set('waiting', false); self.set('waiting', false);
self.set('previewButtonCaption', 'Preview'); self.set('previewButtonCaption', this.i18n.localize('preview'));
}, function (reason) { // eslint-disable-line no-unused-vars }, function (reason) { // eslint-disable-line no-unused-vars
self.set('diagramPreview', null); self.set('diagramPreview', null);
self.set('waiting', false); self.set('waiting', false);
self.set('previewButtonCaption', 'Preview'); self.set('previewButtonCaption', this.i18n.localize('preview'));
}); });
}); });
}, },

View file

@ -1,6 +1,6 @@
{{layout/logo-heading {{layout/logo-heading
title="Papertrail" title=(localize 'section_papertrail')
desc="Display your cloud-based logs (https://papertrailapp.com)" desc=(localize 'section_papertrail_explain')
icon=constants.Icon.Integrations}} icon=constants.Icon.Integrations}}
{{#section/base-editor document=document folder=folder page=page busy=waiting {{#section/base-editor document=document folder=folder page=page busy=waiting
@ -10,9 +10,8 @@
<div class="grid-cell-1"> <div class="grid-cell-1">
<form {{action "auth" on="submit"}} > <form {{action "auth" on="submit"}} >
<div class="form-group"> <div class="form-group">
<label>Papertrail API Key</label> <label>{{localize 'section_papertrail_key'}}</label>
{{focus-input id="papertrail-apitoken" type="password" value=config.APIToken class="form-control"}} {{focus-input id="papertrail-apitoken" type="password" value=config.APIToken class="form-control"}}
<small class="form-text text-muted">API Token (from your profile)</small>
</div> </div>
{{ui/ui-button color=constants.Color.Green light=true label=(localize 'authenticate') onClick=(action "auth")}} {{ui/ui-button color=constants.Color.Green light=true label=(localize 'authenticate') onClick=(action "auth")}}
</form> </form>
@ -21,19 +20,19 @@
{{#if authenticated}} {{#if authenticated}}
<form {{action "onAction" on="submit"}} role="form"> <form {{action "onAction" on="submit"}} role="form">
<div class="form-group"> <div class="form-group">
<label for="papertrail-query">Search query</label> <label for="papertrail-query">{{localize 'section_papertrail_search'}}</label>
{{input id="papertrail-query" type="text" class="form-control mousetrap" value=config.query}} {{input id="papertrail-query" type="text" class="form-control mousetrap" value=config.query}}
<small class="form-text text-muted">Determine which log entries you want to display e.g. bob OR ("some phrase" AND sally)</small> <small class="form-text text-muted">{{localize 'section_papertrail_search_explain'}}</small>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="papertrail-max">Maximum results</label> <label for="papertrail-max">{{localize 'section_papetrail_max'}}</label>
{{input id="papertrail-max" type="number" class="form-control mousetrap" value=config.max}} {{input id="papertrail-max" type="number" class="form-control mousetrap" value=config.max}}
<small class="form-text text-muted">How many log entries do you want?</small> <small class="form-text text-muted">{{localize 'section_papetrail__max_explain'}}</small>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="group-dropdown">Group</label> <label for="group-dropdown">{{localize 'section_papetrail_group'}}</label>
{{ui/ui-select id="group-dropdown" prompt="<group>" content=options.groups action=(action "onGroupsChange") optionValuePath="id" optionLabelPath="name" selection=config.group}} {{ui/ui-select id="group-dropdown" prompt="<group>" content=options.groups action=(action "onGroupsChange") optionValuePath="id" optionLabelPath="name" selection=config.group}}
<small class="form-text text-muted">Optional Papertrail group</small> <small class="form-text text-muted">{{localize 'section_papetrail_group_explain'}}</small>
</div> </div>
</form> </form>
{{/if}} {{/if}}

View file

@ -1,37 +1,37 @@
{{#section/base-editor-inline document=document folder=folder page=page tip="Select PDF to render" isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}} {{#section/base-editor-inline document=document folder=folder page=page tip=(localize 'section_pdf') isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
<div class="form-group"> <div class="form-group">
<label for="new-space-name">PDF</label> <label for="new-space-name">{{localize 'pdf'}}</label>
{{input type="text" class="form-control mousetrap" placeholder="click upload button below" value=pdfName readonly=true}} {{input type="text" class="form-control mousetrap" placeholder="click upload button below" value=pdfName readonly=true}}
<small class="form-text text-muted">First PDF uploaded will be used</small> <small class="form-text text-muted">{{localize 'section_pdf_upload_explain'}}</small>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="new-space-name">Preview Height</label> <label for="new-space-name">{{localize 'section_pdf_height'}}</label>
{{input type="number" class="form-control mousetrap" placeholder="e.g. 700" value=pdfOption.height}} {{input type="number" class="form-control mousetrap" placeholder="e.g. 700" value=pdfOption.height}}
<small class="form-text text-muted">How tall is the PDF preview?</small> <small class="form-text text-muted">{{localize 'section_pdf_height_explain'}}</small>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="new-space-name">Start Page</label> <label for="new-space-name">{{localize 'section_pdf_start'}}</label>
{{input type="number" class="form-control mousetrap" placeholder="e.g. 1" value=pdfOption.startPage}} {{input type="number" class="form-control mousetrap" placeholder="e.g. 1" value=pdfOption.startPage}}
<small class="form-text text-muted">The first page to display</small> <small class="form-text text-muted">{{localize 'section_pdf_start_explain'}}</small>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="new-space-name">Sidebar</label> <label for="new-space-name">{{localize 'section_pdf_sidebar'}}</label>
<select onchange={{action "onSetSidebar" value="target.value"}} class="form-control" role="button" tabindex="0"> <select onchange={{action "onSetSidebar" value="target.value"}} class="form-control" role="button" tabindex="0">
<option value="none" selected={{is-equal pdfOption.sidebar "none"}}> <option value="none" selected={{is-equal pdfOption.sidebar "none"}}>
None {{localize 'section_pdf_sidebar_none'}}
</option> </option>
<option value="bookmarks" selected={{is-equal pdfOption.sidebar "bookmarks"}}> <option value="bookmarks" selected={{is-equal pdfOption.sidebar "bookmarks"}}>
Bookmarks {{localize 'section_pdf_sidebar_bookmark'}}
</option> </option>
<option value="thumbs" selected={{is-equal pdfOption.sidebar "thumbs"}}> <option value="thumbs" selected={{is-equal pdfOption.sidebar "thumbs"}}>
Thumbnails {{localize 'section_pdf_sidebar_thumbnail'}}
</option> </option>
</select> </select>
<small class="form-text text-muted">Optionally, set sidebar content</small> <small class="form-text text-muted">{{localize 'section_pdf_sidebar_explain'}}</small>
</div> </div>
{{/section/base-editor-inline}} {{/section/base-editor-inline}}

View file

@ -1,6 +1,6 @@
{{layout/logo-heading {{layout/logo-heading
title="PlantUML" title=(localize 'section_plantuml')
desc="Create UML diagrams from a plain text language (http://plantuml.com)" desc=(localize 'section_plantuml_explain')
icon=constants.Icon.Integrations}} icon=constants.Icon.Integrations}}
{{#section/base-editor document=document folder=folder page=page busy=waiting {{#section/base-editor document=document folder=folder page=page busy=waiting
@ -14,15 +14,15 @@
{{#if emptyDiagram}} {{#if emptyDiagram}}
<div> <div>
<Ui::UiSpacer @size="100" /> <Ui::UiSpacer @size="100" />
<p>Insert sample diagrams:</p> <p>{{localize 'insert'}}</p>
<p> <p>
{{ui/ui-button color=constants.Color.Gray light=true label="Sequence" onClick=(action "onInsertSequence")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_sequence') onClick=(action "onInsertSequence")}}
{{ui/ui-button color=constants.Color.Gray light=true label="Use Case" onClick=(action "onInsertUseCase")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_usecase') onClick=(action "onInsertUseCase")}}
{{ui/ui-button color=constants.Color.Gray light=true label="Class" onClick=(action "onInsertClass")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_class') onClick=(action "onInsertClass")}}
{{ui/ui-button color=constants.Color.Gray light=true label="Activity" onClick=(action "onInsertActivity")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_activity') onClick=(action "onInsertActivity")}}
{{ui/ui-button color=constants.Color.Gray light=true label="Activity (new syntax)" onClick=(action "onInsertActivityNew")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_activity2') onClick=(action "onInsertActivityNew")}}
{{ui/ui-button color=constants.Color.Gray light=true label="Component" onClick=(action "onInsertComponent")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_component') onClick=(action "onInsertComponent")}}
{{ui/ui-button color=constants.Color.Gray light=true label="State" onClick=(action "onInsertState")}} {{ui/ui-button color=constants.Color.Gray light=true label=(localize 'section_plantuml_type_state') onClick=(action "onInsertState")}}
</p> </p>
</div> </div>
{{/if}} {{/if}}

View file

@ -19,6 +19,7 @@
"import": "Import", "import": "Import",
"export": "Export", "export": "Export",
"exported": "Exported", "exported": "Exported",
"pdf": "PDF",
"test": "Test", "test": "Test",
"configure": "Configure", "configure": "Configure",
"error": "Error", "error": "Error",
@ -36,6 +37,7 @@
"next": "Next", "next": "Next",
"ok": "OK", "ok": "OK",
"preview": "Preview", "preview": "Preview",
"preview_wait": "Generating preview...",
"publish": "Publish", "publish": "Publish",
"print": "Print", "print": "Print",
"reject": "Reject", "reject": "Reject",
@ -313,6 +315,36 @@
"section_jira_explain": "Jira provides issue tracking and agile software", "section_jira_explain": "Jira provides issue tracking and agile software",
"section_jira_admin": "Your Documize Community administrator needs to provide Jira connection details before usage.", "section_jira_admin": "Your Documize Community administrator needs to provide Jira connection details before usage.",
"section_jira_no_auth": "Jira connector not authenticated", "section_jira_no_auth": "Jira connector not authenticated",
"section_papertrail": "Papertrail",
"section_papertrail_explain": "Display your cloud-based logs (https://papertrailapp.com)",
"section_papertrail_key": "Papertrail API Key",
"section_papertrail_search": "Search query",
"section_papertrail_search_explain": "Determine which log entries you want to display e.g. bob OR (\"some phrase\" AND sally)",
"section_papertrail_max": "Maximum results",
"section_papertrail_max_explain": "How many log entries do you want?",
"section_papertrail_group": "Group",
"section_papertrail_group_explain": "Optional Papertrail group",
"section_pdf": "PDF Viewer",
"section_pdf_upload_explain": "First PDF uploaded will be used",
"section_pdf_height": "Preview Height",
"section_pdf_height_explain": "How tall is the PDF preview?",
"section_pdf_start": "Start Page",
"section_pdf_start_explain": "The first page to display",
"section_pdf_sidebar": "Sidebar",
"section_pdf_sidebar_explain": "Optionally, set sidebar content",
"section_pdf_sidebar_none": "None",
"section_pdf_sidebar_bookmark": "Bookmarks",
"section_pdf_sidebar_thumbnail": "Thumbnails",
"section_plantuml": "PlantUML",
"section_plantuml_explain": "Create UML diagrams from a plain text language (http://plantuml.com)",
"section_plantuml_link": "PlantUML Diagram",
"section_plantuml_type_sequence": "Sequence",
"section_plantuml_type_usecase": "Use Case",
"section_plantuml_type_class": "Class",
"section_plantuml_type_activity": "Activity",
"section_plantuml_type_activity2": "Activity (new syntax)",
"section_plantuml_type_component": "Component",
"section_plantuml_type_state": "State",
"login_cas": "Authenticating with CAS...", "login_cas": "Authenticating with CAS...",
"login_cass_error": "CAS authentication failure", "login_cass_error": "CAS authentication failure",