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

Translations chapter for the guide #63

Merged
merged 11 commits into from
Oct 20, 2022
Merged

Translations chapter for the guide #63

merged 11 commits into from
Oct 20, 2022

Conversation

MichaelChirico
Copy link
Contributor

@MichaelChirico MichaelChirico commented Jul 20, 2022

Closes #34

@SaranjeetKaur
Copy link
Collaborator

Hi @MichaelChirico

This looks fantastic! - I have also been writing the same chapter as part of the GSoD 2022 project.
Would you mind if I add materials from my writeup here?

@tdhock
Copy link
Contributor

tdhock commented Aug 4, 2022

Hi @MichaelChirico this looks like a good start. For non-experts on gettext files, it would be useful to see a figure (node and edge diagram, nodes for files, edges for people/programs that create those files) or example (list of all files relevant to a given domain, in the source tree) to explain the relationship of the various files (pot, po, mo).

@MichaelChirico
Copy link
Contributor Author

Would you mind if I add materials from my writeup here?

Please do!

it would be useful to see a figure... or example... to explain the relationship of the various files

Great point!

13-translations.Rmd Outdated Show resolved Hide resolved
13-translations.Rmd Outdated Show resolved Hide resolved

## How translations work

Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,
There are two basic files with extensions `.pot` and `.po` that are usually required during the Translation process in R. The `.pot` files are the template files which contain the error messages, warnings, and other similar messages, in R. In the template `.pot` file these messages will be available in standard English against the placeholder `msgid "Standard English message is placed here"`. Below every `msgid` there will be a placeholder for the translated message called `msgstr ""` and it would always be empty (default) in the `.pot` file. The `msgstr` is to be filled in the corresponding `.po` file - to include the appropriate translation. Both the template `.pot` file and the translated `.po` file should stored in the same directory always. Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,

Copy link
Contributor

@benubah benubah Sep 7, 2022

Choose a reason for hiding this comment

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

Could you add a link to an example .pot and .po file at the SVN repo? May help curious readers quickly see what these files look like and what to expect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

implementation question -- what sort of link would be appropriate? Is a relative link possible? Or should we be perma-linking a commit from the r-devel/r-svn repo?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe just copy/paste a couple of lines from each as two code blocks? Something like

Suggested change
Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,
There are two basic files with extensions `.pot` and `.po` that are usually required during the Translation process in R. The `.pot` files are the template files which contain the error messages, warnings, and other similar messages, in R. In the template `.pot` file these messages will be available in standard English against the placeholder `msgid "Standard English message is placed here"`. Below every `msgid` there will be a placeholder for the translated message called `msgstr ""` and it would always be empty (default) in the `.pot` file. As an example, we look at how the string "Warning:" can be translated to other languages:
```
#: src/main/errors.c:491
msgid "Warning:"
msgstr ""
```
Which is taken from `po/R.pot` and the corresponding German translation
```
#: src/main/errors.c:491
msgid "Warning:"
msgstr "Warnung:"
```
at `po/de.po`. Both the template `.pot` file and the translated `.po` file should stored in the same directory always. Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,

@SaranjeetKaur
Copy link
Collaborator

@MichaelChirico - I've added some stuff in the chapter

Also this could be placed as chapter 8, that is, after the Documenting R chapter and before the Testing pre release R versions chapter - what do you think?

@SaranjeetKaur
Copy link
Collaborator

Once the chapter number is decided, can we open this for review?

@SaranjeetKaur SaranjeetKaur changed the title WIP: Translations chapter for the guide Translations chapter for the guide Sep 7, 2022
@hturner hturner requested a review from nbenn September 7, 2022 16:59
@benubah benubah added the gsod-2022 Google Season of Docs related task label Sep 7, 2022
Co-authored-by: Saranjeet Kaur <[email protected]>
13-translations.Rmd Outdated Show resolved Hide resolved
13-translations.Rmd Outdated Show resolved Hide resolved
13-translations.Rmd Outdated Show resolved Hide resolved

## How translations work

Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe just copy/paste a couple of lines from each as two code blocks? Something like

Suggested change
Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,
There are two basic files with extensions `.pot` and `.po` that are usually required during the Translation process in R. The `.pot` files are the template files which contain the error messages, warnings, and other similar messages, in R. In the template `.pot` file these messages will be available in standard English against the placeholder `msgid "Standard English message is placed here"`. Below every `msgid` there will be a placeholder for the translated message called `msgstr ""` and it would always be empty (default) in the `.pot` file. As an example, we look at how the string "Warning:" can be translated to other languages:
```
#: src/main/errors.c:491
msgid "Warning:"
msgstr ""
```
Which is taken from `po/R.pot` and the corresponding German translation
```
#: src/main/errors.c:491
msgid "Warning:"
msgstr "Warnung:"
```
at `po/de.po`. Both the template `.pot` file and the translated `.po` file should stored in the same directory always. Each of the default packages distributed with R (i.e., those found in `./src/library` such as `base`, `utils`,

@MichaelChirico
Copy link
Contributor Author

Sorry, the history's a bit hard to follow now that some of the comments are marked as Outdated. If you think I'm missing addressing something, please ping again.

More progress here...

08-translations.Rmd Show resolved Hide resolved

The `.pot` file is a snapshot of the messages available in a given **domain**. A domain in R typically identifies
a source package and a source language (either R or C/C++). For example, the file `R-base.pot`
(found in the R sources in `./src/library/base/po`) is a catalogue of all messages produced by R code in the
Copy link
Member

Choose a reason for hiding this comment

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

could make this a hyperlink to https://svn.r-project.org/R/trunk/src/library/base/po/, also elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we prefer a link to the svn trunk, or the GH mirror trunk? Former is more official of course, latter comes with syntax highlighting/other tooling integration, web-navigable history/blame, etc...

Copy link
Member

Choose a reason for hiding this comment

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

Yes, my first thought was that we should link to the official sources, but I like your later use of linking to highlighted lines and in general the GH mirror is easier to browse.

So, perhaps we can go with linking to the GH mirror whenever we just expect people to read the files in the browser (as throughout this chapter). To be very clear about it, we could add a footnote to the first link, to say that we are linking to the GH mirror in this chapter as it is a better interface for browsing the source files and link to the actual svn repo there (https://svn.r-project.org/R/trunk/)

08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
@hturner
Copy link
Member

hturner commented Sep 27, 2022

The existing sections seem nearly done. It could be good to finishing tidying those and merge them in before filling in new sections as I think the description of the .po/.poedit files will already be useful for people that are starting to contribute via weblate (c.f. #68).

@MichaelChirico
Copy link
Contributor Author

The existing sections seem nearly done. It could be good to finishing tidying those and merge them in before filling in new sections as I think the description of the .po/.poedit files will already be useful for people that are starting to contribute via weblate (c.f. #68).

Great idea, better to have something ready to refer to now that the translations are picking up a lot more traffic. That can also help direct efforts on where there are remaining points of confusion.

08-translations.Rmd Outdated Show resolved Hide resolved
@MichaelChirico
Copy link
Contributor Author

@SaranjeetKaur / @hturner thanks for both your reviews; let me know when you're happy to merge this initial version.

08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Show resolved Hide resolved
08-translations.Rmd Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Outdated Show resolved Hide resolved
08-translations.Rmd Show resolved Hide resolved
@SaranjeetKaur
Copy link
Collaborator

@all-contributors please add @MichaelChirico for content, doc, research

@allcontributors
Copy link
Contributor

@SaranjeetKaur

I've put up a pull request to add @MichaelChirico! 🎉

@SaranjeetKaur
Copy link
Collaborator

@all-contributors please add @bettinagruen for review, research, question

@allcontributors
Copy link
Contributor

@SaranjeetKaur

I've put up a pull request to add @bettinagruen! 🎉

@SaranjeetKaur
Copy link
Collaborator

@all-contributors please add @nbenn for review, research, question

@allcontributors
Copy link
Contributor

@SaranjeetKaur

I've put up a pull request to add @nbenn! 🎉

@SaranjeetKaur
Copy link
Collaborator

@all-contributors please add @benubah for content, review, research, question

@allcontributors
Copy link
Contributor

@SaranjeetKaur

I've put up a pull request to add @benubah! 🎉

@SaranjeetKaur
Copy link
Collaborator

@all-contributors please add @tdhock for review, research, question

@allcontributors
Copy link
Contributor

@SaranjeetKaur

I've put up a pull request to add @tdhock! 🎉

@SaranjeetKaur
Copy link
Collaborator

All the open comments and reviews on this chapter which might need further dicussions and work are now opened as new issues (with links to the original comment or review). As of now, I'm merging this PR so that the translations chapter is up on the devguide.

@MichaelChirico thank you for your contributions! :)

@SaranjeetKaur SaranjeetKaur merged commit 7c5ff95 into master Oct 20, 2022
@SaranjeetKaur SaranjeetKaur deleted the translations branch October 20, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsod-2022 Google Season of Docs related task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add translations chapter
7 participants