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

Allow custom translations #29

Open
matt-dray opened this issue Feb 7, 2023 · 3 comments
Open

Allow custom translations #29

matt-dray opened this issue Feb 7, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@matt-dray
Copy link
Owner

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 matt-dray added the enhancement New feature or request label Feb 7, 2023
@mattkerlogue
Copy link

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

@matt-dray
Copy link
Owner Author

@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 🙃)

@mattkerlogue
Copy link

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”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants