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

Add multiple language localizations to compose component #283

Open
susanm74 opened this issue Mar 10, 2023 · 4 comments
Open

Add multiple language localizations to compose component #283

susanm74 opened this issue Mar 10, 2023 · 4 comments
Assignees

Comments

@susanm74
Copy link
Contributor

susanm74 commented Mar 10, 2023

  • compose component needs to support multi-language localization (aka translations cont'd)

  • add this as a searchable dropdown directly above the chatbox in the compose component that should allow the user to toggle back and forth between languages

  • translations dropdown should be hidden for usage such as the contact chat (when the user is sending a one-time text or attachments to a single recipient), and should be displayed for usage such as for broadcasts (when the user is sending text or attachments to multiple recipients, and needs to send the content in potentially multiple languages)

  • dropdown should display a list of languages filtered based on the org's languages

  • if the user has text and attachments for arabic, but then the org removes arabic from it's list of languages, don’t display the arabic translations in the component, and upon save, remove from the arabic translation from the translations

  • extra credit - show which languages content has been translated into vs. not translated via icons on the left side of the dropdown language option

  • todo - how to handle incomplete or partially localized attachments:

    • when a user provides text and attachments in one language - all good
    • when a user provides text and attachments in multiple languages - all good
    • when a user provides text in multiple languages (ex. english and spanish) but only provides attachments in one language (ex. english), when we go to save/send the spanish broadcast, do we send:
      • no attachments?
      • the english ones?
      • disallow the user from saving without specifying "spanish" attachments?
      • allow the user to specify how to handle and whether to send the english ones vs none, for any/all other languages for which attachments have not been provided?

potentially relevant broadcast discussions:

@susanm74 susanm74 self-assigned this Mar 10, 2023
@susanm74 susanm74 changed the title compose component - multiple language localization compose component - add multiple language localization Mar 10, 2023
@susanm74
Copy link
Contributor Author

@ericnewcomer
Copy link
Member

Hey @rowanseymour, @susanm74 is hitting on the oft discussed localized attachment question. I think I know where we landed on this, but I don't want to add confusion if I have it wrong. I'll let you chime in here first.

@susanm74 susanm74 changed the title compose component - add multiple language localization compose - add multiple language localization Apr 4, 2023
@susanm74
Copy link
Contributor Author

susanm74 commented Apr 7, 2023

@ericnewcomer @rowanseymour just wanted to resolve how we want to handle partially localized attachments (see above) and let me know what attachments translations we should expect to save in this scenario

@susanm74 susanm74 changed the title compose - add multiple language localization compose - translations cont'd - add multiple language localization Apr 7, 2023
@rowanseymour
Copy link
Member

We want the behaviour to be consistent between sending a broadcast from the UI and sending a broadcast in a flow. Currently this means we resolve each part of message separately - i.e. resolve the text by checking contact language, default org language, flow base language, then resolve the attachments that way, then quick replies.

So for example if we have a flow base language of eng, then the following translations on a broadcast:

{"eng": {"text": "hi"}, "spa": {"quick_replies": ["si", "no"], "ara": {"attachments": ["http://test.jpg"]}}}

will be resolved for contacts with these languages as follows:

"eng" => {"text": "hi", "attachments": [], "quick_replies": []}, 
"spa" => {"text": "hi", "attachments": [], "quick_replies": ["si", "no"]}}
"ara" => {"text": "hi", "attachments": ["http://test.jpg"], "quick_replies": []}}

That resolving currently happens in goflow/mailroom * and I think that's where it should stay. So the UI saves translations in their "sparse" format, and mailroom resolves what we actually send to a given contact.

  • Currently broadcasts created in a flow are resolved by goflow and queued for handling in their resolved form, whereas broadcasts created by the API are saved/queued in their sparse form and resolved at the point of sending... the same applies to when expressions are evaluated and I don't love this being slightly different.

@susanm74 susanm74 changed the title compose - translations cont'd - add multiple language localization Add multiple language localizations to compose component Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants