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 support for translations by default in cookiecutter-django-app #401

Open
BryanttV opened this issue Oct 23, 2023 · 8 comments
Open

Add support for translations by default in cookiecutter-django-app #401

BryanttV opened this issue Oct 23, 2023 · 8 comments
Assignees

Comments

@BryanttV
Copy link

BryanttV commented Oct 23, 2023

Description

If you add translations in the conf/locale folder they are not rendered on the platform.

To make it work by default on the platform, the following changes can be made. These changes were successfully tested in this plugin

  1. Move all files from conf/locale to locale.

  2. Update MANIFEST.in file to include the new locale folder at the time of package installation.

    recursive-include {{cookiecutter.sub_dir_name}}/locale *
    

These changes will allow translations included in the locale folder to be automatically recognized by the platform. In addition, the make extract_translations and make compile_translations commands should not be modified, as they work with these changes.

@BryanttV BryanttV changed the title Translations are not loaded in cookiecutter-django-app Add support for translations by default in cookiecutter-django-app Oct 24, 2023
@timmc-edx timmc-edx moved this to Prioritized in Arch-BOM Oct 25, 2023
@timmc-edx timmc-edx removed the status in Arch-BOM Oct 25, 2023
@jmbowman jmbowman moved this to Prioritized in Arch-BOM Oct 26, 2023
@timmc-edx
Copy link
Contributor

It looks like most of our repos use conf/locale. A few have just locale -- but for about half of those it's just a symlink to conf/locale. I'm not sure how to test this, but does it work to just have a recursive-include of conf/locale?

@timmc-edx timmc-edx moved this from Prioritized to Blocked in Arch-BOM Oct 27, 2023
@ghassanmas ghassanmas moved this from Todo to Agenda in Translations Working Group Feb 16, 2024
@ehuthmacher ehuthmacher moved this from Agenda to In Progress in Translations Working Group Feb 16, 2024
@ehuthmacher
Copy link

Diana Huang
10:07 AM

hi folks. this was a ticket that came in to Arch-BOM and i don't think we're going to get to it: #401 i'm not sure if someone on this team/WG can take a look and make a call on how it should be handled?

#401 Add support for translations by default in cookiecutter-django-app
Description
If you add translations in the conf/locale folder they are not rendered on the platform.
To make it work by default on the platform, the following changes can be made. These changes were successfully tested in this plugin

  1. Move all files from conf/locale to locale.

  2. Update MANIFEST.in file to include the new locale folder at the time of package installation.

    recursive-include {{cookiecutter.sub_dir_name}}/locale *

These changes will allow translations included in the locale folder to be automatically recognized by the platform. In addition, the make extract_translations and make compile_translations commands should not be modified, as they work with these changes.
Comments
1
https://github.com/[openedx/edx-cookiecutters](https://github.com/openedx/edx-cookiecutters)|openedx/edx-cookiecuttersopenedx/edx-cookiecutters | Oct 23rd, 2023 | Added by GitHub

@ehuthmacher
Copy link

from my side, I am not sure as well, but in any case according to latest changes of translations process OEP58, were are translations are saved openedx-translatiosn repo,
https://github.com/openedx/openedx-translations/tree/main/translations it seems the pattern for all python based repo is conf/locale.

@ehuthmacher
Copy link

@OmarIthawi @shadinaif please provide feedback.

@OmarIthawi
Copy link
Member

@shadinaif could you please look into this request. I'd like to see if any of the recent work we've done have changed translations support in this repository.

@ehuthmacher ehuthmacher moved this from In Progress to Done in Translations Working Group Jul 15, 2024
@kdmccormick
Copy link
Member

@OmarIthawi @brian-smith-tcril Was this repository updated as part of OEP-58? I might be misunderstanding, but in the django app template Makefile I see calls to tx, which I thought was supposed to replaced with calls to atlas?

@shadinaif
Copy link
Contributor

Thank you for reporting this @kdmccormick ! We've done some work in this repo, it's hard to immediately answer if we missed a mandatory change or if it's just a stale code. I'll double-check early next week and let you know. Thank you!

cc/ @OmarIthawi @brian-smith-tcril

@shadinaif
Copy link
Contributor

update: this repo is a bit special. Because it's a template for new plugins that are used inside and outside edx.org. Not everyone wants to use atlas for translation. I'll work on this to make the creation process ask if atlas support is needed or not

Please keep the issue open, I'll link it to the fix PR

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

No branches or pull requests

6 participants