r2eng icon indicating copy to clipboard operation
r2eng copied to clipboard

Allow custom translations

Open matt-dray opened this issue 2 years ago • 3 comments
trafficstars

Maybe a user could provide a list object with preferred text for each token?

Something like:

r2eng::translate("1 / 1", dict = list("/" = "divided by")))  # rather than 'over'

It's probably preferable for this to be set as an option() so that it can always be applied when the function is called in a given session.

matt-dray avatar Feb 07 '23 22:02 matt-dray

Option sets the location of a “dictionary” file that’s set out in YAML?

mattkerlogue avatar Feb 07 '23 22:02 mattkerlogue

@mattkerlogue Ahaha, didn't realise you watched this repo. I was just thinking about tidying up this package soon—especially #10, #14 and #28—and then maybe even release a v0.1 eventually. (P.S. y r u such a YAML fanboi 🙃)

matt-dray avatar Feb 07 '23 22:02 matt-dray

Ahahah. Well it could specify a list or a YAML file, which the {yaml} package reads in as a list. Reason for thinking of a file was so that ’translations’ could be shared, e.g an “en-GB”, “en-US”, “en-CA”, “en-AU”, “en-pirate”.

mattkerlogue avatar Feb 07 '23 22:02 mattkerlogue