Skip to content

Conversation

@andrewn
Copy link
Member

@andrewn andrewn commented Aug 13, 2020

This extracts the UI text for Console, Sidebar and FileNode components in English, ready for Spanish translations.

I extracted Common.DeleteConfirmation as I know that the same language is used in many places in the app.

There's some duplication with the "add file/folder" entries in Sidebar/FileNode. If we want them to share a translation entry in future then they should use a shared component. For now, this is fine.

@oruburos Can you review this please?

--

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)

- Fixes typo with "Close file contents", should be "folder"
- Creates Common.DeleteConfirmation as it's used in many places in the app
@andrewn andrewn requested a review from oruburos August 13, 2020 10:00
@oruburos
Copy link
Collaborator

I think that the check is failing because the FileNode.test have a problem. It is related to #1537 and how to mock the t function in the tests.

@andrewn
Copy link
Member Author

andrewn commented Aug 13, 2020

@oruburos I've fixed the failing tests by mocking react-i18next in all the client-side tests. This provides a mock t function that will perform a look-up on the real English translations.

We'll probably want to re-visit this in future and use i18next directly, but I think this is good enough for now as it unblocks the translation work.

@oruburos
Copy link
Collaborator

Yes, this works!

@andrewn
Copy link
Member Author

andrewn commented Aug 13, 2020

Yes, this works!

Great! Can you approve this PR and I'll merge it.

oruburos
oruburos previously approved these changes Aug 13, 2020
Copy link
Collaborator

@oruburos oruburos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works as it is , but placing the following entries in the translation spanish file I'd say that is the next step, I don't know if request a change or wait for a next PR:

"Sidebar": {
"Title": "Archivos del bosquejo",
"ToggleARIA": "Alternar abrir/cerrar opciones del bosquejo",
"AddFolder": "Crear directorio",
"AddFolderARIA": "Crear directorio",
"AddFile": "Agregar archivo",
"AddFileARIA": "agregar archivo",
"UploadFile": "Subir archivo",
"UploadFileARIA": "Subir archivo"
},
"FileNode": {
"OpenFolderARIA": "Abrir contenido del directorio",
"CloseFolderARIA": "Cerrar contenido del directorio",
"ToggleFileOptionsARIA": "Alternar abrir/cerrar opciones del bosquejo",
"AddFolder": "Crear directorio",
"AddFolderARIA": "Crear directorio",
"AddFile": "Agregar archivo",
"AddFileARIA": "agregar archivo",
"UploadFile": "Subir archivo",
"UploadFileARIA": "Subir archivo",
"Rename": "Renombrar",
"Delete": "Borrar"
},

@andrewn
Copy link
Member Author

andrewn commented Aug 13, 2020

This PR is about extracting the English text and getting it ready for Spanish translations. If you approve it, I can then merge it and you can do a follow-up PR with the Spanish translations.

@andrewn
Copy link
Member Author

andrewn commented Aug 13, 2020

FYI: ToggleFileOptionsARIA is not translated in your comment above.

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

Successfully merging this pull request may close these issues.

2 participants