diff --git a/daemon.py b/daemon.py index 079e1df29..e38a3f0a6 100644 --- a/daemon.py +++ b/daemon.py @@ -2324,6 +2324,10 @@ class PubServer(BaseHTTPRequestHandler): if self.server.keyShortcuts.get(nickname): accessKeys = self.server.keyShortcuts[nickname] + customSubmitText = \ + getConfigParam(baseDir, + 'customSubmitText') + msg = htmlNewPost(self.server.cssCache, False, self.server.translate, baseDir, @@ -2337,7 +2341,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.defaultTimeline, self.server.newswire, self.server.themeName, - True, accessKeys).encode('utf-8') + True, accessKeys, + customSubmitText).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, callingDomain) @@ -2433,6 +2438,10 @@ class PubServer(BaseHTTPRequestHandler): if self.server.keyShortcuts.get(nickname): accessKeys = self.server.keyShortcuts[nickname] + customSubmitText = \ + getConfigParam(baseDir, + 'customSubmitText') + msg = htmlNewPost(self.server.cssCache, False, self.server.translate, baseDir, @@ -2445,7 +2454,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.defaultTimeline, self.server.newswire, self.server.themeName, - True, accessKeys).encode('utf-8') + True, accessKeys, + customSubmitText).encode('utf-8') msglen = len(msg) self._set_headers('text/html', msglen, cookie, callingDomain) @@ -4440,6 +4450,22 @@ class PubServer(BaseHTTPRequestHandler): 'youtubedomain', '') self.server.YTReplacementDomain = None + # change custom post submit button text + currCustomSubmitText = \ + getConfigParam(baseDir, + 'customSubmitText') + if fields.get('customSubmitText'): + if fields['customSubmitText'] != \ + currCustomSubmitText: + customText = fields['customSubmitText'] + setConfigParam(baseDir, + 'customSubmitText', + customText) + else: + if currCustomSubmitText: + setConfigParam(baseDir, + 'customSubmitText', '') + # change instance description currInstanceDescriptionShort = \ getConfigParam(baseDir, @@ -10421,6 +10447,10 @@ class PubServer(BaseHTTPRequestHandler): if self.server.keyShortcuts.get(nickname): accessKeys = self.server.keyShortcuts[nickname] + customSubmitText = \ + getConfigParam(baseDir, + 'customSubmitText') + msg = htmlNewPost(self.server.cssCache, mediaInstance, translate, @@ -10435,7 +10465,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.defaultTimeline, self.server.newswire, self.server.themeName, - noDropDown, accessKeys).encode('utf-8') + noDropDown, accessKeys, + customSubmitText).encode('utf-8') if not msg: print('Error replying to ' + inReplyToUrl) self._404() diff --git a/translations/ar.json b/translations/ar.json index 88649d5fe..0d4c968d2 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -446,5 +446,6 @@ "Artists": "الفنانين", "Graphic Design": "التصميم الجرافيكي", "Import Theme": "استيراد الموضوع", - "Export Theme": "موضوع التصدير" + "Export Theme": "موضوع التصدير", + "Custom post submit button text": "عرف نشر إرسال نص زر" } diff --git a/translations/ca.json b/translations/ca.json index 680c9d1c3..481bc633e 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -446,5 +446,6 @@ "Artists": "Artistes", "Graphic Design": "Disseny gràfic", "Import Theme": "Importació temàtica", - "Export Theme": "Tema d'exportació" + "Export Theme": "Tema d'exportació", + "Custom post submit button text": "Text de botó d'enviament de publicacions personalitzades" } diff --git a/translations/cy.json b/translations/cy.json index 9ebef4a9c..c5543a1ac 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -446,5 +446,6 @@ "Artists": "Artistiaid", "Graphic Design": "Dylunio Graffig", "Import Theme": "Thema Mewnforio", - "Export Theme": "Thema Allforio" + "Export Theme": "Thema Allforio", + "Custom post submit button text": "Testun Post Post Post" } diff --git a/translations/de.json b/translations/de.json index dd04ed255..e18f86cf0 100644 --- a/translations/de.json +++ b/translations/de.json @@ -446,5 +446,6 @@ "Artists": "Künstler", "Graphic Design": "Grafikdesign", "Import Theme": "Theme importieren", - "Export Theme": "Theme exportieren" + "Export Theme": "Theme exportieren", + "Custom post submit button text": "Benutzerdefinierte Post-Senden Schaltfläche Text" } diff --git a/translations/en.json b/translations/en.json index 6633fda6b..6e7ac30d8 100644 --- a/translations/en.json +++ b/translations/en.json @@ -446,5 +446,6 @@ "Artists": "Artists", "Graphic Design": "Graphic Design", "Import Theme": "Import Theme", - "Export Theme": "Export Theme" + "Export Theme": "Export Theme", + "Custom post submit button text": "Custom post submit button text" } diff --git a/translations/es.json b/translations/es.json index 0d3099a2c..7311d5e78 100644 --- a/translations/es.json +++ b/translations/es.json @@ -446,5 +446,6 @@ "Artists": "Artistas", "Graphic Design": "Diseño gráfico", "Import Theme": "Tema de importación", - "Export Theme": "Tema de exportación" + "Export Theme": "Tema de exportación", + "Custom post submit button text": "POST POST PERSONALIZADO Botón Texto" } diff --git a/translations/fr.json b/translations/fr.json index f49bd5d2b..605cb43ce 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -446,5 +446,6 @@ "Artists": "Artistes", "Graphic Design": "Conception graphique", "Import Theme": "Import thème", - "Export Theme": "Thème d'exportation" + "Export Theme": "Thème d'exportation", + "Custom post submit button text": "Texte de bouton d'envoi postal personnalisé" } diff --git a/translations/ga.json b/translations/ga.json index 5ac04d5f0..9df731cb5 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -446,5 +446,6 @@ "Artists": "Ealaíontóirí", "Graphic Design": "Dearadh grafach", "Import Theme": "Téama Iompórtáil", - "Export Theme": "Téama Easpórtála" + "Export Theme": "Téama Easpórtála", + "Custom post submit button text": "Post saincheaptha Cuir isteach an cnaipe Téacs" } diff --git a/translations/hi.json b/translations/hi.json index c401ae54e..824a2c346 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -446,5 +446,6 @@ "Artists": "कलाकार की", "Graphic Design": "ग्राफ़िक डिज़ाइन", "Import Theme": "आयात विषय", - "Export Theme": "निर्यात विषय" + "Export Theme": "निर्यात विषय", + "Custom post submit button text": "कस्टम पोस्ट सबमिट बटन टेक्स्ट" } diff --git a/translations/it.json b/translations/it.json index d35b5f80a..45e304652 100644 --- a/translations/it.json +++ b/translations/it.json @@ -446,5 +446,6 @@ "Artists": "Artiste", "Graphic Design": "Graphic design", "Import Theme": "Tema dell'importazione", - "Export Theme": "Esportare tema" + "Export Theme": "Esportare tema", + "Custom post submit button text": "Pulsante di invio del post personalizzato" } diff --git a/translations/ja.json b/translations/ja.json index 3d35359d2..aba165a20 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -446,5 +446,6 @@ "Artists": "アーティスト", "Graphic Design": "グラフィックデザイン", "Import Theme": "輸入テーマ", - "Export Theme": "テーマをエクスポートします" + "Export Theme": "テーマをエクスポートします", + "Custom post submit button text": "カスタムポスト送信ボタンテキスト" } diff --git a/translations/ku.json b/translations/ku.json index bc81ed21e..a5e686051 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -446,5 +446,6 @@ "Artists": "Hunermend", "Graphic Design": "Sêwirana grafîkî", "Import Theme": "Mijara Import", - "Export Theme": "Mijara Export" + "Export Theme": "Mijara Export", + "Custom post submit button text": "Nivîsa bişkojka paşîn a paşîn" } diff --git a/translations/oc.json b/translations/oc.json index dddf3f19c..a0ab81de1 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -442,5 +442,6 @@ "Artists": "Artists", "Graphic Design": "Graphic Design", "Import Theme": "Import Theme", - "Export Theme": "Export Theme" + "Export Theme": "Export Theme", + "Custom post submit button text": "Custom post submit button text" } diff --git a/translations/pt.json b/translations/pt.json index 0673e74ae..3ce0bc69a 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -446,5 +446,6 @@ "Artists": "Artistas", "Graphic Design": "Design gráfico", "Import Theme": "Importar tema", - "Export Theme": "Exportar tema" + "Export Theme": "Exportar tema", + "Custom post submit button text": "Texto de botão de envio de post personalizado" } diff --git a/translations/ru.json b/translations/ru.json index 9a29cf93e..70ce88f87 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -446,5 +446,6 @@ "Artists": "Художники", "Graphic Design": "Графический дизайн", "Import Theme": "Импортировать тему", - "Export Theme": "Экспортная тема" + "Export Theme": "Экспортная тема", + "Custom post submit button text": "Пользовательский пост Отправить кнопку текста" } diff --git a/translations/zh.json b/translations/zh.json index c3db57343..ba268fc9a 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -446,5 +446,6 @@ "Artists": "艺人", "Graphic Design": "平面设计", "Import Theme": "进口主题", - "Export Theme": "出口主题" + "Export Theme": "出口主题", + "Custom post submit button text": "自定义发布提交按钮文本" } diff --git a/webapp_create_post.py b/webapp_create_post.py index 4340d9ba3..19f2e0e05 100644 --- a/webapp_create_post.py +++ b/webapp_create_post.py @@ -187,7 +187,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, domainFull: str, defaultTimeline: str, newswire: {}, theme: str, noDropDown: bool, - accessKeys: {}) -> str: + accessKeys: {}, customSubmitText: str) -> str: """New post screen """ replyStr = '' @@ -702,9 +702,12 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, ' \n' + submitText = translate['Submit'] + if customSubmitText: + submitText = customSubmitText newPostForm += \ ' \n' newPostForm += ' \n' @@ -776,7 +779,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {}, newPostForm += '
\n' newPostForm += \ ' \n' + submitText + '">\n' newPostForm += '
\n' newPostForm += ' \n' diff --git a/webapp_profile.py b/webapp_profile.py index eb5dc48df..b97d0e9a9 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1359,6 +1359,8 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, # Instance details section instanceDescription = \ getConfigParam(baseDir, 'instanceDescription') + customSubmitText = \ + getConfigParam(baseDir, 'customSubmitText') instanceDescriptionShort = \ getConfigParam(baseDir, 'instanceDescriptionShort') instanceTitle = \ @@ -1401,6 +1403,20 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str, instanceStr += \ ' ' + + instanceStr += \ + ' ' + if customSubmitText: + instanceStr += \ + '
' + else: + instanceStr += \ + '
' + instanceStr += \ ' '