locale-mock.js 517 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. /**
  7. * A replacement for the {@link utils.Locale} class.
  8. *
  9. * @memberOf tests.utils._utils
  10. */
  11. export default class Locale {
  12. constructor() {
  13. this.t = ( str ) => `t( ${ str } )`;
  14. }
  15. /**
  16. * Injects instance of this class to the editor.
  17. *
  18. * @param {Editor} editor
  19. */
  20. static inject( editor ) {
  21. editor.locale = new Locale();
  22. editor.t = editor.locale.t;
  23. }
  24. }