From fba424623fdfa98d6fc1c573a06f4278a7b9ed60 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 15 Dec 2020 13:23:54 +0100 Subject: [PATCH] WIP: refactor(i18n): translation key renaming closes https://github.com/CaiJimmy/hugo-theme-stack/issues/63 --- i18n/en.toml | 41 ------------------ i18n/en.yaml | 42 +++++++++++++++++++ layouts/404.html | 4 +- layouts/_default/archives.html | 2 +- layouts/page/search.html | 6 +-- .../partials/article/components/footer.html | 2 +- .../article/components/related-contents.html | 2 +- layouts/partials/footer/footer.html | 4 +- layouts/partials/widget/archives.html | 4 +- layouts/partials/widget/search.html | 4 +- layouts/partials/widget/tag-cloud.html | 2 +- 11 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 i18n/en.toml create mode 100644 i18n/en.yaml diff --git a/i18n/en.toml b/i18n/en.toml deleted file mode 100644 index 1261a18..0000000 --- a/i18n/en.toml +++ /dev/null @@ -1,41 +0,0 @@ -[toggleMenu] - other = "Toggle Menu" - -[relatedContents] - other = "Related contents" - -[lastUpdatedOn] - other ="Last updated on" - -[widgetArchivesTitle] - other = "Archives" - -[widgetArchivesMore] - other = "More" - -[widgetTagCloudTitle] - other = "Tags" - -[categoriesTitle] - other = "Categories" - -[notFoundTitle] - other = "Not Found" - -[notFoundSubtitle] - other = "This page does not exist." - -[searchTitle] - other = "Search" - -[searchPlaceholder] - other = "Type something..." - -[searchResultTitle] - other = "#PAGES_COUNT pages (#TIME_SECONDS seconds)" - -[footerBuiltWith] - other = "Built with {{ .Generator }}" - -[footerDesignedBy] - other = "Theme {{ .Theme }} designed by {{ .DesignedBy }}" diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..eba242c --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,42 @@ +toggleMenu: + other: Toggle Menu + +archives: + categories: + other: Categories + +article: + relatedContents: + other: Related contents + lastUpdatedOn: + other: Last updated on + +notFound: + title: + other: Not Found + subtitle: + other: This page does not exist. + +widget: + archives: + title: + other: Archives + more: + other: More + tagCloud: + title: + other: Tags + +search: + title: + other: Search + placeholder: + other: Type something... + resultTitle: + other: "#PAGES_COUNT pages (#TIME_SECONDS seconds)" + +footer: + builtWith: + other: "Built with {{ .Generator }}" + designedBy: + other: "Theme {{ .Theme }} designed by {{ .DesignedBy }}" diff --git a/layouts/404.html b/layouts/404.html index dd5e49d..b89d2b6 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,7 +1,7 @@ {{ define "main" }}
-

{{ T "notFoundTitle" }}

-

{{ T "notFoundSubtitle" }}

+

{{ T "notFound.title" }}

+

{{ T "notFound.subtitle" }}

{{ partialCached "footer/footer" . }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 0071565..1a681e9 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -2,7 +2,7 @@ {{ define "main" }} {{ $categories := ($.Site.GetPage "taxonomyTerm" "categories").Pages }} {{ if $categories }} -

{{ T "categoriesTitle" }}

+

{{ T "archives.categories" }}

{{ range $categories }} diff --git a/layouts/page/search.html b/layouts/page/search.html index 6078ac1..259d398 100644 --- a/layouts/page/search.html +++ b/layouts/page/search.html @@ -7,8 +7,8 @@ {{ define "main" }}

- - + +