Skip to content

Commit

Permalink
fix(i18n): translate the meta.path.label
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jan 23, 2024
1 parent 27349b2 commit 96d1bbf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ other = "Link Title"
[cms_field_label_noindex]
other = "Noindex"

[cms_field_label_path]
other = "Path"

[cms_field_label_series]
other = "Series"

Expand Down
3 changes: 3 additions & 0 deletions i18n/zh-hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ other = "链接标题"
[cms_field_label_noindex]
other = "禁止索引"

[cms_field_label_path]
other = "路径"

[cms_field_label_series]
other = "专栏"

Expand Down
3 changes: 3 additions & 0 deletions i18n/zh-hant.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ other = "鏈接標題"
[cms_field_label_noindex]
other = "禁止索引"

[cms_field_label_path]
other = "路徑"

[cms_field_label_series]
other = "專欄"

Expand Down
8 changes: 8 additions & 0 deletions layouts/partials/decap-cms/functions/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
{{- range sort $unweightFields "name" -}}
{{- $fields = $fields | append . -}}
{{- end }}
{{- with $collection.Get "meta" }}
{{- $meta := . }}
{{- with index . "path" }}
{{- $pathLabel := partial "decap-cms/functions/translate-label" .label }}
{{- $meta = merge $meta (dict "path" (merge . (dict "label" $pathLabel))) }}
{{- $collection.Set "meta" $meta }}
{{- end }}
{{- end }}
{{- $collection.Set "fields" slice -}}
{{- range $fields }}
{{- $tmp := newScratch }}
Expand Down

0 comments on commit 96d1bbf

Please sign in to comment.