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

Support localization #12

Open
7 tasks done
rodmaia opened this issue Jun 6, 2019 · 6 comments · May be fixed by #173
Open
7 tasks done

Support localization #12

rodmaia opened this issue Jun 6, 2019 · 6 comments · May be fixed by #173
Assignees
Labels

Comments

@rodmaia
Copy link
Collaborator

rodmaia commented Jun 6, 2019

Botflow needs to support multiple languages. For now we will target PT-BR, and EN-US should be supported soon. To accomplish that we will have to prepare the front end to load strings from a localization file.

Tasks

Acceptance criteria

  • Existing front-end is correctly localized when changing language parameter (no need to build UI for that)
  • Changes are available on the Dev environment
@rodmaia rodmaia added question Further information is requested frontend labels Jun 6, 2019
@rodmaia rodmaia removed the question Further information is requested label Jun 17, 2019
@rodmaia rodmaia changed the title Support localization (5) Support localization Jun 17, 2019
@rodmaia rodmaia added this to the Sprint 2 milestone Jun 17, 2019
@rodmaia rodmaia modified the milestones: Sprint 2, Sprint 3 Jul 1, 2019
@rodmaia rodmaia modified the milestones: Sprint 3, Sprint 2 Jul 18, 2019
@rodmaia rodmaia removed this from the Sprint 2 milestone Jul 29, 2019
@rodmaia rodmaia changed the title (5) Support localization Support localization Feb 11, 2021
@mansogf mansogf self-assigned this Mar 16, 2021
@mansogf mansogf linked a pull request Mar 25, 2021 that will close this issue
@mansogf
Copy link
Collaborator

mansogf commented Apr 8, 2021

Translations are in the following path:

translate   
│   └───languages
│       │   en.js
│       │   index.js
│       │   pt.js
│       index.js

In the case of adding more languages, the file must be created in the languages folder.

The structure of the translation file must be according to the name of the page/component and the string as the following example:

const messages = {
  en: {
    translations: { // Mesmo valor usado nas configurações (defaultNS)
      menu_nav_bar: {
        dialogues: 'Dialogues',
        questions: 'Questions',
        answers: 'Answers'
      },
      stories_page: {
        create_dialogue: "Create",
        filter: 'Filter'
      },
      stories_edit_page: {
        questions: 'Questions',
        answers: 'Answers',
        filter: 'Filter'
      },
      deleted: "Item deleted",
      no_result: "No items found",
      repeated_name: "Try a different name, it already exists",
      no_special_char: "Use only letters without accents, numbers or _",
      no_dialogs: "Click on the questions and answers to set up a dialogue with expected interaction examples",
      delete_confirmation: "Delete item?",
      exportar_conteudo: 'Export content',
      story: {
        created: "Dialogue created",
        deleted: "Dialogue deleted",
        updated: "Dialogue updated",
        create_button: "Create new dialogue",
        first_element: "The dialogue must begin with a question",
        two_intents: "Add an answer after each question",
      },
    intent: {
        created: "Question created",
        deleted: "Question deleted",
        updated: "Updated question",
        toolbar_name: "Question title",
        list_filter: "Registered questions",
        create_button: "Create new question",
        placeholder: "Ex: Gen_Greet, How_To_Reg_Serv",
        name_good_pratice: "To identify the questions clearly, indicate the main subject and then the type of question, separated by '_'",
      },
    utter: {
        created: "Answer created",
        deleted: "Answer deleted",
        selection: "Balloons appear:",
        sequence_text: "sequentially",
        updated: "Answer updated",
        toolbar_name: "Answer title",
        create_button: "Create new answer",
        list_filter: "Answers registered",
        alternatives_text: "as alternative",
        placeholder: "Ex: Ans_Gen_Greet, Ans_How_To_Reg_Serv",
        name_good_pratice: "To identify the answers clearly, use 'Resp_' and the title of the corresponding question, if any",
      },
      toolbar_name: "Save",
      list_filter: 'Filter',
      intent_form: {
        new_question: 'New question'
      },
      uttter_form: {
        new_balloon: 'New answer balloon'
      },
      example_story:  'Example:'
    }
  }
}

export { messages }

@rodmaia rodmaia linked a pull request Apr 14, 2021 that will close this issue
@rodmaia
Copy link
Collaborator Author

rodmaia commented Apr 14, 2021

Fantastic work @gabrielfilipe7unb! I just did a quick update on some strings to follow RASA standard of "story", "intent" and "utter".

There are two places that remain unlocalized: the "Desfazer" button that appears on snackbars (e.g. after you delete something) and the "Apagar" button that appears inside the overflow menu of each section (right beside the save button).

@mansogf
Copy link
Collaborator

mansogf commented Apr 21, 2021

I think now we are good to go!

@rodmaia
Copy link
Collaborator Author

rodmaia commented May 4, 2021

EN strings look OK, but when I run the app in PT-BR...

Untitled

@mansogf
Copy link
Collaborator

mansogf commented May 5, 2021

Here we go!

Captura de Tela 2021-05-05 às 18 44 16

@rodmaia
Copy link
Collaborator Author

rodmaia commented May 19, 2021

Confirmed! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants