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. |
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.