[R-pkg-devel] translation .mo files

Thomas J. Leeper tho@j|eeper @end|ng |rom gm@||@com
Sat Feb 8 13:11:23 CET 2020


Hi Paul,

Check out this doc file for suggested workflows:
https://stat.ethz.ch/R-manual/R-devel/library/tools/html/update_pkg_po.html

The key part is that you need to create a .pot file from which the .po
files are generated and edit. Then you need to "install" the
translations (before R CMD build) to get them in the right place. I
wouldn't recommend trying to do any of that by hand.

I once wrote a more convenient version of all of this (no longer on
CRAN) that might be helpful. See, especially this file:
https://github.com/RL10N/msgtools/blob/master/R/install_translations.R.
That package also contains translations so you can see an example of
where everything should end up.

Best,
-Thomas

Thomas J. Leeper

On Sat, Feb 8, 2020 at 11:05 AM <r-package-devel-request using r-project.org> wrote:

> Date: Sat, 8 Feb 2020 03:14:54 -0500
> From: Paul Gilbert <pgilbert902 using gmail.com>
> To: r-package-devel using r-project.org
> Subject: [R-pkg-devel] translation .mo files
> Message-ID: <053184fa-8caa-e09a-603f-9bd37cc2362c using gmail.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> I have been sent .po and .mo files with message translations for one of
> my packages. The .po file I know goes in the source package po/
> directory but I have not had .mo files previously. The translator thinks
> the .mo file goes in inst/po. The .mo file seems to be generated from
> the .po file, but I am not sure if that happens in the install of the
> source package, or in some pre-process. I thought I could determine this
> by looking at an installed package, but I don't see .po or .mo files in
> installed packages. So far I have had no luck finding documentation on
> these details. So I have three questions.
>
> -Should the .mo file be included in the package, and if so, where?
>
> -When a package is installed, where does the translation information go
> in the directory structure of the library?
>
> -Is this documented somewhere? (Please not a vague reference to 'Writing
> R Extensions', I've looked there and many other places. I need a section
> or page reference.)
>
> Thanks,
> Paul Gilbert
>



More information about the R-package-devel mailing list