Open tnzk opened 11 months ago
Thank you for this! Definitely would love to implement this functionality ASAP for international users.
One thing I noticed though is that it looks like English and Japanese are static values in the Deployment modal? Is this still a work in progress?
Will review more tomorrow, thanks again!
Thank you for reviewing! I forgot they were yet to be fixed, now I updated it to show languages used in the site as the options.
I also added primary_language
as a store, so that users don't have to choose the language every time he/she deploys.
Other than the merge conflicts what else needs to be done to get this merged in? I would like this feature and I have some time to help with it.
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.