Prepare all .po files for updating by volunteers

This commit is contained in:
Griatch 2021-05-29 18:30:20 +02:00
parent ecf757ba7c
commit 7147e3e027
15 changed files with 9116 additions and 1773 deletions

View file

@ -10,7 +10,6 @@ vary a lot depending on when they were last updated. Below are all languages
(besides English) with som level of support. Generally, any language not (besides English) with som level of support. Generally, any language not
updated after May 2021 will be missing translations. updated after May 2021 will be missing translations.
```eval_rst ```eval_rst
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
@ -26,15 +25,15 @@ updated after May 2021 will be missing translations.
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| la | Latin | Feb 2021 | | la | Latin | Feb 2021 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| po | Polish | Feb 2019 | | pl | Polish | Feb 2019 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| pt | Portugese | Dec 2015 | | pt | Portugese | Dec 2015 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| ru-RU | Russian (Russia) | Apr 2020 | | ru | Russian (Russia) | Apr 2020 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| sv | Swedish | June 2021 | | sv | Swedish | June 2021 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| zh-Hans | Chinese (simplified) | May 2019 | | zh | Chinese (simplified) | May 2019 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
``` ```
@ -62,39 +61,23 @@ the server to activate i18n.
Even for a 'fully translated' language you will still see English text Even for a 'fully translated' language you will still see English text
in many places when you start Evennia. This is because we expect you (the in many places when you start Evennia. This is because we expect you (the
developer) to know English (you are reading this manual after all). So we developer) to know English (you are reading this manual after all). So we
translate hard-coded strings that the end player may see - things you can't translate *hard-coded strings that the end player may see* - things you
easily change from your mygame/ folder. Outputs from Commands and can't easily change from your mygame/ folder. Outputs from Commands and
Typeclasses are generally not translated, nor are command/log outputs - Typeclasses are generally *not* translated, nor are console/log outputs.
and these are likely to be the brunt of the text the player will see.
``` ```
> Windows Note: If you get errors concerning `gettext` or `xgettext` on Windows, ```sidebar:: Windows users
> see the
> [Django documentation](https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#gettext-on-windows).
> A self-installing and up-to-date version of gettext for Windows (32/64-bit) is
> available on [Github](https://github.com/mlocati/gettext-iconv-windows).
If you get errors concerning `gettext` or `xgettext` on Windows,
see the `Django documentation <https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#gettext-on-windows>`_
A self-installing and up-to-date version of gettext for Windows (32/64-bit) is
available on `Github <https://github.com/mlocati/gettext-iconv-windows>`_
```
## Translating Evennia ## Translating Evennia
```important::
Evennia offers translations of hard-coded strings in the server, things like
"Connection closed" or "Server restarted", strings that end users will see and
which game devs are not supposed to change on their own. Text you see in the log
file or on the command line/log are *not* translated.
In addition, text in default Commands and in default Typeclasses will *not* be
translated by switching *i18n* language. To translate Commands and Typeclass
hooks you must overload them in your game directory and translate their returns
to the language you want. This is because from Evennia's perspective, adding
*i18n* code to commands tend to add complexity to code that is *meant* to be
changed anyway. One of the goals of Evennia is to keep the user-changeable code
as clean and easy- to-read as possible.
```
Translations are found in the core `evennia/` library, under Translations are found in the core `evennia/` library, under
`evennia/evennia/locale/`. You must make sure to have cloned this repository `evennia/evennia/locale/`. You must make sure to have cloned this repository
from [Evennia's github](github:evennia) before you can proceed. from [Evennia's github](github:evennia) before you can proceed.
@ -104,8 +87,8 @@ has translated it yet. Alternatively you might have the language but find the
translation bad ... You are welcome to help improve the situation! translation bad ... You are welcome to help improve the situation!
To start a new translation you need to first have cloned the Evennia repositry To start a new translation you need to first have cloned the Evennia repositry
with GIT and activated a python virtualenv as described on the [Setup with GIT and activated a python virtualenv as described on the
Quickstart](../Setup/Setup-Quickstart) page. [Setup Quickstart](../Setup/Setup-Quickstart) page.
Go to `evennia/evennia/` - that is, not your game dir, but inside the `evennia/` Go to `evennia/evennia/` - that is, not your game dir, but inside the `evennia/`
repo itself. If you see the `locale/` folder you are in the right place. Make repo itself. If you see the `locale/` folder you are in the right place. Make
@ -127,25 +110,52 @@ command will not overwrite any existing strings so you can run it as much as you
want. want.
Next head to `locale/<language-code>/LC_MESSAGES` and edit the `**.po` file you Next head to `locale/<language-code>/LC_MESSAGES` and edit the `**.po` file you
find there. You can edit this with a normal text editor but it is easiest if find there. You can edit this with a normal text editor but it is easiest if
you use a special po-file editor from the web (search the web for "po editor" you use a special po-file editor from the web (search the web for "po editor"
for many free alternatives). for many free alternatives), for example:
- [gtranslator](https://wiki.gnome.org/Apps/Gtranslator)
- [poeditor](https://poeditor.com/)
The concept of translating is simple, it's just a matter of taking the english The concept of translating is simple, it's just a matter of taking the english
strings you find in the `**.po` file and add your language's translation best strings you find in the `**.po` file and add your language's translation best
you can. The `**.po` format (and many supporting editors) allow you to mark you can. Once you are done, run
translations as "fuzzy". This tells the system (and future translators) that you
are unsure about the translation, or that you couldn't find a translation that
exactly matched the intention of the original text. Other translators will see
this and might be able to improve it later. Finally, you need to compile your
translation into a more efficient form. Do so from the `evennia` folder again:
evennia compilemessages `evennia compilemessages`
This will go through all languages and create/update compiled files (`**.mo`) This will compile all languages. Check your language and also check back to your
for them. This needs to be done whenever a `**.po` file is updated. `.po` file in case the process updated it - you may need to fill in some missing
header fields and should usually note who did the translation.
When you are done, make sure that everyone can benefit from your translation! When you are done, make sure that everyone can benefit from your translation!
Make a PR against Evennia with the updated `**.po` and `*.mo` files. Less Make a PR against Evennia with the updated `**.po` file. Less ideally (if git is
ideally (if git is not your thing) you can also attach them to a new post in our not your thing) you can also attach it to a new post in our forums.
forums.
### Hints on translation
Many of the translation strings use `{ ... }` placeholders. This is because they
are to be used in `.format()` python operations. While you can change the
_order_ of these if it makes more sense in your language, you must _not_
translate the variables in these formatting tags - Python will look for them!
Original: "|G{key} connected|n"
Swedish: "|G{key} anslöt|n"
You must also retain line breaks _at the start and end_ of a message, if any
(your po-editor should stop you if you don't). Try to also end with the same
sentence delimiter (if that makes sense in your language).
Original: "\n(Unsuccessfull tried '{path}')."
Swedish: "\nMisslyckades med att nå '{path}')."
Finally, try to get a feel for who a string is for. If a special technical term
is used it may be more confusing than helpful to translate it, even if it's
outside of a `{...}` tag. Even though the result is a mix of your language and
English, clarity is more important. Many languages may also use the English term
normally and reaching for a translation may make the result sound awkward
instead.
Original: "\nError loading cmdset: No cmdset class '{classname}' in '{path}'.
\n(Traceback was logged {timestamp})"
Swedish: "Fel medan cmdset laddades: Ingen cmdset-klass med namn '{classname}' i {path}.
\n(Traceback loggades {timestamp})"

View file

@ -420,7 +420,8 @@ There is also a short-hand form for starting a [ReST directive][ReST-directives]
``` ```
```` ````
Within a ReST block, one must use Restructured Text syntax, which is not the same as Markdown. Within a ReST block, one must use Restructured Text syntax, which is not the
same as Markdown.
- Single backticks around text makes it _italic_. - Single backticks around text makes it _italic_.
- Double backticks around text makes it `verbatim`. - Double backticks around text makes it `verbatim`.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Evennia 1.0\n" "Project-Id-Version: Evennia 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-29 11:09+0000\n" "POT-Creation-Date: 2021-05-29 16:25+0000\n"
"PO-Revision-Date: 2021-05-29 13:22+0200\n" "PO-Revision-Date: 2021-05-29 17:54+0200\n"
"Last-Translator: Griatch <griatch@gmail.com>\n" "Last-Translator: Griatch <griatch@gmail.com>\n"
"Language-Team: Swedish <>\n" "Language-Team: Swedish <>\n"
"Language: sv\n" "Language: sv\n"
@ -332,18 +332,18 @@ msgid "Lock: '{lockdef}' has no valid lock functions."
msgstr "Lås: '{lockdef}' innehåller inga acceptabla låsfunktioner." msgstr "Lås: '{lockdef}' innehåller inga acceptabla låsfunktioner."
#: objects/objects.py:871 #: objects/objects.py:871
#, python-format #, python-brace-format
msgid "Couldn't perform move ('%s'). Contact an admin." msgid "Couldn't perform move ({err}). Contact an admin."
msgstr "Kunde inte utföra föflyttningen ('%s'). Kontakta en admininstrator." msgstr "Kunde inte utföra föflyttningen ('{err}'). Kontakta en admininstrator."
#: objects/objects.py:881 #: objects/objects.py:881
msgid "The destination doesn't exist." msgid "The destination doesn't exist."
msgstr "Destinationen existerar inte." msgstr "Destinationen existerar inte."
#: objects/objects.py:974 #: objects/objects.py:974
#, python-format #, python-brace-format
msgid "Could not find default home '(#%d)'." msgid "Could not find default home '(#{dbid})'."
msgstr "Kunde inte hitta standard-hem '(#'%d)'." msgstr "Kunde inte hitta standard-hem '(#{dbid})'."
#: objects/objects.py:988 #: objects/objects.py:988
msgid "Something went wrong! You are dumped into nowhere. Contact an admin." msgid "Something went wrong! You are dumped into nowhere. Contact an admin."
@ -522,14 +522,14 @@ msgstr ""
"Diff innehåller icke-dicts som inte är på formen (gammal, ny, " "Diff innehåller icke-dicts som inte är på formen (gammal, ny, "
"handling_att_utföra): {diffpart}" "handling_att_utföra): {diffpart}"
#: scripts/scripthandler.py:52 #: scripts/scripthandler.py:51
#, python-format #, python-brace-format
msgid "" msgid ""
"\n" "\n"
" '%(key)s' (%(next_repeat)s/%(interval)s, %(repeats)s repeats): %(desc)s" " '{key}' ({next_repeat}/{interval}, {repeats} repeats): {desc}"
msgstr "" msgstr ""
"\n" "\n"
" '%(key)s' (%(next_repeat)s/%(interval)s, %(repeats)s repetitioner): %(desc)s" " '{key}' ({next_repeat}/{interval}, {repeats} repetitioner): {desc}"
#: scripts/scripts.py:329 #: scripts/scripts.py:329
#, python-brace-format #, python-brace-format
@ -752,7 +752,7 @@ msgstr ""
"\n" "\n"
"{error}\n" "{error}\n"
"\n" "\n"
"|rSparfunktionen stötte på ett fel. Bufferten kunde inte sparas." "|rSparfunktionen stötte på ett fel. Bufferten kunde inte sparas.|n\n"
#: utils/eveditor.py:133 #: utils/eveditor.py:133
msgid "|rNo save function defined. Buffer cannot be saved.|n" msgid "|rNo save function defined. Buffer cannot be saved.|n"
@ -1101,7 +1101,6 @@ msgstr "Försök vara mer specifik."
#: utils/utils.py:2219 #: utils/utils.py:2219
#, python-brace-format #, python-brace-format
#| msgid "Could not find '%s'."
msgid "Could not find '{query}'." msgid "Could not find '{query}'."
msgstr "Kunde inte hitta '{query}'." msgstr "Kunde inte hitta '{query}'."
@ -1226,7 +1225,6 @@ msgid "Change"
msgstr "Ändra" msgstr "Ändra"
#: web/templates/admin/app_list.html:39 #: web/templates/admin/app_list.html:39
#| msgid "You don't have permission to edit anything."
msgid "You dont have permission to view or edit anything." msgid "You dont have permission to view or edit anything."
msgstr "Du har inte rättigheter att se eller ändra någonting." msgstr "Du har inte rättigheter att se eller ändra någonting."

File diff suppressed because it is too large Load diff

View file

@ -868,7 +868,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
self.msg("%s%s" % (string, "" if err is None else " (%s)" % err)) self.msg("%s%s" % (string, "" if err is None else " (%s)" % err))
return return
errtxt = _("Couldn't perform move ('%s'). Contact an admin.") errtxt = _("Couldn't perform move ({err}). Contact an admin.")
if not emit_to_obj: if not emit_to_obj:
emit_to_obj = self emit_to_obj = self
@ -890,7 +890,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
if not self.at_before_move(destination, **kwargs): if not self.at_before_move(destination, **kwargs):
return False return False
except Exception as err: except Exception as err:
logerr(errtxt % "at_before_move()", err) logerr(errtxt.format(err="at_before_move()"), err)
return False return False
# Save the old location # Save the old location
@ -901,7 +901,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
try: try:
source_location.at_object_leave(self, destination, **kwargs) source_location.at_object_leave(self, destination, **kwargs)
except Exception as err: except Exception as err:
logerr(errtxt % "at_object_leave()", err) logerr(errtxt.format(err="at_object_leave()"), err)
return False return False
if not quiet: if not quiet:
@ -909,14 +909,14 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
try: try:
self.announce_move_from(destination, **kwargs) self.announce_move_from(destination, **kwargs)
except Exception as err: except Exception as err:
logerr(errtxt % "at_announce_move()", err) logerr(errtxt.format(err="at_announce_move()"), err)
return False return False
# Perform move # Perform move
try: try:
self.location = destination self.location = destination
except Exception as err: except Exception as err:
logerr(errtxt % "location change", err) logerr(errtxt.format(err="location change"), err)
return False return False
if not quiet: if not quiet:
@ -924,7 +924,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
try: try:
self.announce_move_to(source_location, **kwargs) self.announce_move_to(source_location, **kwargs)
except Exception as err: except Exception as err:
logerr(errtxt % "announce_move_to()", err) logerr(errtxt.format(err="announce_move_to()"), err)
return False return False
if move_hooks: if move_hooks:
@ -933,7 +933,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
try: try:
destination.at_object_receive(self, source_location, **kwargs) destination.at_object_receive(self, source_location, **kwargs)
except Exception as err: except Exception as err:
logerr(errtxt % "at_object_receive()", err) logerr(errtxt.format(err="at_object_receive()"), err)
return False return False
# Execute eventual extra commands on this object after moving it # Execute eventual extra commands on this object after moving it
@ -942,7 +942,7 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
try: try:
self.at_after_move(source_location, **kwargs) self.at_after_move(source_location, **kwargs)
except Exception as err: except Exception as err:
logerr(errtxt % "at_after_move", err) logerr(errtxt.format(err="at_after_move"), err)
return False return False
return True return True
@ -971,8 +971,8 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
# we are deleting default home! # we are deleting default home!
default_home = None default_home = None
except Exception: except Exception:
string = _("Could not find default home '(#%d)'.") string = _("Could not find default home '(#{dbid})'.")
logger.log_err(string % default_home_id) logger.log_err(string.format(dbid=default_home_id))
default_home = None default_home = None
for obj in self.contents: for obj in self.contents:
@ -993,8 +993,8 @@ class DefaultObject(ObjectDB, metaclass=TypeclassBase):
if obj.has_account: if obj.has_account:
if home: if home:
string = "Your current location has ceased to exist," string = "Your current location has ceased to exist,"
string += " moving you to %s(#%d)." string += " moving you to (#{dbid})."
obj.msg(_(string) % (home.name, home.dbid)) obj.msg(_(string).format(dbid=home.dbid))
else: else:
# Famous last words: The account should never see this. # Famous last words: The account should never see this.
string = "This place should not exist ... contact an admin." string = "This place should not exist ... contact an admin."

View file

@ -48,15 +48,11 @@ class ScriptHandler(object):
next_repeat = script.time_until_next_repeat() next_repeat = script.time_until_next_repeat()
except Exception: except Exception:
next_repeat = "?" next_repeat = "?"
string += _( string += _("\n '{key}' ({next_repeat}/{interval}, {repeats} repeats): {desc}").format(
"\n '%(key)s' (%(next_repeat)s/%(interval)s, %(repeats)s repeats): %(desc)s" key=script.key, next_repeat=next_repeat,
) % { interval=interval,
"key": script.key, repeats=repeats,
"next_repeat": next_repeat, desc=script.desc)
"interval": interval,
"repeats": repeats,
"desc": script.desc,
}
return string.strip() return string.strip()
def add(self, scriptclass, key=None, autostart=True): def add(self, scriptclass, key=None, autostart=True):