Anki/ts/editor
Henrik Giesel dec0fbe845
Refactor i18n (#1405)
Merging note: the typing changes were fixed in a separate PR.

* Put rootDirs into subprojects

- typings do not work for any ts or svelte files
- if we set the 'rootDirs' in ts/tsconfig.json to '../bazel-bin/ts' and then inherit
  them from e.g. editor, the root will be changed to '../../bazel-bin/ts',
  however editor needs look in '../../bazel-bin/ts/editor' instead.

* Rename i18n and i18n_helpers to i18n-generated and i18n

- This way, we can restrict the awkwardness of importing files outside
  the ts directory within lib

* Fix missing typing of i18n and backend_proto by adding back symlinks

* Split up i18n-generated into i18n-{translate,modules}

* Change i18n from singleton to functions

* Revert "Put rootDirs into subprojects"

This partially reverts commit e1d4292ce3.

It seems like this might not be necessary after all.
However some other change made on this branch seems to have fixed
the .svelte.d.ts imports

* Introduce i18n-bundles to remove circular import

There was a circular import i18n.ts <-> i18n-translate.ts

* Create own directory for i18n

* Move lib/i18n/translate to lib/translate

* This restores tree shaking

* Update tsconfig libs and module

* es2018-2020 have wide support on all modern browsers including

* Switch bundles and langs inside i18n to variables again

* Add missing copyright header

* Rename translate.ts to ftl.ts

* Remove the symlinks again

I added them to fix to have completion for tr, however this would have
also have meant to abandon the tree shaking.
As we want to have tree shaking, it's also not necessary to have the
symlinks anymore

* Revert "Update tsconfig libs and module"

This reverts commit 0a96776a47.

* move withCollapsedWhitespace back to i18n/utils

* Add back /ts as in rootDirs
2021-10-07 23:31:49 +10:00
..
AddonButtons.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
AddTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
AutocompleteItem.svelte yarn upgrade --latest 2021-10-01 12:52:53 +10:00
bootstrap.scss Implement TagWithTooltip 2021-09-09 15:38:00 +02:00
BUILD.bazel use extra rootDir in tsconfig instead of symlinks 2021-10-01 18:36:52 +10:00
change-timer.ts Add ChangeTimer.prototype.fireImmediately 2021-09-16 14:47:05 +02:00
ClozeButton.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
codable.ts Define CodeMirror in external codeMirror.ts 2021-09-15 13:45:19 +02:00
codeMirror.ts Satisfy eslint 2021-09-15 13:45:19 +02:00
ColorButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
CommandIconButton.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
Components.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
context-keys.ts disabledKey => fieldFocusedKey 2021-07-05 18:15:03 +02:00
editing-area.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
editor-field.ts First implementation of MathjaxHandleEditor 2021-09-15 13:33:17 +02:00
EditorToolbar.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
fields.scss yarn upgrade --latest 2021-10-01 12:52:53 +10:00
focus-handlers.ts Generalize ChangeTimer and use it in Mathjax editor 2021-09-15 13:33:20 +02:00
FormatBlockButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
FormatInlineButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
HandleBackground.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
HandleControl.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
HandleLabel.svelte Use editorfield instead of editor-field 2021-09-15 13:45:20 +02:00
HandleSelection.svelte Always correctly update MathjaxHandle position 2021-09-15 17:05:43 +02:00
helpers.ts silence execCommand deprecation warnings for now 2021-09-29 11:36:37 +10:00
icons.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
ImageHandle.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
ImageHandleFloatButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
ImageHandleSizeSelect.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
index.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
index_wrapper.ts Export editor globals under anki namespace 2021-07-06 03:48:33 +02:00
input-handlers.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
label-container.ts Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
legacy.scss Uniformly use variables to Button{Toolbar,Group} for setting button properties 2021-05-27 17:13:36 +02:00
lib.ts add missing copyright headers to *.ts 2021-04-13 18:57:08 +10:00
MathjaxHandle.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
MathjaxHandleEditor.svelte Add ChangeTimer.prototype.fireImmediately 2021-09-16 14:47:05 +02:00
MathjaxHandleInlineBlock.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
note-id.ts More uniform file naming 2021-07-01 12:24:16 +02:00
NoteTypeButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
OnlyEditable.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
PreviewButton.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
saving.ts Add ChangeTimer.prototype.fireImmediately 2021-09-16 14:47:05 +02:00
SelectedTagBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
tag-editor.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
Tag.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
TagDeleteBadge.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
TagEditMode.svelte Introduce TagEditMode as a wrapper around TagWithTooltip 2021-09-09 21:47:07 +02:00
TagEditor.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
TagInput.svelte Fix suggestions not showing when typing space in a TagInput 2021-09-15 22:54:53 +02:00
TagOptionsBadge.svelte Implement nowrap mode 2021-09-09 15:38:01 +02:00
tags.ts add basic tag completion to backend 2021-09-09 15:38:08 +02:00
TagWithTooltip.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
TemplateButtons.svelte Refactor i18n (#1405) 2021-10-07 23:31:49 +10:00
toolbar.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
tsconfig.json update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
WithAutocomplete.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
WithColorHelper.svelte Add type hint in WithColorHelper 2021-06-19 16:31:35 +02:00
WithImageConstrained.svelte update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
wrap.ts update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00