editor.js/types/api/i18n.d.ts
Peter Savchenko 21cac86e42
[Feature] i18n (#1106)
* i18n first steps

* i18n internal, toolbox, api for tools

* namespaced api

* tn, t

* tn in block tunes

* join toolbox and inlineTools under toolNames

* translations

* make enum toolTypes

* Update block.ts

* Update src/components/core.ts

Co-Authored-By: George Berezhnoy <gohabereg@users.noreply.github.com>

* add more types

* rm tn

* export i18n types

* upd bundle

* fix tabulation

* Add type-safe namespaces

* upd

* Improve example

* Update toolbox.ts

* improve examplle

* upd

* fix typo

* Add comments for complex types

Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
Co-authored-by: Georgy Berezhnoy <gohabereg@gmail.com>
2020-04-20 21:25:33 +03:00

12 lines
265 B
TypeScript

/**
* Describes Editor`s I18n API
*/
export interface I18n {
/**
* Perform translation with automatically added namespace like `tools.${toolName}` or `blockTunes.${tuneName}`
*
* @param dictKey - what to translate
*/
t(dictKey: string): string;
}