Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

feat: add PREPEND_LOCALE_PATHS configuration setting - #6677

Merged
nadeemshahzad merged 1 commit into
openedx-unsupported:masterfrom
open-craft:keith/se_5299_prepend_local_paths
Feb 7, 2022
Merged

feat: add PREPEND_LOCALE_PATHS configuration setting#6677
nadeemshahzad merged 1 commit into
openedx-unsupported:masterfrom
open-craft:keith/se_5299_prepend_local_paths

Conversation

@keithgg

@keithgg keithgg commented Feb 1, 2022

Copy link
Copy Markdown
Contributor

edx-platform currently supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which appends paths to the end of LOCALE_PATHS, but there's currently no way to add additional paths to the start of the list to override the default translations.

In this PR, we added the PREPEND_LOCALE_PATHS configuration setting to achieve this.

Configuration Pull Request

Make sure that the following steps are done before merging:

  • A SRE team member has approved the PR if it is code shared across multiple services and you don't own all of the services.
  • Are you adding any new default values that need to be overridden when this change goes live? If so:
    • Update the appropriate internal repo (be sure to update for all our environments)
    • If you are updating a secure value rather than an internal one, file a SRE ticket with details.
    • Add an entry to the CHANGELOG.
  • If you are making a complicated change, have you performed the proper testing specified on the Ops Ansible Testing Checklist? Adding a new variable does not require the full list (although testing on a sandbox is a great idea to ensure it links with your downstream code changes).
  • Think about how this change will affect Open edX operators. Have you updated the wiki page for the next Open edX release?

edx-platform supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which
appends paths to the end of LOCALE_PATHS,  but there's currently no
way to add additional paths to the start of the list.

We want to be able to prepend locale paths so that we can override
existing translations in edx-platform.
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @keithgg! I've created OSPR-6426 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@natabene

natabene commented Feb 4, 2022

Copy link
Copy Markdown
Contributor

@keithgg Thank you for your contribution, I will line this up for our review.

@nadeemshahzad
nadeemshahzad merged commit e397261 into openedx-unsupported:master Feb 7, 2022
@openedx-webhooks

Copy link
Copy Markdown

@keithgg 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@0x29a
0x29a deleted the keith/se_5299_prepend_local_paths branch May 3, 2022 14:19
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 4, 2022
…5299_prepend_local_paths

feat: add PREPEND_LOCALE_PATHS configuration setting
(cherry picked from commit e397261)
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 28, 2022
…5299_prepend_local_paths

feat: add PREPEND_LOCALE_PATHS configuration setting
(cherry picked from commit e397261)
0x29a pushed a commit to open-craft/configuration that referenced this pull request May 30, 2022
…5299_prepend_local_paths

feat: add PREPEND_LOCALE_PATHS configuration setting
(cherry picked from commit e397261)
github-actions Bot added a commit to openedx/openedx-platform that referenced this pull request Jul 3, 2022
…o Maple

#Description

Backports the changes made in #29851 to `maple.master`.

> edx-platform currently supports COMPREHENSIVE_THEME_LOCALE_PATHS setting, which appends paths to the end of LOCALE_PATHS, but there's currently no way to add additional paths to the start of the list to override the default translations.
> 
> In this PR, we added the PREPEND_LOCALE_PATHS setting to achieve this.
>
> - Affects the Operator

## Supporting information

- PR for the `configuration` repo. openedx-unsupported/configuration#6677
- [SE-5299](https://tasks.opencraft.com/browse/SE-5299)

## Testing instructions

On the docker devstack:
- `make dev.shell.lms`
- Edit the file `/edx/etc/lms.yml`. Add a `PREPEND_LOCALE_PATHS` setting like
```yaml
PREPEND_LOCALE_PATHS: [/edx/src/]
```
- Copy a translation file into that folder.
```bash
cp -r /edx/app/edxapp/edx-platform/conf/locale/fr/ /edx/src/es
```
Note that this is copying French to Spanish folder. It makes seeing the differences easier.
- In your browser load the LMS, and change the `openedx-language-cookie`'s value to `es`.
- Restart your lms dev server.
- If done correctly you should get the french translations loaded (it sometimes takes 5 minutes to load).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants