Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual editor & All format support #1547

Closed
37 of 45 tasks
Martin005 opened this issue Feb 12, 2023 · 10 comments
Closed
37 of 45 tasks

Visual editor & All format support #1547

Martin005 opened this issue Feb 12, 2023 · 10 comments
Assignees
Labels
roadmap item Items that are automatically added to the Roadmap

Comments

@Martin005
Copy link
Contributor

Martin005 commented Feb 12, 2023

Visual editor

The current editor helps you with ICU syntax but doesn't help you with placeholders or HTML tags. For many, this is not an issue but it's problematic for example in the Arabic language, where it's hard to mix HTML and Arabic characters.

By visual editor, we mean a nice environment, where tags and parameter placeholders are represented visually, so translators don't have to worry about them. The plurals are also visually represented, so users can edit them without understanding the message formatting language.

Formats support

Tolgee currently works fine with ICU message format and you can import data in .po format. However, there are many more formats we want to support. We would like to create a universal solution for format support, so we will be able to support any format in the future.

Checklist

Required

  • User is able to to import data in any of these formats

    • ICU
    • .po (python, c, PHP)
    • XLIFF
    • iOS
    • Android
    • Flutter
    • i18next
    • Structured YAML
    • .properties
  • We are able to export the data (with possible incompatibility warnings)

    • ICU
    • .po (python, c, PHP)
      • Let user choose to export base strings as keys (this might be required for plurals in some implementations)
    • XLIFF
    • iOS
    • Android
    • Flutter
    • i18next
    • Structured YAML
    • .properties
  • Translators edit text, not HTML or placeholders

  • Users can edit placeholders and HTML tags

  • Support for RTL languages

  • It's backwards-compatible

    • We are able to convert existing strings to the new format
    • We are able to export the same data as before
  • Enable export of selected keys only

Optional

  • User can decide placeholder format when exporting
  • When importing and immediately exporting, user get the same data
  • We don't have to migrate the data

Plural support

Tolgee will store plurals in ICU message format. When importing from other formats, the string will be converted to ICU plurals. The inner of each plural form will be escaped, so it doesn't get interpreted and doesn't break ICU formatter. For such strings special plural editor with input for each form will be displayed. Nested or multiple plurals per key won't be supported for other than ICU strings. For ICU strings, single input with raw ICU string will be displayed.

Universal ICU Placeholders

Tolgee will be able to convert specific parameters to it's native Universal ICU Placeholders. The syntax

{param_name, [param_type], [param_style]}

Supported conversions:

{param_name}

  • %s from Php and C/C++ .po files
  • %(param_name)s from python .po files
  • %@ from Apple .strings, .stringsdict, .xliff

{param_name, number}

  • %d from Php and C/C++ .po files
  • %(param_name)d from python .po files
  • %lld from Apple .strings, .stringsdict, .xliff

{param_name, number, scientific}

  • %e from Php and C/C++ .po files
  • %(param_name)e from python .po files
  • %e from Apple .strings, .stringsdict, .xliff

{param_name, number, 0.precision zeros}

  • Precision zeros: 0 times the precision. e.g. : 0.00 for precision 2, for example php's "%0.3f" will be converted to {0, number, 0.00}
  • Max precision is 50 otherwise parameter won't be converted
  • %0.precisionf from Php and C/C++ .po files
  • %(param_name)0.*precision*f from python .po files
  • %0.precisionf from Apple .strings, .stringsdict, .xliff

Disabled Universal ICU Placeholders

To make Tolgee more convenient for users who work with native formats like .po or .strings, which use the c-like placeholders like %s, there will be option to disable Universal ICU placeholders.

When ICU Universal Placeholders is disabled, the escaping will happen only for ICU format plural forms, otherwise, strings won't be escaped.

  • Add the disable universal ICU placeholders option to project settings

Placeholder conversion on export

  • On export the parameters will be converted to matching parameter in specific format.

Placeholder conversion on export

  • When importing user may choose to convert or not to convert the parameters to Universal ICU Placeholders.
  • If Universal ICU Placeholders are disabled on project level, it won't be converted and the option will be disabled

Apple format specifics

Apple format does support different plural forms then ICU Message Format, while they declare, they follow Unicode standard. Since Tolgee will support only the ICU forms, the unsupported form from apple files will be discarded.

  • Document plural forms importing behaviour

Import JSON and yaml

  • Enable array imports for JSON
  • Enable array imports for YAML

Before finalization checklist

  • Add links to the docs for the checkbox help buttons in the Import view
  • Handle different plural forms for different languages when user changes existing language in the import endpoint (especially for .po, where it can be imported wrong, because of guessed language)
  • Pass existing language tag to the file processors, so it can provide correct plural forms
  • Test xcstrings plural variants for apple xliff
  • Fix errors when uploading multiple same files (constraint violations)
  • Fix escaping in .po files when uploading data with icu characters in plurals

Docs

  • Add other items to integrations item in platform docs and list all the SDKs and formats, so users can simply find them
@Martin005 Martin005 added the roadmap item Items that are automatically added to the Roadmap label Feb 12, 2023
@Martin005 Martin005 changed the title Visual editor Visual editor & All format support Feb 13, 2023
@Martin005 Martin005 moved this to Todo in Tolgee Roadmap Feb 16, 2023
@JanCizmar JanCizmar self-assigned this May 17, 2023
@chogarcia
Copy link

any update on this? looks like tolgee/tolgee-js#3077 is almost there

@JanCizmar
Copy link
Contributor

any update on this? looks like tolgee/tolgee-js#3077 is almost there

The issue you're mentioning is not related to this. That issue mentions the ability to render Markdown on frontend. (Which we probably won't do now, since we don't want to over-engineer the package)

@chogarcia
Copy link

thanks for replying, what about having markdown in visual editor? any ETA on that?

@JanCizmar
Copy link
Contributor

thanks for replying, what about having markdown in visual editor? any ETA on that?

End of September I hope : https://github.com/orgs/tolgee/projects/2?pane=issue&itemId=20285299

@CoenQian
Copy link

any update on this? Q4 is almost over.

@JanCizmar
Copy link
Contributor

Hello @CoenQian, @chogarcia !

Sorry we're a bit delayed. But we have a deadline on February 16th. Please let me know if you're looking for a specific format, we will be supper happy for projects who would test our solution with different formats. :)

@JanCizmar
Copy link
Contributor

Hello everyone! Unfortunately, we have to extend the deadline for this task by two weeks. We've encountered several issues due to the task's complexity and want to ensure a high-quality result. Also because future modifications could lead to breaking changes in the API and the behaviour of the import and export.

The new deadline is 1st March. We apologize for any inconvenience.

@chogarcia
Copy link

chogarcia commented Feb 24, 2024

wow thats awesome, looking forward to it!

what we are looking for is a text editor we can format (as markdown ideally) so we can parse it on the frontend to display long texts with paragraphs, bold, italic, titles, etc. Atm creating one key for each paragraph is been a nightmare to the point where we were considering other options and move away from tolgee.

@JanCizmar
Copy link
Contributor

Update: Due to delays with last implementation details and writing documentation, we need to postpone the release day to 5th March.

@JanCizmar
Copy link
Contributor

JanCizmar commented Mar 8, 2024

Hey! We've released the major Visual Editor & Formats support on Tuesday 🎉.

There are still some subtasks, we didn't finish in time, so I am converting it to separate issues.

To make this super user convenient, we also need to enhance the CLI, which will also unlock simpler integration with Github and Gitlab.

@github-project-automation github-project-automation bot moved this from Todo to Done in Tolgee Roadmap Mar 8, 2024
@JanCizmar JanCizmar mentioned this issue Mar 12, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap item Items that are automatically added to the Roadmap
Projects
Status: Done
Development

No branches or pull requests

5 participants