blob: 2cdf911ac73b68fce754581b5fa809d763b782cf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
---
title: IsTranslated
description: Reports whether the given page has one or more translations.
categories: []
keywords: []
params:
functions_and_methods:
returnType: bool
signatures: [PAGE.IsTranslated]
---
With this site configuration:
{{< code-toggle file=hugo >}}
defaultContentLanguage = 'en'
[languages.en]
contentDir = 'content/en'
languageCode = 'en-US'
languageName = 'English'
weight = 1
[languages.de]
contentDir = 'content/de'
languageCode = 'de-DE'
languageName = 'Deutsch'
weight = 2
{{< /code-toggle >}}
And this content:
```text
content/
├── de/
│ ├── books/
│ │ └── book-1.md
│ └── _index.md
├── en/
│ ├── books/
│ │ ├── book-1.md
│ │ └── book-2.md
│ └── _index.md
└── _index.md
```
When rendering `content/en/books/book-1.md`:
```go-html-template
{{ .IsTranslated }} → true
```
When rendering `content/en/books/book-2.md`:
```go-html-template
{{ .IsTranslated }} → false
```
|