mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Prepare all .po files for updating by volunteers
This commit is contained in:
parent
ecf757ba7c
commit
7147e3e027
15 changed files with 9116 additions and 1773 deletions
|
|
@ -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
|
||||
updated after May 2021 will be missing translations.
|
||||
|
||||
|
||||
```eval_rst
|
||||
|
||||
+---------------+----------------------+--------------+
|
||||
|
|
@ -26,15 +25,15 @@ updated after May 2021 will be missing translations.
|
|||
+---------------+----------------------+--------------+
|
||||
| la | Latin | Feb 2021 |
|
||||
+---------------+----------------------+--------------+
|
||||
| po | Polish | Feb 2019 |
|
||||
| pl | Polish | Feb 2019 |
|
||||
+---------------+----------------------+--------------+
|
||||
| pt | Portugese | Dec 2015 |
|
||||
+---------------+----------------------+--------------+
|
||||
| ru-RU | Russian (Russia) | Apr 2020 |
|
||||
| ru | Russian (Russia) | Apr 2020 |
|
||||
+---------------+----------------------+--------------+
|
||||
| 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
|
||||
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
|
||||
translate hard-coded strings that the end player may see - things you can't
|
||||
easily change from your mygame/ folder. Outputs from Commands and
|
||||
Typeclasses are generally not translated, nor are command/log outputs -
|
||||
and these are likely to be the brunt of the text the player will see.
|
||||
translate *hard-coded strings that the end player may see* - things you
|
||||
can't easily change from your mygame/ folder. Outputs from Commands and
|
||||
Typeclasses are generally *not* translated, nor are console/log outputs.
|
||||
|
||||
```
|
||||
|
||||
> Windows Note: 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).
|
||||
```sidebar:: Windows users
|
||||
|
||||
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
|
||||
|
||||
```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
|
||||
`evennia/evennia/locale/`. You must make sure to have cloned this repository
|
||||
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!
|
||||
|
||||
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
|
||||
Quickstart](../Setup/Setup-Quickstart) page.
|
||||
with GIT and activated a python virtualenv as described on the
|
||||
[Setup Quickstart](../Setup/Setup-Quickstart) page.
|
||||
|
||||
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
|
||||
|
|
@ -127,25 +110,52 @@ command will not overwrite any existing strings so you can run it as much as you
|
|||
want.
|
||||
|
||||
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"
|
||||
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
|
||||
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
|
||||
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:
|
||||
you can. Once you are done, run
|
||||
|
||||
evennia compilemessages
|
||||
`evennia compilemessages`
|
||||
|
||||
This will go through all languages and create/update compiled files (`**.mo`)
|
||||
for them. This needs to be done whenever a `**.po` file is updated.
|
||||
This will compile all languages. Check your language and also check back to your
|
||||
`.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!
|
||||
Make a PR against Evennia with the updated `**.po` and `*.mo` files. Less
|
||||
ideally (if git is not your thing) you can also attach them to a new post in our
|
||||
forums.
|
||||
Make a PR against Evennia with the updated `**.po` file. Less ideally (if git is
|
||||
not your thing) you can also attach it to a new post in our 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})"
|
||||
|
|
|
|||
|
|
@ -13,41 +13,41 @@ Markdown files are simple text files that can be edited with a normal text edito
|
|||
contain raw HTML directives (but that is very rarely needed). They primarly use
|
||||
the [Markdown][commonmark] syntax. See [the syntax section below](#Editing-syntax) for more help.
|
||||
|
||||
## Source file structure
|
||||
## Source file structure
|
||||
|
||||
The sources are organized into several rough categories, with only a few administrative documents
|
||||
at the root of `evennia/docs/source/`. The folders are named in singular form since they will
|
||||
at the root of `evennia/docs/source/`. The folders are named in singular form since they will
|
||||
primarily be accessed as link refs (e.g. `Component/Account`)
|
||||
|
||||
- `source/Components/` are docs describing separate Evennia building blocks, that is, things
|
||||
that you can import and use. This extends and elaborates on what can be found out by reading
|
||||
the api docs themselves. Example are documentation for `Accounts`, `Objects` and `Commands`.
|
||||
- `source/Concepts/` describes how larger-scale features of Evennia hang together - things that
|
||||
can't easily be broken down into one isolated component. This can be general descriptions of
|
||||
how Models and Typeclasses interact to the path a message takes from the client to the server
|
||||
- `source/Concepts/` describes how larger-scale features of Evennia hang together - things that
|
||||
can't easily be broken down into one isolated component. This can be general descriptions of
|
||||
how Models and Typeclasses interact to the path a message takes from the client to the server
|
||||
and back.
|
||||
- `source/Setup/` holds detailed docs on installing, running and maintaining the Evennia server and
|
||||
the infrastructure around it.
|
||||
- `source/Coding/` has help on how to interact with, use and navigate the Evennia codebase itself.
|
||||
- `source/Setup/` holds detailed docs on installing, running and maintaining the Evennia server and
|
||||
the infrastructure around it.
|
||||
- `source/Coding/` has help on how to interact with, use and navigate the Evennia codebase itself.
|
||||
This also has non-Evennia-specific help on general development concepts and how to set up a sane
|
||||
development environment.
|
||||
- `source/Contribs/` holds documentation specifically for packages in the `evennia/contribs/` folder.
|
||||
Any contrib-specific tutorials will be found here instead of in `Howtos`
|
||||
- `source/Howtos/` holds docs that describe how to achieve a specific goal, effect or
|
||||
result in Evennia. This is often on a tutorial or FAQ form and will refer to the rest of the
|
||||
- `source/Howtos/` holds docs that describe how to achieve a specific goal, effect or
|
||||
result in Evennia. This is often on a tutorial or FAQ form and will refer to the rest of the
|
||||
documentation for further reading.
|
||||
- `source/Howtos/Starting/` holds all documents part of the initial tutorial sequence.
|
||||
|
||||
|
||||
|
||||
|
||||
Other files and folders:
|
||||
- `source/api/` contains the auto-generated API documentation as `.rst` files. Don't edit these
|
||||
files manually, your changes will be lost. To refer to these files, use `api:` followed by
|
||||
the Python path, for example `[rpsystem contrib](api:evennia.contrib.rpsystem)`.
|
||||
- `source/_templates` and `source/_static` should not be modified unless adding a new doc-page
|
||||
files manually, your changes will be lost. To refer to these files, use `api:` followed by
|
||||
the Python path, for example `[rpsystem contrib](api:evennia.contrib.rpsystem)`.
|
||||
- `source/_templates` and `source/_static` should not be modified unless adding a new doc-page
|
||||
feature or changing the look of the HTML documentation.
|
||||
- `conf.py` holds the Sphinx configuration. It should usually not be modified except to update
|
||||
the Evennia version on a new branch.
|
||||
|
||||
|
||||
|
||||
## Building the docs locally
|
||||
|
||||
|
|
@ -103,12 +103,12 @@ initialize a new game with a default database (you don't need to have any server
|
|||
running)
|
||||
|
||||
- It's recommended that you use a virtualenv. Install your cloned version of Evennia into
|
||||
by pointing to the repo folder (the one containing `/docs`):
|
||||
by pointing to the repo folder (the one containing `/docs`):
|
||||
|
||||
```
|
||||
pip install -e evennia
|
||||
pip install -e evennia
|
||||
```
|
||||
|
||||
|
||||
- Make sure you are in the parent folder _containing_ your `evennia/` repo (so _two_ levels
|
||||
up from `evennia/docs/`).
|
||||
- Create a new game folder called exactly `gamedir` at the same level as your `evennia`
|
||||
|
|
@ -118,8 +118,8 @@ repo with
|
|||
evennia --init gamedir
|
||||
```
|
||||
|
||||
- Then `cd` into it and create a new, empty database. You don't need to start the
|
||||
game or do any further changes after this.
|
||||
- Then `cd` into it and create a new, empty database. You don't need to start the
|
||||
game or do any further changes after this.
|
||||
|
||||
```
|
||||
evennia migrate
|
||||
|
|
@ -234,7 +234,7 @@ smaller and smaller font).
|
|||
|
||||
> Don't use the same heading/subheading name more than once in one page. While Markdown
|
||||
does not prevent it, it will make it impossible to refer to that heading uniquely.
|
||||
The Evennia documentation preparser will detect this and give you an error.
|
||||
The Evennia documentation preparser will detect this and give you an error.
|
||||
|
||||
### Lists
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ The Evennia documentation supports some special reference shortcuts in links:
|
|||
|
||||
##### Github online repository
|
||||
|
||||
- `github:` - a shortcut for the full path to the Evennia repository on github. This must be given
|
||||
- `github:` - a shortcut for the full path to the Evennia repository on github. This must be given
|
||||
with forward-slashes and include the `.py` file ending. It will refer to the `master` branch by default:
|
||||
|
||||
[link to objects.py](github:evennia/objects/objects.py)
|
||||
|
|
@ -337,8 +337,8 @@ with forward-slashes and include the `.py` file ending. It will refer to the `ma
|
|||
##### Bug reports/feature request
|
||||
|
||||
|
||||
- `github:issue` - links to the github issue selection page, where the user can choose which type of
|
||||
issue to create.
|
||||
- `github:issue` - links to the github issue selection page, where the user can choose which type of
|
||||
issue to create.
|
||||
|
||||
If you find a problem, make a [bug report](github:issue)!
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ as the name of the `language` of a literal block:
|
|||
````
|
||||
```eval_rst
|
||||
|
||||
This will be evaluated as ReST.
|
||||
This will be evaluated as ReST.
|
||||
All content must be indented.
|
||||
|
||||
```
|
||||
|
|
@ -420,14 +420,15 @@ 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_.
|
||||
- Double backticks around text makes it `verbatim`.
|
||||
- A link is written within back-ticks, with an underscore at the end:
|
||||
|
||||
`python <www.python.org>`_
|
||||
|
||||
|
||||
[Here is a ReST formatting cheat sheet](https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html).
|
||||
|
||||
Below are examples of ReST-block structures.
|
||||
|
|
@ -554,7 +555,7 @@ a plain HTML string in the markdown like so:
|
|||
|
||||
#### Tables
|
||||
|
||||
A table is specified using [ReST table syntax][ReST-tables] (they don't need to be indented):
|
||||
A table is specified using [ReST table syntax][ReST-tables] (they don't need to be indented):
|
||||
````
|
||||
```eval_rst
|
||||
|
||||
|
|
@ -610,7 +611,7 @@ or the more flexible but verbose
|
|||
#### A more flexible code block
|
||||
|
||||
The regular Markdown Python codeblock is usually enough but for more direct control over the style, one
|
||||
can also specify the code block explicitly in `ReST` for more flexibility.
|
||||
can also specify the code block explicitly in `ReST` for more flexibility.
|
||||
It also provides a link to the code block, identified by its name.
|
||||
|
||||
|
||||
|
|
@ -659,11 +660,11 @@ lines or captions since that's not a part of the Markdown specification.
|
|||
## Code documentation
|
||||
|
||||
The source code docstrings will be parsed as Markdown. When writing a module docstring, you can use Markdown formatting,
|
||||
including header levels down to 4th level (`#### SubSubSubHeader`). After the module documentation it's
|
||||
a good idea to end with four dashes `----`. This will create a visible line between the documentation and the
|
||||
including header levels down to 4th level (`#### SubSubSubHeader`). After the module documentation it's
|
||||
a good idea to end with four dashes `----`. This will create a visible line between the documentation and the
|
||||
class/function docs to follow. See for example [the Traits docs](api:evennia.contrib.traits).
|
||||
|
||||
All non-private classes, methods and functions must have a Google-style docstring, as per the
|
||||
All non-private classes, methods and functions must have a Google-style docstring, as per the
|
||||
[Evennia coding style guidelines][github:evennia/CODING_STYLE.md]. This will then be correctly formatted
|
||||
into pretty api docs.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue