castedo / copyaid

Mirror of https://gitlab.com/castedo/copyaid
MIT License
0 stars 0 forks source link

Enable user setting of language tag parameter #8

Open castedo opened 10 months ago

castedo commented 10 months ago

Let lang_tag act as a standard parameter to be automatically passed to prompt (request) settings. This is for values per https://datatracker.ietf.org/doc/html/rfc5646 https://www.rfc-editor.org/info/bcp47 https://en.wikipedia.org/wiki/IETF_language_tag and the HTML lang tag.

Check a top-level key in the user config file (copyaid.toml) for lang_tag if a user wants to set it.

Extra nice addition feature is to

import locale
'-'.join(locale.getlocale()[0].split('_'))

to automatically populate this parameter if it is not specified in the config file.

castedo commented 10 months ago

Or maybe the key should be under [parameters] like:

[parameters]
lang_tag = 'en-US'
castedo commented 10 months ago

Or maybe within a descriptive defaults tables like:

[defaults.instruction]
parameters = { lang_tag = "en-GB" }

An advanced hook to allow special cases is a per task-instruction setting like

tasks.foobarit.instructions]
on = { prompt = "foobar.toml", parameters = { lang_tag = "en-GB" } }

or equiv

[tasks.foobarit.instructions.on.parameters]
lang_tag = "en-GB"