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

feat: language support via locale config #96

Merged
merged 15 commits into from
Mar 9, 2023

Conversation

vcgtz
Copy link
Contributor

@vcgtz vcgtz commented Feb 21, 2023

This is an improvement for #69, this PR sets the language using the config command.

Examples:
Set Spanish
Screenshot from 2023-02-21 10-06-17

Set French
Screenshot from 2023-02-21 10-06-24

@privatenumber Can you take a look at this? I made the changes we discuss in the another PR, if you consider this is the right way to handle languages, I'll close the previous PR.

src/utils/config.ts Outdated Show resolved Hide resolved
src/utils/config.ts Outdated Show resolved Hide resolved
@privatenumber
Copy link
Collaborator

Thanks @vcgtz Looking forward to your changes.

@privatenumber privatenumber linked an issue Feb 22, 2023 that may be closed by this pull request
src/utils/config.ts Outdated Show resolved Hide resolved
@@ -22,6 +22,12 @@ const configParsers = {

return key;
},
language(key: string) {
Copy link
Collaborator

@privatenumber privatenumber Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be locale. And in the validation, it should say "Must be a valid locale (letters and dashes/underscores)".

Also, would be nice to be able to refer the user to a list of locales. Do you know if there's a standard list somewhere?

Copy link
Contributor Author

@vcgtz vcgtz Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it! 👍

I added a link to the Wikipedia list. I tried to get a link from the ISO organization but it was not possible. But I think the Wiki list is complete and as a reference could be good. Do you think that it's a good resource for reference?

src/utils/openai.ts Outdated Show resolved Hide resolved
src/utils/config.ts Outdated Show resolved Hide resolved
@privatenumber privatenumber changed the title Feat: Add support for multilanguage via configuration feat: language support via locale config Mar 9, 2023
@privatenumber privatenumber merged commit 58ce61e into Nutlope:develop Mar 9, 2023
@privatenumber
Copy link
Collaborator

Sorry for the delay and thanks!

@vcgtz
Copy link
Contributor Author

vcgtz commented Mar 9, 2023

Sorry for the delay and thanks!

@privatenumber Don't worry about it, it was my pleasure to contribute 👍

@TunaKHH
Copy link

TunaKHH commented Mar 16, 2023

Very useful feature , would you like to confirm that there will be a hint on how to use this feature in the readme?
like aicommits config set locale=<language code>

Or am I honored to help with this?

@vcgtz
Copy link
Contributor Author

vcgtz commented Mar 16, 2023

Very useful feature , would you like to confirm that there will be a hint on how to use this feature in the readme? like aicommits config set locale=<language code>

Or am I honored to help with this?

@STUTuna You're correct, that's how this feature works. I forgot to add it 🙈, but feel free to send a PR updating the docs with the instructions.

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

Successfully merging this pull request may close these issues.

Support configuration of multiple languages.
3 participants