From 121f29fb275a4b9850feab6094709ef34b7e28c0 Mon Sep 17 00:00:00 2001 From: Frisk Date: Thu, 12 Jul 2018 10:01:51 +0200 Subject: [PATCH] Added EN translation --- .gitignore | 1 + locale/en/LC_MESSAGES/en.mo | Bin 0 -> 6940 bytes locale/en/LC_MESSAGES/en.po | 402 ++++++++++++++++++++++++++++++++++++ rcgcdw.py | 11 +- settings.json.example | 4 +- 5 files changed, 409 insertions(+), 9 deletions(-) create mode 100644 locale/en/LC_MESSAGES/en.mo create mode 100644 locale/en/LC_MESSAGES/en.po diff --git a/.gitignore b/.gitignore index b936a18..d5b0f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ settings.json pygettext.py lastchange.txt .directory +/debug diff --git a/locale/en/LC_MESSAGES/en.mo b/locale/en/LC_MESSAGES/en.mo new file mode 100644 index 0000000000000000000000000000000000000000..af9ca1ca6582bd073e79f0836327ed4f2899f4f5 GIT binary patch literal 6940 zcmeI0TWlOx8OKkdrQiUiDNra7PEy+1N!GO;hd9oK#&MFmwUaclQ@5c_W_OS6!Miit znOWPbWsxWH_%0zyb!#P2^dI~$v* zitc@OropUIV9K zKRg9*fNStN_!xW#yaf4Yp62I9_$<5y{sOAKf57dq?+sbK-B9HR;Q+h~%07X&!YASF z@cYohm*FVf+L!rt0`BJhKKM5Haj1Hi;G5wOAyv#z;XC0A@HY5YDEn<&jJX+(!nebD zH~>Sac0QYb{~p}I`-^ZJy!MU8ycgaI)$Vafljb7Sc$OiirUl2~BXBEx7Vd&Sf$xL= zgoMQGpwbB31@-+wsJMSJ=Ows@_pifu!C%9E_%BEk<~9baagIX8{VbN|#5W`kR8Ufe%3W zc@e6fgR%=CAu|b7d>)1tUV_racVTpuF~5bfn`iKvhXttmYp@@F1ggKMpvLoUsBu3J z)!&Oy^Y9Xsp0B}J?d^h!?|!Iy=kxMqDBZQ7?7s}9zvtlX@Q=_!`_@eVN1*&#fxF=+ zp!EDSRK4dRQ)vDK6|bxKsPS%r8s{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ls44=OT@AbYM)Lu8E{H^|uOd(e|RjP!W0;7}iDqR!{iY^yznps zdRMD8kEt8C$0I*pwg(%2m_%-Ebk7~yTf(5ukvdpeI^1`<){MMb>3A5`<8d1_(%1OV z$N`&W5A_Fj`yo3#aDcY6;g56a>f5|7ZeABRuZ!6qBi*ZD@#o0qb&(zEvV;1v3-{)A zu~r;(#Wi^Iy102={6D%b9_d{dmCdh<6I>T3de_Ct^#5(R7j`po`e*2WbzRhL%dK)< WO#g$1zp}XNQ1M><&&~hx+W2qg9b{_& literal 0 HcmV?d00001 diff --git a/locale/en/LC_MESSAGES/en.po b/locale/en/LC_MESSAGES/en.po new file mode 100644 index 0000000..3da81ee --- /dev/null +++ b/locale/en/LC_MESSAGES/en.po @@ -0,0 +1,402 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2018-07-08 18:43+0200\n" +"PO-Revision-Date: 2018-07-10 13:49+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: pygettext.py 1.5\n" +"X-Generator: Poedit 2.0.8\n" +"Last-Translator: Frisk \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: en\n" + +#: rcgcdw.py:126 +msgid "(N!) " +msgstr "(N!) " + +#: rcgcdw.py:126 +msgid "m " +msgstr "m " + +#: rcgcdw.py:144 +msgid "([preview]({link}) | [undo]({undolink}))" +msgstr "([preview]({link}) | [undo]({undolink}))" + +#: rcgcdw.py:144 rcgcdw.py:170 +msgid "Options" +msgstr "Options" + +#: rcgcdw.py:145 +msgid "Uploaded a new version of {name}" +msgstr "Uploaded a new version of {name}" + +#: rcgcdw.py:147 +msgid "Uploaded {name}" +msgstr "Uploaded {name}" + +#: rcgcdw.py:160 +msgid "**No license!**" +msgstr "**No license!**" + +#: rcgcdw.py:170 +msgid "([preview]({link}))" +msgstr "([preview]({link}))" + +#: rcgcdw.py:171 +msgid "" +"{desc}\n" +"License: {license}" +msgstr "" +"{desc}\n" +"License: {license}" + +#: rcgcdw.py:174 +msgid "Deleted page {article}" +msgstr "Deleted page {article}" + +#: rcgcdw.py:177 +msgid "Deleted redirect {article} by overwriting" +msgstr "Deleted redirect {article} by overwriting" + +#: rcgcdw.py:180 +msgid "A redirect has been made" +msgstr "A redirect has been made" + +#: rcgcdw.py:180 +msgid "No redirect has been made" +msgstr "No redirect has been made" + +#: rcgcdw.py:181 +msgid "Moved {article} to {target}" +msgstr "Moved {article} to {target}" + +#: rcgcdw.py:184 +msgid "Moved {article} to {title} over redirect" +msgstr "Moved {article} to {title} over redirect" + +#: rcgcdw.py:187 +msgid "Moved protection settings from {article} to {title}" +msgstr "Moved protection settings from {article} to {title}" + +#: rcgcdw.py:191 +msgid "infinity and beyond" +msgstr "infinity and beyond" + +#: rcgcdw.py:192 +msgid "Blocked {blocked_user} for {time}" +msgstr "Blocked {blocked_user} for {time}" + +#: rcgcdw.py:196 +msgid "Changed block settings for {blocked_user}" +msgstr "Changed block settings for {blocked_user}" + +#: rcgcdw.py:200 +msgid "Unblocked {blocked_user}" +msgstr "Unblocked {blocked_user}" + +#: rcgcdw.py:204 +msgid "Left a comment on {target}'s profile" +msgstr "Left a comment on {target}'s profile" + +#: rcgcdw.py:208 +msgid "Replied to a comment on {target}'s profile" +msgstr "Replied to a comment on {target}'s profile" + +#: rcgcdw.py:212 +msgid "Edited a comment on {target}'s profile" +msgstr "Edited a comment on {target}'s profile" + +#: rcgcdw.py:216 +msgid "Location" +msgstr "Location" + +#: rcgcdw.py:218 +msgid "About me" +msgstr "About me" + +#: rcgcdw.py:220 +msgid "Google link" +msgstr "Google link" + +#: rcgcdw.py:222 +msgid "Facebook link" +msgstr "Facebook link" + +#: rcgcdw.py:224 +msgid "Twitter link" +msgstr "Twitter link" + +#: rcgcdw.py:226 +msgid "Reddit link" +msgstr "Reddit link" + +#: rcgcdw.py:228 +msgid "Twitch link" +msgstr "Twitch link" + +#: rcgcdw.py:230 +msgid "PSN link" +msgstr "PSN link" + +#: rcgcdw.py:232 +msgid "VK link" +msgstr "VK link" + +#: rcgcdw.py:234 +msgid "XVL link" +msgstr "XVL link" + +#: rcgcdw.py:236 +msgid "Steam link" +msgstr "Steam link" + +#: rcgcdw.py:238 +msgid "Unknown" +msgstr "Unknown" + +#: rcgcdw.py:239 +msgid "Edited {target}'s profile" +msgstr "Edited {target}'s profile" + +#: rcgcdw.py:240 +msgid "{field} field changed to: {desc}" +msgstr "{field} field changed to: {desc}" + +#: rcgcdw.py:244 +msgid "Deleted a comment on {target}'s profile" +msgstr "Deleted a comment on {target}'s profile" + +#: rcgcdw.py:247 +msgid "Changed group membership for {target}" +msgstr "Changed group membership for {target}" + +#: rcgcdw.py:257 rcgcdw.py:259 +msgid "none" +msgstr "none" + +#: rcgcdw.py:260 rcgcdw.py:381 +msgid "No description provided" +msgstr "No description provided" + +#: rcgcdw.py:261 +msgid "Groups changed from {old_groups} to {new_groups}{reason}" +msgstr "Groups changed from {old_groups} to {new_groups}{reason}" + +#: rcgcdw.py:264 +msgid "Protected {target}" +msgstr "Protected {target}" + +#: rcgcdw.py:268 +msgid "Changed protection level for {article}" +msgstr "Changed protection level for {article}" + +#: rcgcdw.py:272 +msgid "Removed protection from {article}" +msgstr "Removed protection from {article}" + +#: rcgcdw.py:275 +msgid "Changed visibility of revision(s) on page {article} " +msgstr "Changed visibility of revision(s) on page {article} " + +#: rcgcdw.py:278 +msgid "Imported {article} with {count} revision(s)" +msgstr "Imported {article} with {count} revision(s)" + +#: rcgcdw.py:281 +msgid "Restored {article}" +msgstr "Restored {article}" + +#: rcgcdw.py:284 +msgid "Changed visibility of log events" +msgstr "Changed visibility of log events" + +#: rcgcdw.py:287 +msgid "Imported interwiki" +msgstr "Imported interwiki" + +#: rcgcdw.py:290 +msgid "Edited abuse filter number {number}" +msgstr "Edited abuse filter number {number}" + +#: rcgcdw.py:293 +msgid "Merged revision histories of {article} into {dest}" +msgstr "Merged revision histories of {article} into {dest}" + +#: rcgcdw.py:296 +msgid "Added an entry to the interwiki table" +msgstr "Added an entry to the interwiki table" + +#: rcgcdw.py:297 rcgcdw.py:301 +msgid "Prefix: {prefix}, website: {website} | {desc}" +msgstr "Prefix: {prefix}, website: {website} | {desc}" + +#: rcgcdw.py:300 +msgid "Edited an entry in interwiki table" +msgstr "Edited an entry in interwiki table" + +#: rcgcdw.py:304 +msgid "Deleted an entry in interwiki table" +msgstr "Deleted an entry in interwiki table" + +#: rcgcdw.py:305 +msgid "Prefix: {prefix} | {desc}" +msgstr "Prefix: {prefix} | {desc}" + +#: rcgcdw.py:308 +msgid "Changed the content model of the page {article}" +msgstr "Changed the content model of the page {article}" + +#: rcgcdw.py:309 +msgid "Model changed from {old} to {new}: {reason}" +msgstr "Model changed from {old} to {new}: {reason}" + +#: rcgcdw.py:312 +msgid "Edited the sprite for {article}" +msgstr "Edited the sprite for {article}" + +#: rcgcdw.py:315 +msgid "Created the sprite sheet for {article}" +msgstr "Created the sprite sheet for {article}" + +#: rcgcdw.py:318 +msgid "Edited the slice for {article}" +msgstr "Edited the slice for {article}" + +#: rcgcdw.py:321 +msgid "Created a tag \"{tag}\"" +msgstr "Created a tag \"{tag}\"" + +#: rcgcdw.py:325 +msgid "Deleted a tag \"{tag}\"" +msgstr "Deleted a tag \"{tag}\"" + +#: rcgcdw.py:329 +msgid "Activated a tag \"{tag}\"" +msgstr "Activated a tag \"{tag}\"" + +#: rcgcdw.py:332 +msgid "Deactivated a tag \"{tag}\"" +msgstr "Deactivated a tag \"{tag}\"" + +#: rcgcdw.py:353 +msgid "Tags" +msgstr "Tags" + +#: rcgcdw.py:474 +msgid "Unable to process the event" +msgstr "Unable to process the event" + +#: rcgcdw.py:474 +msgid "error" +msgstr "error" + +#: rcgcdw.py:554 +msgid "Daily overview" +msgstr "Daily overview" + +#: rcgcdw.py:570 +msgid " ({} actions)" +msgstr " ({} actions)" + +#: rcgcdw.py:571 +msgid " UTC ({} actions)" +msgstr " UTC ({} actions)" + +#: rcgcdw.py:573 rcgcdw.py:574 +msgid "But nobody came" +msgstr "But nobody came" + +#: rcgcdw.py:578 +msgid "Admin actions" +msgstr "Admin actions" + +#: rcgcdw.py:578 +msgid "Bytes changed" +msgstr "Bytes changed" + +#: rcgcdw.py:578 +msgid "Day score" +msgstr "Day score" + +#: rcgcdw.py:578 +msgid "Edits made" +msgstr "Edits made" + +#: rcgcdw.py:578 +msgid "Most active hours" +msgstr "Most active hours" + +#: rcgcdw.py:578 +msgid "Most active users" +msgstr "Most active users" + +#: rcgcdw.py:578 +msgid "New articles" +msgstr "New articles" + +#: rcgcdw.py:578 +msgid "New files" +msgstr "New files" + +#: rcgcdw.py:578 +msgid "Unique contributors" +msgstr "Unique contributors" + +#: rcgcdw.py:668 +msgid "Connection to {wiki} seems to be stable now." +msgstr "Connection to {wiki} seems to be stable now." + +#: rcgcdw.py:668 rcgcdw.py:723 +msgid "Connection status" +msgstr "Connection status" + +#: rcgcdw.py:723 +msgid "{wiki} seems to be down or unreachable." +msgstr "{wiki} seems to be down or unreachable." + +#: rcgcdw.py:745 +msgid "autopatrol" +msgstr "Autopatrol" + +#: rcgcdw.py:745 +msgid "autoreview" +msgstr "Autoreview" + +#: rcgcdw.py:745 +msgid "bot" +msgstr "Bot" + +#: rcgcdw.py:745 +msgid "bureaucrat" +msgstr "Bureaucrat" + +#: rcgcdw.py:745 +msgid "director" +msgstr "Director" + +#: rcgcdw.py:745 +msgid "directors" +msgstr "Directors" + +#: rcgcdw.py:745 +msgid "editor" +msgstr "Editor" + +#: rcgcdw.py:745 +msgid "reviewer" +msgstr "Reviewer" + +#: rcgcdw.py:745 +msgid "sysop" +msgstr "Administrator" + +#: rcgcdw.py:745 +msgid "wiki_guardian" +msgstr "Wiki guardian" diff --git a/rcgcdw.py b/rcgcdw.py index 9bdd1cf..3518a3c 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -34,11 +34,8 @@ if settings["limitrefetch"] != -1 and os.path.exists("lastchange.txt") == False: with open("lastchange.txt", 'w') as sfile: sfile.write("99999999999") logging.info("Current settings: {settings}".format(settings=settings)) -if settings["lang"] != "en" or settings["lang"] == "": - lang = gettext.translation('rcgcdw', localedir='locale', languages=[settings["lang"]]) - lang.install() -else: - _ = lambda s: s +lang = gettext.translation('rcgcdw', localedir='locale', languages=[settings["lang"]]) +lang.install() def send(message, name, avatar): send_to_discord({"content": message, "avatar_url": avatar, "username": name}) @@ -254,9 +251,9 @@ def webhook_formatter(action, STATIC, **params): for name in params["new_groups"]: new_groups.append(_(name)) if len(old_groups) == 0: - old_groups = _("none") + old_groups = [_("none")] if len(new_groups) == 0: - new_groups = _("none") + new_groups = [_("none")] reason = ": {desc}".format(desc=params["desc"]) if params["desc"]!=_("No description provided") else "" params["desc"] = _("Groups changed from {old_groups} to {new_groups}{reason}").format(old_groups=", ".join(old_groups), new_groups=', '.join(new_groups), reason=reason) elif action == 2: diff --git a/settings.json.example b/settings.json.example index 8e447d7..0ecf6e5 100644 --- a/settings.json.example +++ b/settings.json.example @@ -19,8 +19,8 @@ "show_updown_messages": true, "overview": false, "overview_time": "00:00", - "license_regex_detect": "\\{\\{(license|lizenz|licence)", - "license_regex": "\\{\\{(license|lizenz|licence)(\\ |\\|)(?P.*?)\\}\\}", + "license_regex_detect": "\\{\\{(license|lizenz|licence|copyright)", + "license_regex": "\\{\\{(license|lizenz|licence|copyright)(\\ |\\|)(?P.*?)\\}\\}", "appearance":{ "daily_overview": { "color": 16312092,