Add install_translations to allow more translations without worrying about package size

Open
#4,647 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
localization

Research direction

Start by inspecting the translation files under inst/po/zh_CN and the package’s .onAttach behavior. Reproduce the zh_CN locale test described in the issue, including installing without the .mo files and restarting R, then determine how the proposed install_translations interface should place them. Done means translations can be installed separately and recognized while the package ships without those files.

Written by the indexing model from the issue text.

Description

translation

I tested out the following yesterday:

  1. Remove the message lookup binary .mo files from inst/po/zh_CN/*
  2. Install data.table
  3. Confirm Chinese translations don't show up when run in zh_CN locale
  4. Restore the .mo files and copy them to the right place in the installed library
  5. Confirm Chinese translations show up now [ ** Actually, they don't ** ]
  6. Restart R (again in zh_CN). Confirm the Chinese translations work -- they do.

That means we can ship a version of the package without the .mo files, and offer an interface to download the .mo files & place them properly for the user. This way, we can open the door for other people to submit translations (there was a decent amount of demand for this when we first asked last year), without worrying about the implications of having to optimize the package size to be accepted on CRAN.

This could be part of the .onAttach message when we detect a locale that has translations, but which aren't installed.

There is still the issue of marginal maintenance burden for new languages to have in mind, so I would say to keep it to one or two more languages for the next (non-patch?) release.

TODO: check why exactly we need to restart R for the copied files to be recognized [this is minor]

PS @mattdowle I didn't see anything in the CRAN feedback about the package size, was there any issue there for 1.13.0?

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.