I am using module.mounts to fill in missing pages in a given language from existing pages in the base language.
Is there a .Page flag that can tell me if a “fill-in” has occurred?
.Page.IsTranslated and .Page.Translations don’t help, as they assume that the pages I have filled in have been translated: they have not. They are listed in the current language, but the content has been pulled from the base.
.Page.Language simply returns the filled-in language.
Right now, I am forced to add a front-matter parameter (translated: true) to every translated page. Could we set a value in that module loop, maybe .Page.ContentLanguage, so that we know the source of the back fill? That might require a new param in the module map, as right now we are simply connecting source and target folders.
Second best is a boolean, .Page.IsFilledIn or (perhaps confusingly) .Page.IsNotTranslated. Either one will allow me to programmatically alter pages to show/hide text, and offer instructions/options to the reader.
Maybe there is a clever workaround to this already. I tried page orig/curr languages, but by the time I get there, they are already derived.
Thanks, I’ll check that out. Platforms are works-in-progress, and what is clumsy today is smooth tomorrow.
The app I am working on is a global community clearinghouse, whose content is mostly elaborated in US/UK English. Based on local and cultural priorities, non-English-speaking affiliates of this organization will translate pages for their in-country use. Until they do, however, all of the curated base-language content should be available. I’ll share my repo some day when the kids are not hammering at the door (as they are now) (it is bedtime, really it is). Meanwhile, the test server page I just hacked into shape is here: parent “singing” page, sidebar “songs” collected and sorted, which can be toggled in context, or opened using the “single” template using the link icon next to the song.
Every time an English-language page is offered for a non-English translation (using the fill-in module method), I need to know it. Knowing has not been translated, but filled in, I add an i18n-resourced message inviting the reader to click to “request translation” into their local language.
In a number of situations, subfolder pages are presented in list format in their “parent” page. This list sorts by sorting index then by alpha, but I needed to have that “translated” flag so that I always sort the local language first.
All in all, if I have a loop somewhere that is injecting these pages into other language folders in public or docs, it seems natural for me to stamp the injected page as “having been injected”. There’s got to be an inner loop in there somewhere. It would make life so much easier.
Good, thank you. In our case, I think that all of the structures where this is used will be file-backed. Nonetheless, I’ll modify the script to be emptiness-proof, so that 5 years (or 5 months) from now, we’re not unpleasantly surprised.