Make active locales optionally repo-dependent#4257
Conversation
Should we instead follow the UX of the "Data source" section and use a dropdown (Manual configuration, Read from repository, Read from configuration file)? Also, checkbox help text looks a little out of place. Is help text even needed for relatively long labels? Or should we just use tooltips or links to the docs? If we stick to the checkboxes, we could take a step closer to the UI unity and use the checkbox style and help text from the settings page. In any case, this change also requires docs updates.
I had to read the label and the description three times each to understand what this is supposed to do. 😉
Why is that? We also require an explicit sync in other cases, e.g. after you first create a project. Regardless, the button should not break into two lines.
I don't think so. We should add an environment variable. |
Probably not, because the toggle we're actually setting is the same, and it's choosing between manual and repo config. It's just that without a config file, we look for the presence of locale directories, while with a config file we look for their definition in its top-level So the choice at this level is binary.
Sure; I just followed the full-width style that the page already uses. I propose that refreshing the project admin page layout and styles ought to be a separate action.
Yes; I held off on that because I figured we'd have this conversation, and the UI might change as a result. 😇
I welcome suggestions for alternate verbiage.
So you're suggesting we don't force a sync even when we know that the user's choices effectively require one to be effective?
Fixed now by making it wider, so that it also matches the Pretranslate directly above it. |
|
We discussed this issue in more detail and decided to leave any changes to the Project Admin for later (namely #2204). I suggest we change the checkbox labels and drop the additional help text:
BTW, is the 3rd option needed to fix #3677? What's the behaviour, if this checkbox is not selected?
That's the current behaviour. E.g. if you add a project or locale. |
I would avoid using "configuration", because it gets confusing fast with configuration file. I'm also not sure I fully understand the 3rd option.
I wonder if the 3rd should be a radio button instead, e.g. something along the line of Localizable resources for each locale: |
|
Also, are we OK without support for read-only locales when locales are read from the repo? |
I think so? We currently use them for one project. If you need read-only, you need to use manual configuration. |
That's described in #3677 (comment). Also see the explanation for why it's a good idea at the end of #3677 (comment). |
Thanks. Why is the resource toggle only available if the first toggle is set to Yes, i.e. if locales are read from repository? |
If locales were controlled from Pontoon but translated resources from the repo, then in order to add a locale you'd need to:
And I can't think of a situation where you would actually want to do that. |
This is what we've been doing for some projects, though: Are you suggesting that we instead require reading locales for such projects from the repository? |
Yes; for that project I think it'd be appropriate to have the locales and translated resources set only by the repository contents, rather than needing to also set them in Pontoon. |
|
That sounds good. Then for the 3rd checkbox, I agree with @flodolo we should use a radio button to make it more explicit. Another attempt at improving the wording:
|
|
Applied the changes discussed above; PTAL? |
Looks good. Is the "Read list of locales from the configuration file" option now implicit? |
I don't understand the question. The checkbox label for |
|
Ah, thanks for clarifying. |
|
We need to get into the habit of updating docs in the same PR as the code changes. |
|
Good point. The underlying issue is a bug, which (rightfully) didn't have the needs documentation label assigned. It's just that the fix for it turned out to be a feature. Adding a label here. |
Co-authored-by: Francesco Lodolo <flodolo@mozilla.com>
Co-authored-by: Francesco Lodolo <flod@lodolo.net>
|
Note on deployment:
|
Fixes #3677
Adds a new control to the top of the

/admin/projects/:slug/page, by default unselected:If the project uses a config file, the text is slightly different:

And if it's selected and no config file is used, a second checkbox is presented:

Note also how the list of locales is not shown when they're controlled by the repo contents or a config file. The new checkboxes are not shown if the project data source is the database, and not a repository.
Also, when the first checkbox is changed from "off" to "on" or when the config file value changes, the save button is now slightly different:

@mathjazz Is there a way to detect when we're in prod or not? It would probably be good for the sync to use
commit=Falsein dev environments.The sync behaviour is correspondingly updated so that the ProjectLocale entities are updated if necessary, and the file-existence checks and file-removal changes are only applied if a config file is not used, and both checkboxes are ticked.