locale-mock.js 502 B

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