document-internationalization
document-internationalization copied to clipboard
Delete base translation
I'm not sure this is the right place to post this, so please redirect me elsewhere if appropriate :)
When I create an article in French (base) and English (translation), then later decide that EN isn't useful and I only want FR, I can delete the translation while keeping the base thanks to referenceBehavior: 'weak'
.
But I can't do the opposite. If I want to get rid of FR (base), then EN (translation) is also removed. So I have no other choice than to keep an empty FR article that I will never publish.
Is there a way around this?
Thanks!
I'm in a similar situation and I'd like a solution too.
My default
language is en
and I have some posts with a fr
translation. This works great where there is always an english base document, but I now would also like to add an article where the language is fr
and there is no en
version. Essentially I want the ability to change the base language on an article.
I ended up adding an "Exclude base translation" checkbox in our internationalisation schema transformer for documents. Then at build time I just ignore anything that has that checkbox checked when building the base language.
I ended up creating a language
selection field (containing only the supported languages) and a translations
array field (which is a list of language
+ reference
pairs, where the language must be unique).
Now there's no more master-slave relationship. All articles can, but don't have to, be manually linked to one or more articles in other languages. It's a bit more manual work, but it's so much easier to handle.
At the moment this is not possible due to the fact that every document requires a base language. I believe there is some work being done on removing this limitation.