Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Improved introduction to i18n for Cog authors and Translators #6351

Open
wants to merge 3 commits into
base: V3/develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions aikaterna's from code review
Many thanks to @aikaterna for reviewing and suggesting typo fixes.

Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
  • Loading branch information
jamesread and aikaterna authored Apr 11, 2024
commit 10bd4103aa99a39c32f7b0494cd0eb29635990e2
4 changes: 2 additions & 2 deletions docs/framework_i18n.rst
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ lots of different software projects.
* ``locales/`` directory, where ``.po`` files are stored.

So, if your are the author of a Cog, or you are adding translations for the first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is too unsure to be here. At the highest level, translating is a 3 step process:

  1. Update the code to reference strings in the proper way that they will be translated, and can be detected as needing translations by redgettext
  2. Use redgettext to generate a messages.pot file (must be re-done if strings are changed/added)
  3. Clone the latest messages.pot file into a lang-code.po file, and fill out the msgstrs for each string with the appropriate translation for that language/string.

At this point in the guide, we only know vaguely what a .pot and .po file are. We should not already be telling the CC they need to generate a .pot file before they have actually updated the code to support translations. We also should not be implying to translators that they can translate a cog simply by generating a .pot file without touching its code.

Realistically there should probably be 3 sections for each of these 3 steps, rather than For cog creators and For translators sections.

time to python code, you would probably generate ``.pot`` file to make your code
time to python code, you would probably generate ``.pot`` files to make your code
easily translatable. See below for instructions.

If you are trying to translate part of Red, or a Cog, you would write a ``.po``
@@ -46,7 +46,7 @@ For Cog authors

For authors of Cogs, it's very easy to make your bot translatable using the
Translator class provided - code samples can be found below. In summary, the
steps are;
steps are:

* Import the i18n Translator class and cog_i18n decorator.
* Decorate your class with @cog_i18n
Loading
Oops, something went wrong.