From 18dcf10012aafce004be2dce6e08be896044d164 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 5 Feb 2018 00:54:19 -0500 Subject: [PATCH] Add l10n package This includes basic US English terms and a function to get any translation set. --- l10n/phrases.go | 33 +++++++++++++++++++++++++++++++++ l10n/strings.go | 8 ++++++++ 2 files changed, 41 insertions(+) create mode 100644 l10n/phrases.go create mode 100644 l10n/strings.go diff --git a/l10n/phrases.go b/l10n/phrases.go new file mode 100644 index 0000000..5a52bd6 --- /dev/null +++ b/l10n/phrases.go @@ -0,0 +1,33 @@ +package l10n + +// Term constants +const ( + DefReadMore = "Read more..." + DefPublishedWith = "published with write.as" + DefOlder = "Older" + DefNewer = "Newer" +) + +// Default phrases +var phrases = map[string]string{ + "Anonymous post": "Anonymous post", + "Blogs": "Blogs", + "Newer": "Newer", + "Older": "Older", + "Posts": "Posts", + "Publish to...": "Publish to...", + "Publish": "Publish", + "Read more...": "Read more...", + "Toggle theme": "Toggle theme", + "View posts": "View Posts", + "delete": "delete", + "edit": "edit", + "move to...": "move to...", + "pin": "pin", + "published with write.as": "published with write.as", + "share modal ending": "Send it to a friend, share it across the web, or maybe tweet it. Learn more.", + "share modal introduction": "Each published post has a secret, unique URL you can share with anyone. This is that URL:", + "share modal title": "Share this post", + "share": "share", + "unpin": "unpin", +} diff --git a/l10n/strings.go b/l10n/strings.go new file mode 100644 index 0000000..7cbb528 --- /dev/null +++ b/l10n/strings.go @@ -0,0 +1,8 @@ +package l10n + +func Strings(lang string) map[string]string { + switch lang { + default: + return phrases + } +}