Closed Bug 1392255 Opened 5 years ago Closed 4 years ago

[FTL] Enable source view support


(Webtools Graveyard :: Pontoon, enhancement, P2)



(Not tracked)



(Reporter: mathjazz, Assigned: mathjazz)



(Whiteboard: l10n-docs-added)


(1 file)

We need to enable source view for FTL strings, in order to bring support to all FTL messages, including the ones we don't have a dedicated UI for.

We should also allow users to switch between source view and the rich UI when this is possible.
Whiteboard: l10n-docs-needed
Commit pushed to master at
Fix bug 1392255: Enable source view for FTL messages (#749)

Restore FTL button and enable switching between source and FTL editor:
- Fallback to source view for translations not supported in FTL editor.
- Same for source strings.
- Switching reflects changes in either editor.
- Prevent switching to rich editor if message not supported.
- Show translation length and Copy from source only for simple FTL
  strings and only in FTL editor.
- For untranslated strings not supported in rich editor, show source
  view if source string displayed as source.
- Autofill source view for untranslated strings with `key =`.

Always use #translation textarea for source editor and #ftl-area for FTL
editor (even for simple strings). Similarly, even simple source strings
are displayed in #ftl-original. To make that possible, we keep entity
and translation objects unchanged for non-complex FTL strings.

Other improvements:
- Refactor code style of fluent_interface.js.
- Bugfix: Update editor when FTL message unrejected.
- Join renderEditorWithTranslation() and renderEditor() functions.
- Focus first element, regardless if <input> or <textarea>.
- Properly calculate translation length of FTL messages.
- Properly warn about unsaved changes for FTL messages.
Closed: 4 years ago
Resolution: --- → FIXED
Commit pushed to master at
Revert "Fix bug 1392255: Enable source view for FTL messages (#749)"

This reverts commit 1159b6f2de9057960e9083dcbe600f45a98cf4c3.
Resolution: FIXED → ---
Commits pushed to master at
Revert "Revert "Fix bug 1392255: Enable source view for FTL messages (#749)""

This reverts commit 874cb0198775661b3194e3cca1330ddce164d3a9.
Bug 1392255: Address bugs found during testing

- Strip trailing newlines for easier translated status detection. This
  fixes the bug that prevented switching back to the rich FTL editor
  after switching to source view for untranslated pluralized source

- Prevent unsaved changes warning to show up when saving virtually any
  FTL translation.

- Treat strings containing only text and references to external
  arguments and other messages as simple strings.

- Extend copy from helpers support for FTL strings:
  * Allow copy from history and other locales in source editor
  * Allow copy from other locales in rich FTL editor

- Allow switching to rich FTL if source editor empty.

- Add ability to display custom plural forms. Previously, FTL editor
  only supported pluralized translations that used variants for one of
  the CLDR plural forms available for the locale. FTL also allows adding
  custom variants, usually numbers, usually 0. Because "No strings"
  sounds better than "0 Strings".

- In FTL source editor, use default tab behaviour.
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Whiteboard: l10n-docs-needed → l10n-docs-added
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.