Browse Source

Add l10n package

This includes basic US English terms and a function to get any
translation set.
master
Matt Baer 6 years ago
parent
commit
18dcf10012
2 changed files with 41 additions and 0 deletions
  1. +33
    -0
      l10n/phrases.go
  2. +8
    -0
      l10n/strings.go

+ 33
- 0
l10n/phrases.go View File

@@ -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",
}

+ 8
- 0
l10n/strings.go View File

@@ -0,0 +1,8 @@
package l10n

func Strings(lang string) map[string]string {
switch lang {
default:
return phrases
}
}

Loading…
Cancel
Save