Add an option to change primary language for a deployment #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, Primo uses English as the primary language (#120). When you have different locales, the root ('/') serves the texts and images for English, and other locales, say German, are served via
/de
. This can be annoying when you build a site for primarily non-English speakers where you need to use the root for an other language, which forces using another locale to host English version. Visitors for the site will see English in/de
or the like.This PR adds a select box in the "Deploy modal" to choose which language to use as the primary language in the deployment.
It builds the site bundle in which the files in root have the content in the primary language chosen with sub directories any other languages.
For simplicity, it just asks the primary language every time you are to deploy. It could be useful if you can choose and persist the primary language as part of metadata, as suggested in #120. It will also enable to follow the setting in the language selector in the editing screen. This will involve a DB migration (adding non-nullable
default_locale
which defaults to'en'
tosites
table), let me know if you find this a good idea to include in this PR.