Translation related work

This commit is contained in:
Frisk 2020-08-08 03:23:01 +02:00
parent 95c7d8f22b
commit a75e38e04f
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
16 changed files with 658 additions and 537 deletions

View file

@ -9,4 +9,4 @@ If you contribute, I ask of you to create merge requests based on testing branch
`testing `- testing branch is what all of my hosted scripts run. It is used to test the code before merging it with master branch.
## Translations ##
If you speak in other languages than English, you are more than welcome to. All you need to do, is grab the [translation template file](rcgcdw.pot) and fill out the empty strings under every English sentence. You can use software like Poedit or use your favorite text editor to do that. If you are looking for examples, you can look at [Polish translation](/locale/pl/LC_MESSAGES/rcgcdw.po). After you translate it, you can either send a merge request to the testing branch, or, if you don't know git [contact me directly](https://minecraft.gamepedia.com/User:Frisk#Contact) so I can do this for you.
If you speak in other languages than English, you are more than welcome to. There are several ways you can contribute your translation, first the easiest one is to signup at [our weblate instance](https://weblate.frisk.space) and [contact me directly with request to review your account](https://minecraft.gamepedia.com/User:Frisk#Contact). You can also contact me so I send you the translation files you can fill in. If you know how .po files work, you are also free to send Merge Requests with translated files.

View file

@ -1,92 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-04 00:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: discussions.py:56
#, python-brace-format
msgid "Replied to \"{title}\""
msgstr ""
#: discussions.py:63 discussions.py:79 discussions.py:127 discussions.py:143
msgid "unknown"
msgstr ""
#: discussions.py:68
#, python-brace-format
msgid "Replied to \"{title}\" on {user}'s Message Wall"
msgstr ""
#: discussions.py:72
#, python-brace-format
msgid "Created \"{title}\""
msgstr ""
#: discussions.py:86
#, python-brace-format
msgid "Created \"{title}\" on {user}'s Message Wall"
msgstr ""
#: discussions.py:99
#, python-brace-format
msgid "Created a poll titled \"{title}\""
msgstr ""
#: discussions.py:104
msgid "Option {}"
msgstr ""
#: discussions.py:105
#, python-brace-format
msgid "__[View image]({image_url})__"
msgstr ""
#: discussions.py:121
#, python-brace-format
msgid ""
"[{author}](<{url}f/u/{creatorId}>) created [{title}](<{url}f/p/{threadId}>) "
"in {forumName}"
msgstr ""
#: discussions.py:130
#, python-brace-format
msgid ""
"[{author}](<{url}f/u/{creatorId}>) created [{title}](<{wikiurl}wiki/"
"Message_Wall:{user_wall}?threadId={threadid}>) on {user}'s Message Wall"
msgstr ""
#: discussions.py:136
#, python-brace-format
msgid ""
"[{author}](<{url}f/u/{creatorId}>) created a [reply](<{url}f/p/{threadId}/r/"
"{postId}>) to [{title}](<{url}f/p/{threadId}>) in {forumName}"
msgstr ""
#: discussions.py:147
#, python-brace-format
msgid ""
"[{author}](<{url}f/u/{creatorId}>) replied to [{title}](<{wikiurl}wiki/"
"Message_Wall:{user_wall}?threadId={threadid}#{replyId}>) on {user}'s Message "
"Wall"
msgstr ""
#: discussions.py:153
#, python-brace-format
msgid ""
"[{author}](<{url}f/u/{creatorId}>) created a poll [{title}](<{url}f/p/"
"{threadId}>) in {forumName}"
msgstr ""

View file

@ -0,0 +1,107 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the RcGcDw package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: RcGcDw\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-08 02:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/discussion_formatters.py:38
#, python-brace-format
msgid ""
"[{author}]({author_url}) created a [reply](<{url}f/p/{threadId}/r/{postId}>) "
"to [{title}](<{url}f/p/{threadId}>) in {forumName}"
msgstr ""
#: src/discussion_formatters.py:40 src/discussion_formatters.py:49
#: src/discussion_formatters.py:104 src/discussion_formatters.py:117
msgid "unknown"
msgstr ""
#: src/discussion_formatters.py:44
#, python-brace-format
msgid ""
"[{author}]({author_url}) created [{title}](<{url}wiki/Message_Wall:"
"{user_wall}?threadId={threadId}>) on [{user}'s Message Wall](<{url}wiki/"
"Message_Wall:{user_wall}>)"
msgstr ""
#: src/discussion_formatters.py:46
#, python-brace-format
msgid ""
"[{author}]({author_url}) created a [reply](<{url}wiki/Message_Wall:"
"{user_wall}?threadId={threadId}#{replyId}>) to [{title}](<{url}wiki/"
"Message_Wall:{user_wall}?threadId={threadId}) on [{user}'s Message Wall]"
"(<{url}wiki/Message_Wall:{user_wall}>)"
msgstr ""
#: src/discussion_formatters.py:51
#, python-brace-format
msgid ""
"[{author}]({author_url}) created a [comment](<{url}wiki/{article}?"
"commentId={commentId}>) on [{article}](<{url}wiki/{article}>)"
msgstr ""
#: src/discussion_formatters.py:53
#, python-brace-format
msgid ""
"[{author}]({author_url}) created a [reply](<{url}wiki/{article}?"
"threadId={threadId}) to a [comment](<{url}wiki/{article}?"
"commentId={commentId}&replyId={replyId}>) on [{article}](<{url}wiki/{article}"
">)"
msgstr ""
#: src/discussion_formatters.py:82
#, python-brace-format
msgid "Created \"{title}\""
msgstr ""
#: src/discussion_formatters.py:87
#, python-brace-format
msgid "Created a poll \"{title}\""
msgstr ""
#: src/discussion_formatters.py:92
msgid "Option {}"
msgstr ""
#: src/discussion_formatters.py:93
#, python-brace-format
msgid "__[View image]({image_url})__"
msgstr ""
#: src/discussion_formatters.py:101
#, python-brace-format
msgid "Replied to \"{title}\""
msgstr ""
#: src/discussion_formatters.py:110
#, python-brace-format
msgid "Created \"{title}\" on {user}'s Message Wall"
msgstr ""
#: src/discussion_formatters.py:114
#, python-brace-format
msgid "Replied to \"{title}\" on {user}'s Message Wall"
msgstr ""
#: src/discussion_formatters.py:121
#, python-brace-format
msgid "Commented on {article}"
msgstr ""
#: src/discussion_formatters.py:125
#, python-brace-format
msgid "Replied to a comment on {article}"
msgstr ""

84
locale/templates/misc.pot Normal file
View file

@ -0,0 +1,84 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the RcGcDw package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: RcGcDw\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-08 02:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/misc.py:42
msgid "Location"
msgstr ""
#: src/misc.py:42
msgid "About me"
msgstr ""
#: src/misc.py:42
msgid "Google link"
msgstr ""
#: src/misc.py:42
msgid "Facebook link"
msgstr ""
#: src/misc.py:42
msgid "Twitter link"
msgstr ""
#: src/misc.py:42
msgid "Reddit link"
msgstr ""
#: src/misc.py:42
msgid "Twitch link"
msgstr ""
#: src/misc.py:42
msgid "PSN link"
msgstr ""
#: src/misc.py:42
msgid "VK link"
msgstr ""
#: src/misc.py:42
msgid "XBL link"
msgstr ""
#: src/misc.py:42
msgid "Steam link"
msgstr ""
#: src/misc.py:42
msgid "Discord handle"
msgstr ""
#: src/misc.py:42
msgid "Battle.net handle"
msgstr ""
#: src/misc.py:142
msgid ""
"\n"
"__And more__"
msgstr ""
#: src/misc.py:423
msgid "Unknown"
msgstr ""
#: src/misc.py:425
msgid "unknown"
msgstr ""

40
locale/templates/rc.pot Normal file
View file

@ -0,0 +1,40 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the RcGcDw package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: RcGcDw\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-08 02:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/rc.py:146
#, python-brace-format
msgid "Connection to {wiki} seems to be stable now."
msgstr ""
#: src/rc.py:147 src/rc.py:262
msgid "Connection status"
msgstr ""
#: src/rc.py:261
#, python-brace-format
msgid "{wiki} seems to be down or unreachable."
msgstr ""
#: src/rc.py:330
msgid "~~hidden~~"
msgstr ""
#: src/rc.py:336
msgid "hidden"
msgstr ""

File diff suppressed because it is too large Load diff

201
locale/templates/rcgcdw.pot Normal file
View file

@ -0,0 +1,201 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the RcGcDw package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: RcGcDw\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-08 02:52+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: src/rcgcdw.py:112 src/rcgcdw.py:114 src/rcgcdw.py:116 src/rcgcdw.py:118
#: src/rcgcdw.py:120 src/rcgcdw.py:122 src/rcgcdw.py:124
#, python-brace-format
msgid "{value} (avg. {avg})"
msgstr ""
#: src/rcgcdw.py:144
msgid "Daily overview"
msgstr ""
#: src/rcgcdw.py:152
msgid "No activity"
msgstr ""
#: src/rcgcdw.py:176
msgid " ({} action)"
msgid_plural " ({} actions)"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:178
msgid " ({} edit)"
msgid_plural " ({} edits)"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:183
msgid " UTC ({} action)"
msgid_plural " UTC ({} actions)"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:185 src/rcgcdw.py:186 src/rcgcdw.py:190
msgid "But nobody came"
msgstr ""
#: src/rcgcdw.py:193
msgid "Most active user"
msgid_plural "Most active users"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:194
msgid "Most edited article"
msgid_plural "Most edited articles"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:195
msgid "Edits made"
msgstr ""
#: src/rcgcdw.py:195
msgid "New files"
msgstr ""
#: src/rcgcdw.py:195
msgid "Admin actions"
msgstr ""
#: src/rcgcdw.py:196
msgid "Bytes changed"
msgstr ""
#: src/rcgcdw.py:196
msgid "New articles"
msgstr ""
#: src/rcgcdw.py:197
msgid "Unique contributors"
msgstr ""
#: src/rcgcdw.py:198
msgid "Most active hour"
msgid_plural "Most active hours"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:199
msgid "Day score"
msgstr ""
#: src/rcgcdw.py:241
msgid "director"
msgstr ""
#: src/rcgcdw.py:241
msgid "bot"
msgstr ""
#: src/rcgcdw.py:241
msgid "editor"
msgstr ""
#: src/rcgcdw.py:241
msgid "directors"
msgstr ""
#: src/rcgcdw.py:241
msgid "sysop"
msgstr ""
#: src/rcgcdw.py:241
msgid "bureaucrat"
msgstr ""
#: src/rcgcdw.py:241
msgid "reviewer"
msgstr ""
#: src/rcgcdw.py:242
msgid "autoreview"
msgstr ""
#: src/rcgcdw.py:242
msgid "autopatrol"
msgstr ""
#: src/rcgcdw.py:242
msgid "wiki_guardian"
msgstr ""
#: src/rcgcdw.py:242
msgid "second"
msgid_plural "seconds"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "minute"
msgid_plural "minutes"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "hour"
msgid_plural "hours"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "day"
msgid_plural "days"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "week"
msgid_plural "weeks"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "month"
msgid_plural "months"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "year"
msgid_plural "years"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "millennium"
msgid_plural "millennia"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "decade"
msgid_plural "decades"
msgstr[0] ""
msgstr[1] ""
#: src/rcgcdw.py:242
msgid "century"
msgid_plural "centuries"
msgstr[0] ""
msgstr[1] ""

View file

@ -1,24 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-04 00:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: misc.py:143
msgid ""
"\n"
"__And more__"
msgstr ""

View file

@ -0,0 +1,6 @@
cd ..
xgettext -L Python --package-name=RcGcDw -o 'locale/templates/discussion_formatters.pot' src/discussion_formatters.py
xgettext -L Python --package-name=RcGcDw -o 'locale/templates/rc_formatters.pot' src/rc_formatters.py
xgettext -L Python --package-name=RcGcDw -o 'locale/templates/rcgcdw.pot' src/rcgcdw.py
xgettext -L Python --package-name=RcGcDw -o 'locale/templates/rc.pot' src/rc.py
xgettext -L Python --package-name=RcGcDw -o 'locale/templates/misc.pot' src/misc.py

View file

@ -5,9 +5,9 @@ from urllib.parse import quote_plus
from src.configloader import settings
from src.misc import DiscordMessage, send_to_discord, escape_formatting
from src.i18n import disc
from src.i18n import discussion_formatters
_ = disc.gettext
_ = discussion_formatters.gettext
discussion_logger = logging.getLogger("rcgcdw.discussion_formatter")

View file

@ -6,14 +6,13 @@ logger = logging.getLogger("rcgcdw.i18n")
try:
if settings["lang"] != "en":
lang = gettext.translation('rcgcdw', localedir='locale', languages=[settings["lang"]])
disc = gettext.translation('discussions', localedir='locale', languages=[settings["lang"]])
rcgcdw = gettext.translation('rcgcdw', localedir='locale', languages=[settings["lang"]])
discussion_formatters = gettext.translation('discussion_formatters', localedir='locale', languages=[settings["lang"]])
rc = gettext.translation('rc', localedir='locale', languages=[settings["lang"]])
rc_formatters = gettext.translation('rc_formatters', localedir='locale', languages=[settings["lang"]])
misc = gettext.translation('misc', localedir='locale', languages=[settings["lang"]])
else:
lang, disc, misc = gettext.NullTranslations(), gettext.NullTranslations(), gettext.NullTranslations()
rcgcdw, discussion_formatters, rc, rc_formatters, misc = gettext.NullTranslations(), gettext.NullTranslations(), gettext.NullTranslations(), gettext.NullTranslations(), gettext.NullTranslations()
except FileNotFoundError:
logger.critical("No language files have been found. Make sure locale folder is located in the directory.")
sys.exit(1)
lang.install()
ngettext = lang.ngettext

View file

@ -10,6 +10,10 @@ from src.misc import WIKI_SCRIPT_PATH, WIKI_API_PATH, messagequeue, datafile, se
from src.exceptions import MWError
from src.session import session
from src.rc_formatters import compact_formatter, embed_formatter
from src.i18n import rc
_ = rc.gettext
storage = datafile.data
logger = logging.getLogger("rcgcdw.rc")

View file

@ -11,9 +11,10 @@ from bs4 import BeautifulSoup
from src.configloader import settings
from src.misc import link_formatter, create_article_path, WIKI_SCRIPT_PATH, send_to_discord, DiscordMessage, safe_read, \
WIKI_API_PATH, ContentParser, profile_field_name, LinkParser
from src.i18n import lang
from src.i18n import rc_formatters
#from src.rc import recent_changes, pull_comment
ngettext = lang.ngettext
_ = rc_formatters.gettext
ngettext = rc_formatters.ngettext
logger = logging.getLogger("rcgcdw.rc_formatters")
#from src.rcgcdw import recent_changes, ngettext, logger, profile_field_name, LinkParser, pull_comment

View file

@ -30,9 +30,10 @@ from src.misc import add_to_dict, datafile, \
DiscordMessage
from src.rc import recent_changes
from src.exceptions import MWError
from src.i18n import ngettext, lang
from src.i18n import rcgcdw
_ = lang.gettext
_ = rcgcdw.gettext
ngettext = rcgcdw.ngettext
if settings["fandom_discussions"]["enabled"]:
import src.discussions