copying language when reply

This commit is contained in:
localhost_frssoft 2023-11-10 02:34:00 +03:00
parent 6a233f6cb2
commit 14898fea07
3 changed files with 5 additions and 1 deletions

View file

@ -19,4 +19,5 @@ type ReplyContext struct {
ReplySpoiler string ReplySpoiler string
ReplyContent string ReplyContent string
ForceVisibility bool ForceVisibility bool
ReplyLanguage string
} }

View file

@ -362,6 +362,8 @@ func (s *service) ThreadPage(c *client, id string, reply bool) (err error) {
visibility = c.s.Settings.DefaultVisibility visibility = c.s.Settings.DefaultVisibility
} }
replyLanguage := status.Language
pctx = model.PostContext{ pctx = model.PostContext{
DefaultVisibility: visibility, DefaultVisibility: visibility,
DefaultFormat: c.s.Settings.DefaultFormat, DefaultFormat: c.s.Settings.DefaultFormat,
@ -372,6 +374,7 @@ func (s *service) ThreadPage(c *client, id string, reply bool) (err error) {
ReplySpoiler: spoilerText, ReplySpoiler: spoilerText,
ReplyContent: content, ReplyContent: content,
ForceVisibility: isDirect, ForceVisibility: isDirect,
ReplyLanguage: replyLanguage,
}, },
} }
} }

View file

@ -48,7 +48,7 @@
<button type="submit" accesskey="P" title="Post (P)"> Post </button> <button type="submit" accesskey="P" title="Post (P)"> Post </button>
<button type="reset" title="Reset"> Reset </button> <button type="reset" title="Reset"> Reset </button>
<input id="edit-status-id" name="edit-status-id" placeholder="Input Status ID for edit" title="Edit ID"> <input id="edit-status-id" name="edit-status-id" placeholder="Input Status ID for edit" title="Edit ID">
<input id="lang-code" name="lang-code" placeholder="lang" title="Post language (ISO 639) [en, ru, etc..] Default: none" size="4"> <input id="lang-code" name="lang-code" placeholder="lang" title="Post language (ISO 639) [en, ru, etc..] Default: none" size="4" value="{{if .ReplyContext}}{{.ReplyContext.ReplyLanguage}}{{end}}">
<input type="number" id="expires-in" name="expires-in" title="Post autodeleted after hour(s)" min="0" value="0" size="4"> <input type="number" id="expires-in" name="expires-in" title="Post autodeleted after hour(s)" min="0" value="0" size="4">
<input type="datetime-local" id="scheduled" name="scheduled" step=300 title="Schedule your status (timezone UTC+0)"> <input type="datetime-local" id="scheduled" name="scheduled" step=300 title="Schedule your status (timezone UTC+0)">
</form> </form>