Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalXCStrings ¶
MarshalXCStrings marshals xcstrings to pretty JSON.
func SaveXCStrings ¶
SaveXCStrings saves an xcstrings file to disk
Types ¶
type Localization ¶
type Localization struct {
StringUnit StringUnit `json:"stringUnit"`
}
Localization represents a localization for a specific language
type StringEntry ¶
type StringEntry struct {
Localizations map[string]Localization `json:"localizations,omitempty"`
ShouldTranslate *bool `json:"shouldTranslate,omitempty"`
}
StringEntry represents a single string entry with its localizations
type StringUnit ¶
StringUnit contains the translation state and value
type TranslationProvider ¶
type TranslationProvider interface {
Translate(ctx context.Context, req TranslationRequest) (TranslationResponse, error)
}
TranslationProvider defines the interface for translation providers
type TranslationRequest ¶
type TranslationRequest struct {
Key string
Text string
SourceLanguage string
TargetLanguage string
}
TranslationRequest represents a request to translate a string
type TranslationResponse ¶
type TranslationResponse struct {
Key string
TargetLanguage string
TranslatedText string
Error error
}
TranslationResponse represents a response from a translation provider
type XCStrings ¶
type XCStrings struct {
SourceLanguage string `json:"sourceLanguage"`
Strings map[string]StringEntry `json:"strings"`
Version string `json:"version"`
}
XCStrings represents the structure of a Localizable.xcstrings file
func LoadXCStrings ¶
LoadXCStrings loads an xcstrings file from disk
func ParseXCStrings ¶
ParseXCStrings parses xcstrings content from bytes.
Click to show internal directories.
Click to hide internal directories.