Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertFromPlaceholders(translation string, placeholders []*lang.Placeholder) (modified string)
- func ConvertToPlaceholders(translation string, placeholders []*lang.Placeholder) (modified string)
- type CFeature
- func (f *CFeature) DeleteDraftLocales(mountPoints feature.MountPoints)
- func (f *CFeature) EditorMenu(r *http.Request) (m menu.Menu)
- func (f *CFeature) FindFS(fsid string) (found feature.FileSystemFeature)
- func (f *CFeature) FindMountPoints(fsid, code string) (mountPoints feature.MountPoints)
- func (f *CFeature) FindMountedPoints(fsid string) (mp feature.MountedPoints)
- func (f *CFeature) HasDraftLocales(fsid, code string) (present bool)
- func (f *CFeature) Init(this interface{})
- func (f *CFeature) IsLocaleLocked(fsid, code string) (locked bool, eid string, err error)
- func (f *CFeature) ListLocaleFileSystemLocales(r *http.Request, fsid string) (list feature.EditorFiles)
- func (f *CFeature) ListLocaleFileSystems(r *http.Request) (list feature.EditorFiles)
- func (f *CFeature) ListLocales(r *http.Request) (list feature.EditorFiles)
- func (f *CFeature) LockLocale(eid, fsid, code string) (err error)
- func (f *CFeature) Make() (feat Feature)
- func (f *CFeature) MakeTable(ld *LocaleData) (table []Row, err error)
- func (f *CFeature) OpCancelHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpCancelValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpChangeHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpChangeValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpCommitHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpCommitValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpDeleteHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpDeleteValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpPublishHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpPublishValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpRetakeHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpRetakeValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpSearchHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpSearchValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) OpUnlockHandler(r *http.Request, pg feature.Page, ctx context.Context, form context.Context, ...) (redirect string)
- func (f *CFeature) OpUnlockValidate(r *http.Request, pg feature.Page, ctx, form context.Context, ...) (err error)
- func (f *CFeature) PrepareRenderFileEditor(w http.ResponseWriter, r *http.Request) (pg feature.Page, ctx context.Context, info *feature.EditorFile, eid string, ...)
- func (f *CFeature) ReadDraftLocales(fsid, code string, mountPoints feature.MountPoints, withOut bool) (ld *LocaleData, err error)
- func (f *CFeature) ReceiveFileEditorChanges(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) RenderFileBrowser(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) RenderFileEditor(w http.ResponseWriter, r *http.Request)
- func (f *CFeature) SetupEditor(es feature.EditorSite)
- func (f *CFeature) SetupEditorRoute(r chi.Router)
- func (f *CFeature) SiteFeatureMenu(r *http.Request) (m menu.Menu)
- func (f *CFeature) Startup(ctx *cli.Context) (err error)
- func (f *CFeature) UnlockLocales(fsid, code string) (err error)
- func (f *CFeature) UpdateFileInfo(info *feature.EditorFile, r *http.Request)
- func (f *CFeature) UpdatePathInfo(info *feature.EditorFile, r *http.Request)
- func (f *CFeature) WriteDraftLocales(ld *LocaleData, mountPoints feature.MountPoints) (err error)
- func (f *CFeature) WriteLocales(ld *LocaleData, mountPoints feature.MountPoints) (err error)
- type Cell
- type Feature
- type LocaleData
- func (l *LocaleData) AddMissingTranslations(defTag language.Tag, locales []language.Tag)
- func (l *LocaleData) ConvertAllPlaceholders()
- func (l *LocaleData) MakeGoTextData() (lookup map[language.Tag]*lang.GoText)
- func (l *LocaleData) SetPluralTranslation(tag language.Tag, shasum, arg string, cases ...string) (err error)
- func (l *LocaleData) SetStringTranslation(tag language.Tag, shasum, translation string) (err error)
- type LocaleMessage
- type LocaleTranslation
- type MakeFeature
- type Row
- type Select
- type Table
Constants ¶
View Source
const Tag feature.Tag = "fs-editor-locales"
Variables ¶
View Source
var ( DefaultEditorType = "locale" DefaultEditorKey = "locales" )
Functions ¶
func ConvertFromPlaceholders ¶ added in v0.5.1
func ConvertFromPlaceholders(translation string, placeholders []*lang.Placeholder) (modified string)
func ConvertToPlaceholders ¶ added in v0.5.1
func ConvertToPlaceholders(translation string, placeholders []*lang.Placeholder) (modified string)
Types ¶
type CFeature ¶
type CFeature struct { fs_editor.CEditorFeature[MakeFeature] ViewLocaleAction feature.Action }
func (*CFeature) DeleteDraftLocales ¶
func (f *CFeature) DeleteDraftLocales(mountPoints feature.MountPoints)
func (*CFeature) FindMountPoints ¶
func (f *CFeature) FindMountPoints(fsid, code string) (mountPoints feature.MountPoints)
func (*CFeature) FindMountedPoints ¶
func (f *CFeature) FindMountedPoints(fsid string) (mp feature.MountedPoints)
func (*CFeature) HasDraftLocales ¶
func (*CFeature) IsLocaleLocked ¶
func (*CFeature) ListLocaleFileSystemLocales ¶
func (*CFeature) ListLocaleFileSystems ¶
func (f *CFeature) ListLocaleFileSystems(r *http.Request) (list feature.EditorFiles)
func (*CFeature) ListLocales ¶
func (f *CFeature) ListLocales(r *http.Request) (list feature.EditorFiles)
func (*CFeature) LockLocale ¶
func (*CFeature) OpCancelHandler ¶
func (*CFeature) OpCancelValidate ¶
func (*CFeature) OpChangeHandler ¶
func (*CFeature) OpChangeValidate ¶
func (*CFeature) OpCommitHandler ¶
func (*CFeature) OpCommitValidate ¶
func (*CFeature) OpDeleteHandler ¶
func (*CFeature) OpDeleteValidate ¶
func (*CFeature) OpPublishHandler ¶
func (*CFeature) OpPublishValidate ¶
func (*CFeature) OpRetakeHandler ¶
func (*CFeature) OpRetakeValidate ¶
func (*CFeature) OpSearchHandler ¶
func (*CFeature) OpSearchValidate ¶
func (*CFeature) OpUnlockHandler ¶
func (*CFeature) OpUnlockValidate ¶
func (*CFeature) PrepareRenderFileEditor ¶
func (f *CFeature) PrepareRenderFileEditor(w http.ResponseWriter, r *http.Request) (pg feature.Page, ctx context.Context, info *feature.EditorFile, eid string, mountPoints feature.MountPoints, handled bool)
func (*CFeature) ReadDraftLocales ¶
func (f *CFeature) ReadDraftLocales(fsid, code string, mountPoints feature.MountPoints, withOut bool) (ld *LocaleData, err error)
func (*CFeature) ReceiveFileEditorChanges ¶
func (f *CFeature) ReceiveFileEditorChanges(w http.ResponseWriter, r *http.Request)
func (*CFeature) RenderFileBrowser ¶
func (f *CFeature) RenderFileBrowser(w http.ResponseWriter, r *http.Request)
func (*CFeature) RenderFileEditor ¶
func (f *CFeature) RenderFileEditor(w http.ResponseWriter, r *http.Request)
func (*CFeature) SetupEditor ¶
func (f *CFeature) SetupEditor(es feature.EditorSite)
func (*CFeature) SetupEditorRoute ¶
func (f *CFeature) SetupEditorRoute(r chi.Router)
func (*CFeature) SiteFeatureMenu ¶
func (*CFeature) UnlockLocales ¶
func (*CFeature) UpdateFileInfo ¶
func (f *CFeature) UpdateFileInfo(info *feature.EditorFile, r *http.Request)
func (*CFeature) UpdatePathInfo ¶
func (f *CFeature) UpdatePathInfo(info *feature.EditorFile, r *http.Request)
func (*CFeature) WriteDraftLocales ¶
func (f *CFeature) WriteDraftLocales(ld *LocaleData, mountPoints feature.MountPoints) (err error)
func (*CFeature) WriteLocales ¶
func (f *CFeature) WriteLocales(ld *LocaleData, mountPoints feature.MountPoints) (err error)
type Cell ¶
type Cell struct { Locale language.Tag Src *LocaleMessage Msg *LocaleMessage }
type Feature ¶
type Feature interface { feature.EditorFeature }
type LocaleData ¶
type LocaleData struct { FSID string `json:"fsid"` Code string `json:"code"` Data map[string]map[language.Tag]*LocaleMessage `json:"data"` Order []string `json:"order"` }
func (*LocaleData) AddMissingTranslations ¶
func (l *LocaleData) AddMissingTranslations(defTag language.Tag, locales []language.Tag)
func (*LocaleData) ConvertAllPlaceholders ¶ added in v0.5.1
func (l *LocaleData) ConvertAllPlaceholders()
func (*LocaleData) MakeGoTextData ¶
func (l *LocaleData) MakeGoTextData() (lookup map[language.Tag]*lang.GoText)
func (*LocaleData) SetPluralTranslation ¶
func (*LocaleData) SetStringTranslation ¶
func (l *LocaleData) SetStringTranslation(tag language.Tag, shasum, translation string) (err error)
type LocaleMessage ¶
type LocaleMessage struct { ID string `json:"id"` Key string `json:"key"` Message string `json:"message"` Translation *LocaleTranslation `json:"translation"` TranslatorComment string `json:"translatorComment,omitempty"` Placeholders lang.Placeholders `json:"placeholders,omitempty"` Fuzzy bool `json:"fuzzy,omitempty"` Shasum string `json:"shasum"` }
func ParseNewMessage ¶
func ParseNewMessage(key, comment string) (m *LocaleMessage)
func (*LocaleMessage) Copy ¶
func (l *LocaleMessage) Copy() (cloned *LocaleMessage)
type LocaleTranslation ¶
type MakeFeature ¶
type MakeFeature interface { feature.EditorMakeFeature[MakeFeature] Make() Feature }
func New ¶
func New() MakeFeature
func NewTagged ¶
func NewTagged(tag feature.Tag) MakeFeature
Click to show internal directories.
Click to hide internal directories.