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

[i18n] Export & import translations #3123

Closed
wants to merge 10 commits into from

Conversation

rajatvijay
Copy link
Contributor

Relates #2927

Pre-requisites

It needs GNU's gettext to be installed in the docker

docker exec -it mathesar_service_dev /bin/bash
apt update
apt install gettext

I will add this to the documentation once I get to the documentation tasks listed here.

Uploading BE translations to transifex

docker exec -it mathesar_service_dev /bin/bash
./generate-and-push-be-translations.sh

Downloading BE translations from transifex

docker exec -it mathesar_service_dev /bin/bash
./pull-and-import-be-translations.sh

Uploading FE translations to transifex

docker exec -it mathesar_service_dev /bin/bash
cd mathesar_ui
npm run i18n:upload-source-strings

Downloading FE translations from transifex

docker exec -it mathesar_service_dev /bin/bash
cd mathesar_ui
npm run i18n:download-translations

Env token

These scripts need TRANSIFEX_TOKEN to be able to authenticate with the transifex service and identify mathesar project.
The scripts are written in a way that if the TRANSIFEX_TOKEN is not available in the environment it prompts the user.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@rajatvijay rajatvijay added this to the v0.1.3 milestone Aug 2, 2023
@rajatvijay rajatvijay marked this pull request as ready for review August 2, 2023 12:31
@rajatvijay rajatvijay added the pr-status: review A PR awaiting review label Aug 2, 2023
@seancolsen
Copy link
Contributor

@rajatvijay I've skimmed the diff but I'm not really sure how to review this. Can you provide some more instruction for me? What do I do to test this out? What should I expect to happen if it works?

This is the sort of PR that I think would be ideal to make in tandem with developer documentation that explains how it all works. Can we get started on that documentation now? It doesn't need to be perfect, but it's the sort of thing that will help me and Mukesh review this PR. And in running through the documentation while reviewing the PR, we'd also be stress-testing the documentation at the same time (which I think works better than trying to do it later, on its own, once someone like me already understands the whole process).

@rajatvijay rajatvijay modified the milestones: v0.1.3, v0.1.4 Aug 17, 2023
@silentninja
Copy link
Contributor

This is the sort of PR that I think would be ideal to make in tandem with developer documentation that explains how it all works

Agreed. I am not sure what is meant by "Uploading BE translations to transifex", I assume it is for uploading the string to be translated. It will be good to understand the translation process before the PR is reviewed

@seancolsen seancolsen added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Aug 28, 2023
@rajatvijay rajatvijay added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Sep 19, 2023
@rajatvijay
Copy link
Contributor Author

@seancolsen @silentninja Added the translations required for review.

@seancolsen seancolsen assigned pavish and unassigned seancolsen Sep 26, 2023
@seancolsen
Copy link
Contributor

@pavish said he would take this off my plate today, so I'm re-assigning it.

@seancolsen seancolsen modified the milestones: v0.1.4, Next release Oct 2, 2023
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

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

@rajatvijay This PR is stacked on top of #3104, which is again stacked on another PR #3103 which has a number of conflicts. Please address them so that the reviewers can test this PR.

Also, I think it would be better to have the following before reviewing the PR:

  1. Most of the code in this PR is NodeJS and not frontend code. I'd like them to be present in an entirely separate directory instead of the the frontend source code (i.e. outside of /src).
  2. Add the dependencies (gettext) to the docker image (or atleast add commands to the dev docker compose setup), instead of having to do it manually.
  3. Provide the dev documentation for the entire process, as both @seancolsen and @silentninja have pointed out. Just noticed that it's provided.

I'm marking this PR as a draft until all these are addressed.

@pavish pavish assigned rajatvijay and unassigned silentninja and pavish Oct 16, 2023
@pavish pavish added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Oct 16, 2023
@pavish pavish marked this pull request as draft October 16, 2023 13:43
Base automatically changed from i18n-select-lang-anon-user to develop October 25, 2023 17:49
@seancolsen seancolsen assigned pavish and unassigned rajatvijay Nov 1, 2023
@seancolsen
Copy link
Contributor

Assigning to @pavish to finish the remaining work here

@pavish
Copy link
Member

pavish commented Nov 23, 2023

Closing this PR as this is superseded by #3321

@pavish pavish closed this Nov 23, 2023
@pavish pavish deleted the i18n-export-import-translations branch November 23, 2023 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: revision A PR awaiting follow-up work from its author after review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants