.TranslationKey vs .File.BaseFileName

Continuing the discussion from Easiest way to embed code from source files:


I was curious about how .TranslationKey would be different then .File.BaseFileName for a page.

The docs just say:

the key used to map language translations of the current page. See Multilingual Mode for more information.

But then when I looked here:

I realized that if a content page file has no language suffix, like foo.md, both path.Base .TranslationKey and .File.BaseFileName will be identical => foo.

But if the content file were named foo.en.md, .File.BaseFileName would be (I think) foo.en, but path.Base .TranslationKey would still be foo.

Just creating this small post if my future self searched something related :slight_smile: .

1 Like