Skip to content

Commit

Permalink
Change constant definitions so godoc shows them near their types
Browse files Browse the repository at this point in the history
  • Loading branch information
Jille authored and bounoable committed Sep 17, 2024
1 parent a2b5adc commit 1b4054f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
6 changes: 3 additions & 3 deletions formality.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package deepl

const (
// DefaultFormal is the default formality.
DefaultFormal = Formal("default")
DefaultFormal Formal = "default"
// LessFormal means the text is written in a less formal / more informal language.
LessFormal = Formal("less")
LessFormal Formal = "less"
// MoreFormal means the text is written in a more formal language.
MoreFormal = Formal("more")
MoreFormal Formal = "more"
)

// Formal is a formality option.
Expand Down
56 changes: 28 additions & 28 deletions language.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@ package deepl

// Supported languages
const (
Bulgarian = Language("BG")
Chinese = Language("ZH")
Czech = Language("CS")
Danish = Language("DA")
Dutch = Language("NL")
EnglishAmerican = Language("EN-US")
EnglishBritish = Language("EN-GB")
Estonian = Language("ET")
Finnish = Language("FI")
French = Language("FR")
German = Language("DE")
Greek = Language("EL")
Hungarian = Language("HU")
Italian = Language("IT")
Japanese = Language("JA")
Latvian = Language("LV")
Lithuanian = Language("LT")
Polish = Language("PL")
PortugueseBrazil = Language("PT-BR")
PortuguesePortugal = Language("PT-PT")
Romanian = Language("RO")
Russian = Language("RU")
Slovak = Language("SK")
Slovenian = Language("SL")
Spanish = Language("ES")
Swedish = Language("SV")
Bulgarian Language = "BG"
Chinese Language = "ZH"
Czech Language = "CS"
Danish Language = "DA"
Dutch Language = "NL"
EnglishAmerican Language = "EN-US"
EnglishBritish Language = "EN-GB"
Estonian Language = "ET"
Finnish Language = "FI"
French Language = "FR"
German Language = "DE"
Greek Language = "EL"
Hungarian Language = "HU"
Italian Language = "IT"
Japanese Language = "JA"
Latvian Language = "LV"
Lithuanian Language = "LT"
Polish Language = "PL"
PortugueseBrazil Language = "PT-BR"
PortuguesePortugal Language = "PT-PT"
Romanian Language = "RO"
Russian Language = "RU"
Slovak Language = "SK"
Slovenian Language = "SL"
Spanish Language = "ES"
Swedish Language = "SV"
)

const (
// English (unspecified).
//
// Deprecated: use EnglishAmerican or EnglishBritish instead.
English = Language("EN")
English Language = "EN"

// Portuguese (unspecified).
//
// Deprecated: use PortugueseBrazil or PortuguesePortugal instead.
Portuguese = Language("PT")
Portuguese Language = "PT"
)

// Language is a deepl language code.
Expand Down
6 changes: 3 additions & 3 deletions split.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package deepl

const (
// SplitNone means no splitting at all, whole input is treated as one sentence.
SplitNone = SplitSentence("0")
SplitNone SplitSentence = "0"
// SplitDefault splits on interpunction and on newlines (default).
SplitDefault = SplitSentence("1")
SplitDefault SplitSentence = "1"
// SplitNoNewlines splits on interpunction only, ignoring newlines.
SplitNoNewlines = SplitSentence("nonewlines")
SplitNoNewlines SplitSentence = "nonewlines"
)

// SplitSentence is a split_sentences option.
Expand Down
6 changes: 3 additions & 3 deletions taghandling.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package deepl
const (
// DefaultTagHandling is the default tag handling strategy: the translation
// engine does not take tags into account.
DefaultTagHandling = TagHandlingStrategy("default")
DefaultTagHandling TagHandlingStrategy = "default"

// XMLTagHandling makes the API process XML input by extracting text out of
// the structure, splitting it into individual sentences, translating them,
// and placing them back into the XML structure.
XMLTagHandling = TagHandlingStrategy("xml")
XMLTagHandling TagHandlingStrategy = "xml"

// HTMLTagHandling makes the API process HTML input by extracting text out
// of the structure, splitting it into individual sentences, translating
// them, and placing them back into the HTML structure.
HTMLTagHandling = TagHandlingStrategy("html")
HTMLTagHandling TagHandlingStrategy = "html"
)

// TagHandlingStrategy is a `tag_handling` option.
Expand Down

0 comments on commit 1b4054f

Please sign in to comment.