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

added functionality to translate a whole struct #67

Merged
merged 2 commits into from
Sep 16, 2021

Conversation

PhilWaldmann
Copy link
Contributor

Hi,

thanks for the library.
I've added a function to translate the whole struct to a given locale.
This comes handy if you have a lot of fields to translate and don't want to put Trans.translate(struct, :field_name, locale) at every place a translated value is needed.

Thanks,
Philipp

@sourcelevel-bot
Copy link

Hello, @PhilWaldmann! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

lib/trans/translator.ex Outdated Show resolved Hide resolved
@PhilWaldmann
Copy link
Contributor Author

Hi,
did you have time to take a look at the changes?

Copy link
Owner

@crbelaus crbelaus left a comment

Choose a reason for hiding this comment

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

Hi @PhilWaldmann
Sorry, I didn't took a look into this PR until your last message.

This is absolutely great. Thank you very much! 🙇

@crbelaus crbelaus merged commit 5407d40 into crbelaus:main Sep 16, 2021
crbelaus pushed a commit that referenced this pull request Sep 16, 2021
There is a new `translate/2` function which automatically translates
all translatable fields into the given struct.
crbelaus pushed a commit that referenced this pull request Sep 16, 2021
There is a new `translate/2` function which automatically translates
all translatable fields into the given struct.
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.

2 participants