Skip to content

Commit

Permalink
fix(editors): only translate button texts when enableTranslate is true
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 8, 2020
1 parent 763f981 commit b698c6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('LongTextEditor', () => {

it('should initialize the editor', () => {
gridOptionMock.translater = translateService;
gridOptionMock.enableTranslate = true;
editor = new LongTextEditor(editorArguments);
const editorCount = document.body.querySelectorAll('.slick-large-editor-text.editor-title textarea').length;
const editorTextCounter = document.body.querySelectorAll<HTMLDivElement>('.slick-large-editor-text.editor-title .editor-footer .counter');
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/editors/longTextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class LongTextEditor implements Editor {
init(): void {
let cancelText = '';
let saveText = '';
if (this._translater && this._translater.translate) {
if (this._translater && this._translater.translate && this.gridOptions.enableTranslate) {
const translationPrefix = getTranslationPrefix(this.gridOptions);
const cancelKey = this.editorOptions.buttonTexts?.cancelKey ?? `${translationPrefix}CANCEL`;
const saveKey = this.editorOptions.buttonTexts?.saveKey ?? `${translationPrefix}SAVE`;
Expand Down

0 comments on commit b698c6b

Please sign in to comment.